# HG changeset patch # User Ritor1 # Date 1378965316 -21600 # Node ID debc6edce54cdf1a2a37d5541ca7f18b32852aee # Parent fb809d1891bd75577b0ec12b88a63adc0bf5c3a2# Parent 1efbaf1d01c3d3fef1dbf57373c068ab8725b073 Слияние diff -r fb809d1891bd -r debc6edce54c GUIWindow.cpp --- a/GUIWindow.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/GUIWindow.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -1037,6 +1037,7 @@ TempleDialog(); break; case BuildingType_Stables: + case BuildingType_Boats: TravelByTransport(); break; case BuildingType_Training: @@ -1725,31 +1726,29 @@ if (eWindowType == WINDOW_HouseInterior) { pCurrentScreen = SCREEN_HOUSE; - pBtn_ExitCancel = pWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],// + pBtn_ExitCancel = pWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],// pIcons_LOD->GetTexture(uExitCancelTextureId), 0); - - for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) + for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) + { + if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) - { - v30 = pMapStats->pInfos[uHouse_ExitPic].pName; - v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; - } + v30 = pMapStats->pInfos[uHouse_ExitPic].pName; + v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; + } + else + { + if ( v26 || !dword_591080 ) + v27 = HouseNPCData[v26 +1 - ((dword_591080 != 0)? 1:0)]->pName; else - { - if ( v26 || !dword_591080 ) - v27 = HouseNPCData[v26 +1 - ((dword_591080 != 0)? 1:0)]->pName; - else - v27 = (char*)p2DEvents[pButton - 1].pProprieterName; - v30 = v27; - v29 = (char*)pGlobalTXT_LocalizationStrings[435]; - } - sprintfex(byte_591180[v26].data(), v29, v30); - dword_5913F4[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], - pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], - 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); + v27 = (char*)p2DEvents[pButton - 1].pProprieterName; + v30 = v27; + v29 = (char*)pGlobalTXT_LocalizationStrings[435]; } - + sprintfex(byte_591180[v26].data(), v29, v30); + HouseNPCPortraitsButtonsList[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], + pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], + 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); + } if ( uNumDialogueNPCPortraits == 1 ) { window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; diff -r fb809d1891bd -r debc6edce54c NPC.cpp --- a/NPC.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/NPC.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -1647,7 +1647,7 @@ else { for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) - dword_5913F4[i]->Release(); + HouseNPCPortraitsButtonsList[i]->Release(); } pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, diff -r fb809d1891bd -r debc6edce54c Render.cpp --- a/Render.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/Render.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -8470,7 +8470,7 @@ { InvalidateRect(0, 0, 0); MoveWindow(hWnd, uWindowX, uWindowY, uWindowWidth, uWindowHeight, 0); - ShowWindow(hWnd, 1); + ShowWindow(hWnd, SW_SHOWNORMAL); } pMouse->bActive = 1; if ( pVideoPlayer->AnyMovieLoaded() ) diff -r fb809d1891bd -r debc6edce54c UI/UIHouses.cpp --- a/UI/UIHouses.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/UI/UIHouses.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -89,8 +89,8 @@ { { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK - { 6, 7, 8, 8}, // HOUSE_STABLES_56 - { 9, 10, 10, 10}, // HOUSE_STABLES_57 + { 6, 7, 8, 8}, // HOUSE_STABLES_TULAREAN_FOREST + { 9, 10, 10, 10}, // HOUSE_STABLES_DEYJA { 11, 11, 12, 12}, // HOUSE_STABLES_58 { 13, 13, 13, 13}, // HOUSE_STABLES_59 { 14, 14, 15, 15}, // HOUSE_STABLES_60 @@ -989,7 +989,6 @@ { int experience_for_next_level; // eax@5 GUIWindow *v8; // esi@10 - //int v11; // edi@31 int v16; // eax@32 int v17; // eax@33 int v18; // eax@34 @@ -1910,283 +1909,196 @@ //----- (004B6943) -------------------------------------------------------- void TravelByTransport() { - GUIWindow *v0; // ebx@1 - Player *v1; // esi@1 - signed int v2; // edi@1 - unsigned int v3; // eax@1 signed int v4; // ebx@1 - stru365_travel_info *v5; // esi@7 - int v11; // ecx@12 + stru365_travel_info *pTravel; // esi@7 signed int v12; // esi@13 signed int v13; // edi@14 DWORD v14; // eax@26 DWORD v15; // edi@26 - GUIWindow *v16; // ebx@36 - int v17; // esi@36 - int v18; // eax@36 - int v19; // ecx@36 - int v20; // esi@36 - int v21; // eax@36 - void *v22; // eax@39 - int v23; // esi@39 - GUIButton *v24; // ebx@39 + int pTextHeight; // eax@36 + int pRealTextHeight; // esi@36 + int schedule_id; // esi@39 + GUIButton *pButton; // ebx@39 signed int v25; // eax@41 - //int v26; // esi@44 - //const char *v27; // eax@46 - char *v28; // eax@62 - int v29; // eax@62 unsigned int v30; // ecx@62 - char *v31; // eax@63 - MapInfo v32; // [sp-3Ch] [bp-2CCh]@62 - /*int v33; // [sp-38h] [bp-2C8h]@62 - int v34; // [sp-34h] [bp-2C4h]@62 - int v35; // [sp-30h] [bp-2C0h]@62 - int v36; // [sp-2Ch] [bp-2BCh]@62 - int v37; // [sp-28h] [bp-2B8h]@62 - int v38; // [sp-24h] [bp-2B4h]@62 - int v39; // [sp-20h] [bp-2B0h]@62 - int v40; // [sp-1Ch] [bp-2ACh]@62 - int v41; // [sp-18h] [bp-2A8h]@62 - int v42; // [sp-14h] [bp-2A4h]@62 - char *v43; // [sp-10h] [bp-2A0h]@62 - char *v44; // [sp-Ch] [bp-29Ch]@62 - unsigned int v45; // [sp-8h] [bp-298h]@62 - char *v46; // [sp-4h] [bp-294h]@62 - const char *v47[5]; // [sp+0h] [bp-290h]@7*/ - char v48[5][100]; // [sp+14h] [bp-27Ch]@37 - //char v49[100]; // [sp+78h] [bp-218h]@68 - //char v50[100]; // [sp+DCh] [bp-1B4h]@68 - //char v51[100]; // [sp+140h] [bp-150h]@68 - //char Dest[100]; // [sp+1A4h] [bp-ECh]@36 - GUIWindow v53; // [sp+208h] [bp-88h]@1 - int v54; // [sp+25Ch] [bp-34h]@36 - int v55; // [sp+260h] [bp-30h]@36 - //unsigned int v56; // [sp+264h] [bp-2Ch]@1 - //int v57; // [sp+268h] [bp-28h]@1 - int v58; // [sp+26Ch] [bp-24h]@36 - //GUIWindow *v59; // [sp+270h] [bp-20h]@1 - unsigned int v60; // [sp+274h] [bp-1Ch]@36 - //Player *v61; // [sp+278h] [bp-18h]@1 - int v62; // [sp+27Ch] [bp-14h]@36 - int v63; // [sp+280h] [bp-10h]@14 - char *a1; // [sp+284h] [bp-Ch]@37 - unsigned int s1; // [sp+288h] [bp-8h]@1 - int v66; // [sp+28Ch] [bp-4h]@48 + MapInfo pMap; // [sp-3Ch] [bp-2CCh]@62 + char pTopicArray[5][100]; // [sp+14h] [bp-27Ch]@37 + GUIWindow travel_window; // [sp+208h] [bp-88h]@1 + int pPrimaryTextHeight; // [sp+260h] [bp-30h]@36 + //unsigned int v60; // [sp+274h] [bp-1Ch]@36 + int index; // [sp+27Ch] [bp-14h]@36 + //char *a1; // [sp+284h] [bp-Ch]@37 + unsigned int pPrice; // [sp+288h] [bp-8h]@1 + int travel_time; // [sp+28Ch] [bp-4h]@48 + enum PlayerSpeech pSpeech; + unsigned int pCurrentButton; - v0 = window_SpeakInHouse; - memcpy(&v53, window_SpeakInHouse, sizeof(v53)); - v2 = 255; - //v61 = pPlayers[uActiveCharacter]; - v1 = pPlayers[uActiveCharacter]; - v53.uFrameX = 483; - v53.uFrameWidth = 148; - v53.uFrameZ = 334; - auto color_default = TargetColor(255, 255, 255); - auto color_selected = TargetColor(255, 255, 155); - v3 = 52 * (unsigned int)v0->ptr_1C; - //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50); - //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BuildingType_Stables) - 1) & 0xFFFFFFE7) + 50); - //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); + memcpy(&travel_window, window_SpeakInHouse, sizeof(travel_window)); + travel_window.uFrameX = 483; + travel_window.uFrameWidth = 148; + travel_window.uFrameZ = 334; - v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BuildingType_Stables ? 25 : 50; - v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier; + v4 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType == BuildingType_Stables ? 25 : 50; + v4 *= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; - s1 = v4 * (100 - v1->GetMerchant()) / 100; - if ( (signed int)s1 < v4 / 3 ) - s1 = v4 / 3; + pPrice = v4 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; + if ( (signed int)pPrice < v4 / 3 ) + pPrice = v4 / 3; if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) { if ( HouseUI_CheckIfPlayerCanInteract() ) { - v16 = pDialogueWindow; - v58 = 255; - v62 = 0; - v17 = LOBYTE(pFontArrus->uFontHeight) - 3; - //v59 = pDialogueWindow; - v54 = v17; - strcpy(v48[4], ""); - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold - v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0); - v19 = v16->pNumPresenceButton; - v20 = v18 + v17 + 146; - v21 = v16->pStartingPosActiveItem; - v63 = v20; - v55 = v20; - v60 = v21; - if ( v21 >= v21 + v19 ) - goto LABEL_71; - s1 = 2; - a1 = (char *)v48; - while ( 1 ) + index = 0; + strcpy(pTopicArray[4], ""); + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], pPrice); // Price: %lu gold + pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &travel_window, 0, 0); + pRealTextHeight = pTextHeight + (LOBYTE(pFontArrus->uFontHeight) - 3) + 146; + pPrimaryTextHeight = pRealTextHeight; + pCurrentButton = 2; + for ( uint i = pDialogueWindow->pStartingPosActiveItem; i < (unsigned int)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); ++i ) { - int v47 = v60; - v22 = window_SpeakInHouse->ptr_1C; - v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62]; - //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36 - //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land - v24 = v16->GetControl(v60); + schedule_id = transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][index]; + pButton = pDialogueWindow->GetControl(i); - if (v23 != v58) + if (schedule_id != 255) { - if (v23 >= 25) + if (schedule_id >= 25) Log::Warning(L"Transport UI: scedule overflow"); - if (s1 >= 6) + if ( pCurrentButton >= 6 ) v25 = true; else - v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7]; + v25 = transport_schedule[schedule_id].pSchedule[pParty->uDaysPlayed % 7]; } - if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) ) + if (schedule_id != 255 && v25 && (!transport_schedule[schedule_id].uQuestBit + || _449B57_test_bit(pParty->_quest_bits, transport_schedule[schedule_id].uQuestBit)) ) { - v58 = v23; - if ( pDialogueWindow->pCurrentPosActiveItem == s1 ) - sprintf(a1, "\f%05d", color_selected); - else - sprintf(a1, "\f%05d", color_default); - - //v32.uRedbookTrackID = v27; - v66 = transport_schedule[v23].uTravelTime; - if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 ) +//get color for current string( )------------ + if ( pDialogueWindow->pCurrentPosActiveItem == pCurrentButton ) + sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 155)); + else + sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 255)); + //hired NPC premium( )---------------------------------- + travel_time = transport_schedule[schedule_id].uTravelTime; + if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_EMERALD_ISLE ) { if ( CheckHiredNPCSpeciality(Sailor) ) - v66 -= 2; + travel_time -= 2; if ( CheckHiredNPCSpeciality(Navigator) ) - v66 -= 3; + travel_time -= 3; if ( CheckHiredNPCSpeciality(Pirate) ) - v66 -= 2; + travel_time -= 2; } else { if ( CheckHiredNPCSpeciality(Horseman) ) - v66 -= 2; + travel_time -= 2; } if ( CheckHiredNPCSpeciality(Explorer) ) - --v66; - if ( v66 < 1 ) - v66 = 1; - if ( v23 != v2 ) + --travel_time; + + if ( travel_time < 1 ) + travel_time = 1; + if ( schedule_id != 255 ) { - memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u); - sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s - v66, v32.pName); - strcat(a1, pTmpBuf.data()); - v28 = a1; - a1 += 100; - ++v62; - ++s1; - strcat(v28, "\n \n"); - v24->uY = v63; - v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0); - v30 = v24->uY; - v24->uHeight = v29; - v2 = 255; - v24->uW = v30 + v29 - 1; - v63 += v54 + v29; + memcpy(&pMap, &pMapStats->pInfos[transport_schedule[schedule_id].uMapInfoID], 0x44u); + sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], travel_time, pMap.pName); // Time - %d days, destination %s + strcat(pTopicArray[index], pTmpBuf.data()); + strcat(pTopicArray[index], "\n \n"); + pButton->uY = pRealTextHeight; + pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0); + v30 = pButton->uY; + pButton->uHeight = pTextHeight; + pButton->uW = v30 + pTextHeight - 1; + pRealTextHeight += (LOBYTE(pFontArrus->uFontHeight) - 3) + pTextHeight; } } else { - v31 = a1; - ++v62; - ++s1; - a1 += 100; - strcpy(v31, ""); - if ( v24 ) + strcpy(pTopicArray[index], ""); + if ( pButton ) { - v24->uW = 0; - v24->uHeight = 0; - v24->uY = 0; + pButton->uW = 0; + pButton->uHeight = 0; + pButton->uY = 0; } } - ++v60; - if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem ) - break; - //v16 = v59; + ++index; + ++pCurrentButton; } - if ( v63 != v55 ) + if ( pRealTextHeight != pPrimaryTextHeight ) { - /*v47[1] = &Dest; - v47[0] = &v51; - v46 = &v50; - v45 = (unsigned int)&v49; - v44 = &v48; - v43 = pTmpBuf2.data();*/ - sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]); - v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u); + sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), pTopicArray[0], pTopicArray[1], pTopicArray[2], pTopicArray[3], pTopicArray[4]); + travel_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3); } else { -LABEL_71: - v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138, - color_default, pGlobalTXT_LocalizationStrings[561], 3); + travel_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &travel_window, 0, 0)) / 2 + 138,//", " + TargetColor(255, 255, 255), pGlobalTXT_LocalizationStrings[561], 3); pAudioPlayer->StopChannels(-1, -1); } } } - else + else// { if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 ) { - if ( pParty->uNumGold < s1 ) + if ( pParty->uNumGold < pPrice ) { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); + ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//" " PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2); pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); return; } - Party::TakeGold(s1); + Party::TakeGold(pPrice); - v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]]; - if ( v5->pSchedule[pParty->uDaysPlayed % 7] ) + pTravel = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]]; + if ( pTravel->pSchedule[pParty->uDaysPlayed % 7] ) { - if ( _stricmp(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) ) + if ( _stricmp(pCurrentMapName, pMapStats->pInfos[pTravel->uMapInfoID].pFilename) ) { SaveGame(1, 0); - strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename); + strcpy(pCurrentMapName, pMapStats->pInfos[pTravel->uMapInfoID].pFilename); dword_6BE364_game_settings_1 |= 1u; _5B65B8_npcdata_hiword_house_or_other = 0; dword_5B65BC = 0; - _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y; - v11 = *((int *)v5 + 3); + _5B65B4_npcdata_loword_house_or_other = pTravel->arrival_rot_y; uGameState = GAME_STATE_2; - _5B65A8_npcdata_uflags_or_other = v11; - _5B65AC_npcdata_fame_or_other = v5->arrival_y; - _5B65B0_npcdata_rep_or_other = v5->arrival_z; - dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y; + _5B65A8_npcdata_uflags_or_other = pTravel->arrival_x; + _5B65AC_npcdata_fame_or_other = pTravel->arrival_y; + _5B65B0_npcdata_rep_or_other = pTravel->arrival_z; + dword_5B65C0 = pTravel->arrival_x | pTravel->arrival_y | pTravel->arrival_z | pTravel->arrival_rot_y; } else { pIndoorCamera->sRotationY = 0; pParty->uFlags |= 2u; - pParty->vPosition.x = v5->arrival_x; - pParty->vPosition.y = v5->arrival_y; - pParty->vPosition.z = v5->arrival_z; + pParty->vPosition.x = pTravel->arrival_x; + pParty->vPosition.y = pTravel->arrival_y; + pParty->vPosition.z = pTravel->arrival_z; pParty->uFallStartY = pParty->vPosition.z; pParty->sRotationX = 0; - pParty->sRotationY = v5->arrival_rot_y; + pParty->sRotationY = pTravel->arrival_rot_y; } PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful); - v12 = v5->uTravelTime; - int _v47; + v12 = pTravel->uTravelTime; if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) { - v63 = SPEECH_SetSail; + pSpeech = SPEECH_SetSail; v13 = 2500; if ( CheckHiredNPCSpeciality(Sailor) ) v12 -= 2; if ( CheckHiredNPCSpeciality(Navigator) ) v12 -= 3; - //_v47 = 45; if ( CheckHiredNPCSpeciality(Pirate) ) v12 -= 2; } else { - v63 = SPEECH_CarriageReady; + pSpeech = SPEECH_CarriageReady; v13 = 1500; - //_v47 = 35; if ( CheckHiredNPCSpeciality(Horseman) ) v12 -= 2; } @@ -2195,7 +2107,7 @@ if ( v12 < 1 ) v12 = 1; RestAndHeal(1440 * v12); - v1->PlaySound((PlayerSpeech)v63, 0); + pPlayers[uActiveCharacter]->PlaySound(pSpeech, 0); v14 = GetTickCount(); v15 = v14 + v13; if ( v15 < v14 ) @@ -2218,20 +2130,17 @@ //----- (004B68EA) -------------------------------------------------------- bool __fastcall IsTravelAvailable(int a1) { - for (uint i = 0; i < 4; ++i) + for ( uint i = 0; i < 4; ++i ) { - uint route = transport_routes[a1][i]; - if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7]) + if ( transport_schedule[transport_routes[a1][i]].pSchedule[pParty->uDaysPlayed % 7] ) { - if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit)) + if (!transport_schedule[transport_routes[a1][i]].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[transport_routes[a1][i]].uQuestBit)) return true; } } return false; } - - //----- (004B7911) -------------------------------------------------------- void TownHallDialog() { diff -r fb809d1891bd -r debc6edce54c UI/UIHouses.h --- a/UI/UIHouses.h Thu Sep 12 11:55:04 2013 +0600 +++ b/UI/UIHouses.h Thu Sep 12 11:55:16 2013 +0600 @@ -56,21 +56,21 @@ HOUSE_ALCHEMIST_HARMONDALE = 43, HOUSE_STABLES_HARMONDALE = 54, HOUSE_STABLES_STEADWICK = 55, - HOUSE_STABLES_56 = 56, - HOUSE_STABLES_57 = 57, - HOUSE_STABLES_58 = 58, - HOUSE_STABLES_59 = 59, - HOUSE_STABLES_60 = 60, + HOUSE_STABLES_TULAREAN_FOREST = 56, + HOUSE_STABLES_DEYJA = 57, + HOUSE_STABLES_BRACADA_DESERT = 58, + HOUSE_STABLES_TATALIA = 59, + HOUSE_STABLES_AVLEE = 60, HOUSE_STABLES_61 = 61, HOUSE_STABLES_62 = 62, - HOUSE_BOATS_63 = 63, - HOUSE_BOATS_64 = 64, - HOUSE_BOATS_65 = 65, - HOUSE_BOATS_66 = 66, - HOUSE_BOATS_67 = 67, + HOUSE_BOATS_EMERALD_ISLE = 63, + HOUSE_BOATS_ERATHIA = 64, + HOUSE_BOATS_TULAREAN_FOREST = 65, + HOUSE_BOATS_BRACADA_DESERT = 66, + HOUSE_BOATS_EVENMORN_ISLAND = 67, HOUSE_BOATS_68 = 68, - HOUSE_BOATS_69 = 69, - HOUSE_BOATS_70 = 70, + HOUSE_BOATS_TATALIA = 69, + HOUSE_BOATS_AVLEE = 70, HOUSE_BOATS_71 = 71, HOUSE_BOATS_72 = 72, HOUSE_BOATS_73 = 73, diff -r fb809d1891bd -r debc6edce54c mm7_2.cpp --- a/mm7_2.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/mm7_2.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -577,9 +577,6 @@ int sub_4BD8B5() { int v0; // eax@4 - int v1; // eax@29 - unsigned int v2; // esi@30 - //const char *v3; // ebx@31 if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; @@ -590,12 +587,9 @@ if ( pDialogueNPCCount ) { v0 = dialog_menu_id; - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD - && dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL - && dialog_menu_id != HOUSE_DIALOGUE_97 - && dialog_menu_id != HOUSE_DIALOGUE_SHOP_REPAIR - && dialog_menu_id != HOUSE_DIALOGUE_SHOP_IDENTIFY - && ShopTexture ) + if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD && dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL + && dialog_menu_id != HOUSE_DIALOGUE_97 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_REPAIR + && dialog_menu_id != HOUSE_DIALOGUE_SHOP_IDENTIFY && ShopTexture ) { ShopTexture->Release(); v0 = dialog_menu_id; @@ -644,23 +638,17 @@ dialog_menu_id = HOUSE_DIALOGUE_NULL; pDialogueWindow = 0; pIcons_LOD->SyncLoadedFilesCount(); - v1 = uNumDialogueNPCPortraits; if ( uNumDialogueNPCPortraits != 1 ) { - v2 = 0; pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; if ( uNumDialogueNPCPortraits > 0 ) { - //v3 = byte_591180; - do + for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) { - dword_5913F4[v2] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2], - 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2].data(), 0, 0, 0); - v1 = uNumDialogueNPCPortraits; - ++v2; - //v3 += 100; + HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], + pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], + 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); } - while ( (signed int)v2 < uNumDialogueNPCPortraits ); } pVideoPlayer->_4BF5B2(); return 1; @@ -3817,7 +3805,7 @@ //----- (00464761) -------------------------------------------------------- void Game_DeinitializeAndTerminate(int exitCode) { - SetPriorityClass(GetCurrentProcess(), 0x20u); + SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); pGame->Deinitialize(); pRenderer->Release2(); diff -r fb809d1891bd -r debc6edce54c mm7_data.cpp --- a/mm7_data.cpp Thu Sep 12 11:55:04 2013 +0600 +++ b/mm7_data.cpp Thu Sep 12 11:55:16 2013 +0600 @@ -1043,7 +1043,7 @@ int dword_59117C_teleportx; // weak std::array, 6> byte_591180; // idb std::array HouseNPCData;//0 zero element holds standart house npc -GUIButton* dword_5913F4[6]; +GUIButton* HouseNPCPortraitsButtonsList[6];//dword_5913F4 struct Texture *pTexture_591428; struct Texture *pTexture_outside; // idb struct Texture *pTexture_Dialogue_Background; diff -r fb809d1891bd -r debc6edce54c mm7_data.h --- a/mm7_data.h Thu Sep 12 11:55:04 2013 +0600 +++ b/mm7_data.h Thu Sep 12 11:55:16 2013 +0600 @@ -693,7 +693,7 @@ extern int dword_59117C_teleportx; // weak extern std::array, 6> byte_591180; // idb extern std::array HouseNPCData; //0this array size temporarily increased to 60 from 6 to work aroud house overflow -extern GUIButton* dword_5913F4[6]; +extern GUIButton* HouseNPCPortraitsButtonsList[6]; extern struct Texture *pTexture_591428; extern struct Texture *pTexture_outside; // idb extern struct Texture *pTexture_Dialogue_Background;