comparison GUIWindow.cpp @ 1211:fd3bea473c0c

fix HouseNpcdata array addresiing
author Gloval
date Sun, 09 Jun 2013 16:36:24 +0400
parents ab6560001f5b
children 746f7ef994cb
comparison
equal deleted inserted replaced
1209:decc0dd6e4ba 1211:fd3bea473c0c
1034 { 1034 {
1035 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; 1035 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle;
1036 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); 1036 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3);
1037 continue; 1037 continue;
1038 } 1038 }
1039 pTitleText = HouseNPCData[v8 - (dword_591080 != 0)]->pName; 1039 pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName;
1040 v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; 1040 v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2;
1041 } 1041 }
1042 v10 = v9; 1042 v10 = v9;
1043 pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, pTitleText, 3); 1043 pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3);
1044 } 1044 }
1045 } 1045 }
1046 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) 1046 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
1047 { 1047 {
1048 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 1048 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
1840 return pWindow; 1840 return pWindow;
1841 } 1841 }
1842 if (eWindowType == WINDOW_HouseInterior) 1842 if (eWindowType == WINDOW_HouseInterior)
1843 { 1843 {
1844 pCurrentScreen = SCREEN_HOUSE; 1844 pCurrentScreen = SCREEN_HOUSE;
1845 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания 1845 pBtn_ExitCancel = pWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания
1846 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); 1846 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
1847 v25 = uNumDialogueNPCPortraits; 1847
1848 v26 = 0;
1849 if ( uNumDialogueNPCPortraits > 0 )
1850 {
1851 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) 1848 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 )
1852 { 1849 {
1853 if ( v26 + 1 == v25 && uHouse_ExitPic ) 1850 if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic )
1854 { 1851 {
1855 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; 1852 v30 = pMapStats->pInfos[uHouse_ExitPic].pName;
1856 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; 1853 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S];
1857 } 1854 }
1858 else 1855 else
1859 { 1856 {
1860 if ( v26 || !dword_591080 ) 1857 if ( v26 || !dword_591080 )
1861 v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName; 1858 v27 = HouseNPCData[v26 +1 - (dword_591080 != 0)]->pName;
1862 else 1859 else
1863 //v27 = (char *)p2DEvents_minus1_::08[13 * a4];
1864 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; 1860 v27 = (char *)p2DEvents[pButton - 1].pProprieterName;
1865 v30 = v27; 1861 v30 = v27;
1866 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; 1862 v29 = (char*)pGlobalTXT_LocalizationStrings[435];
1867 } 1863 }
1868 sprintfex(byte_591180[v26].data(), v29, v30); 1864 sprintfex(byte_591180[v26].data(), v29, v30);
1869 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], 1865 dword_5913F4[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26],
1870 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], 1866 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26],
1871 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); 1867 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0);
1872 v25 = uNumDialogueNPCPortraits; 1868 }
1873 } 1869
1874 } 1870 if ( uNumDialogueNPCPortraits == 1 )
1875 if ( v25 == 1 )
1876 { 1871 {
1877 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; 1872 window_SpeakInHouse = &pWindowList[uNextFreeWindowID];
1878 _4B4224_UpdateNPCTopics(0); 1873 _4B4224_UpdateNPCTopics(0);
1879 } 1874 }
1880 } 1875 }