Mercurial > mm7
diff GUIWindow.cpp @ 1211:fd3bea473c0c
fix HouseNpcdata array addresiing
author | Gloval |
---|---|
date | Sun, 09 Jun 2013 16:36:24 +0400 |
parents | ab6560001f5b |
children | 746f7ef994cb |
line wrap: on
line diff
--- a/GUIWindow.cpp Sun Jun 09 13:20:34 2013 +0400 +++ b/GUIWindow.cpp Sun Jun 09 16:36:24 2013 +0400 @@ -1036,11 +1036,11 @@ pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); continue; } - pTitleText = HouseNPCData[v8 - (dword_591080 != 0)]->pName; - v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; + pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; + v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; } v10 = v9; - pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, pTitleText, 3); + pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); } } if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) @@ -1842,15 +1842,12 @@ if (eWindowType == WINDOW_HouseInterior) { pCurrentScreen = SCREEN_HOUSE; - pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания + pBtn_ExitCancel = pWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания pIcons_LOD->GetTexture(uExitCancelTextureId), 0); - v25 = uNumDialogueNPCPortraits; - v26 = 0; - if ( uNumDialogueNPCPortraits > 0 ) - { + for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) { - if ( v26 + 1 == v25 && uHouse_ExitPic ) + if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) { v30 = pMapStats->pInfos[uHouse_ExitPic].pName; v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; @@ -1858,21 +1855,19 @@ else { if ( v26 || !dword_591080 ) - v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName; + v27 = HouseNPCData[v26 +1 - (dword_591080 != 0)]->pName; else - //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; v27 = (char *)p2DEvents[pButton - 1].pProprieterName; v30 = v27; v29 = (char*)pGlobalTXT_LocalizationStrings[435]; } sprintfex(byte_591180[v26].data(), v29, v30); - HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], + 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); - v25 = uNumDialogueNPCPortraits; } - } - if ( v25 == 1 ) + + if ( uNumDialogueNPCPortraits == 1 ) { window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; _4B4224_UpdateNPCTopics(0);