Mercurial > mm7
comparison GUIWindow.cpp @ 454:5e5dfedcc0ad
Слияние
author | Ritor1 |
---|---|
date | Sun, 24 Feb 2013 09:18:17 +0600 |
parents | 9dc0dffaf7c6 afad358dc684 |
children | e5cf03a3d98e |
comparison
equal
deleted
inserted
replaced
453:eaadcb39312f | 454:5e5dfedcc0ad |
---|---|
1758 unsigned int uNextFreeWindowID; // ebp@1 | 1758 unsigned int uNextFreeWindowID; // ebp@1 |
1759 //int *v8; // eax@1 | 1759 //int *v8; // eax@1 |
1760 //GUIWindow *pWindow; // esi@4 | 1760 //GUIWindow *pWindow; // esi@4 |
1761 int v10; // eax@4 | 1761 int v10; // eax@4 |
1762 unsigned int v11; // ebx@15 | 1762 unsigned int v11; // ebx@15 |
1763 NPCData *v12; // ebp@15 | 1763 NPCData *speakingNPC; // ebp@15 |
1764 void *v13; // ecx@18 | 1764 int v14; // eax@20 |
1765 bool v14; // eax@20 | 1765 int v16; // eax@25 |
1766 void *v15; // ecx@23 | 1766 int v18; // eax@30 |
1767 bool v16; // eax@25 | 1767 int v20; // eax@35 |
1768 void *v17; // ecx@28 | 1768 int v22; // eax@40 |
1769 bool v18; // eax@30 | 1769 int v24; // eax@45 |
1770 void *v19; // ecx@33 | |
1771 bool v20; // eax@35 | |
1772 void *v21; // ecx@38 | |
1773 bool v22; // eax@40 | |
1774 void *v23; // ecx@43 | |
1775 bool v24; // eax@45 | |
1776 int v25; // eax@65 | 1770 int v25; // eax@65 |
1777 unsigned int v26; // ebx@65 | 1771 unsigned int v26; // ebx@65 |
1778 char *v27; // eax@71 | 1772 char *v27; // eax@71 |
1779 const char *v29; // [sp-8h] [bp-18h]@68 | 1773 const char *v29; // [sp-8h] [bp-18h]@68 |
1780 char *v30; // [sp-4h] [bp-14h]@68 | 1774 char *v30; // [sp-4h] [bp-14h]@68 |
1781 int uWidtha; // [sp+14h] [bp+4h]@66 | 1775 int uWidtha; // [sp+14h] [bp+4h]@66 |
1782 int a4a; // [sp+20h] [bp+10h]@15 | 1776 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
1783 | 1777 |
1784 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) | 1778 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) |
1785 { | 1779 { |
1786 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) | 1780 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) |
1787 break; | 1781 break; |
1817 pCurrentScreen = SCREEN_NPC_DIALOGUE; | 1811 pCurrentScreen = SCREEN_NPC_DIALOGUE; |
1818 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" | 1812 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
1819 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); | 1813 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
1820 if ( pWindow->ptr_1C != (void *)1 ) | 1814 if ( pWindow->ptr_1C != (void *)1 ) |
1821 { | 1815 { |
1822 a4a = 0; | 1816 num_menu_buttons = 0; |
1823 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; | 1817 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
1824 v12 = GetNPCData(uDialogue_SpeakingActorNPC_ID); | 1818 speakingNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); |
1825 if ( sub_445C8B(uDialogue_SpeakingActorNPC_ID) == 1 ) | 1819 if ( sub_445C8B(uDialogue_SpeakingActorNPC_ID) == 1 ) |
1826 { | 1820 { |
1827 if ( v12->joins ) | 1821 if ( speakingNPC->joins ) |
1828 { | 1822 { |
1829 pWindow->CreateButton(480, 130, 140, v11, 1, 0, 0x88u, 0xDu, 0, "", 0); | 1823 pWindow->CreateButton(480, 130, 140, v11, 1, 0, 0x88u, 0xDu, 0, "", 0); |
1830 a4a = 1; | 1824 num_menu_buttons = 1; |
1831 } | 1825 } |
1832 v13 = (void *)v12->evt_A; | 1826 if ( speakingNPC->evt_A ) |
1833 if ( v13 ) | |
1834 { | 1827 { |
1835 if ( a4a < 4 ) | 1828 if ( num_menu_buttons < 4 ) |
1836 { | 1829 { |
1837 v14 = sub_4466C4(v13); | 1830 v14 = NPC_EventProcessor(speakingNPC->evt_A); |
1838 if ( v14 == 1 || v14 == 2 ) | 1831 if ( v14 == 1 || v14 == 2 ) |
1839 pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x13u, 0, "", 0); | 1832 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x13u, 0, "", 0); |
1840 } | 1833 } |
1841 } | 1834 } |
1842 v15 = (void *)v12->evt_B; | 1835 if ( speakingNPC->evt_B ) |
1843 if ( v15 ) | |
1844 { | 1836 { |
1845 if ( a4a < 4 ) | 1837 if ( num_menu_buttons < 4 ) |
1846 { | 1838 { |
1847 v16 = sub_4466C4(v15); | 1839 v16 = NPC_EventProcessor(speakingNPC->evt_B); |
1848 if ( v16 == 1 || v16 == 2 ) | 1840 if ( v16 == 1 || v16 == 2 ) |
1849 pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x14u, 0, "", 0); | 1841 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x14u, 0, "", 0); |
1850 } | 1842 } |
1851 } | 1843 } |
1852 v17 = (void *)v12->evt_C; | 1844 if ( speakingNPC->evt_C ) |
1853 if ( v17 ) | |
1854 { | 1845 { |
1855 if ( a4a < 4 ) | 1846 if ( num_menu_buttons < 4 ) |
1856 { | 1847 { |
1857 v18 = sub_4466C4(v17); | 1848 v18 = NPC_EventProcessor(speakingNPC->evt_C); |
1858 if ( v18 == 1 || v18 == 2 ) | 1849 if ( v18 == 1 || v18 == 2 ) |
1859 pWindow->CreateButton( 0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x15u, 0, "", 0); | 1850 pWindow->CreateButton( 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x15u, 0, "", 0); |
1860 } | 1851 } |
1861 } | 1852 } |
1862 v19 = (void *)v12->evt_D; | 1853 if ( speakingNPC->evt_D ) |
1863 if ( v19 ) | |
1864 { | 1854 { |
1865 if ( a4a < 4 ) | 1855 if ( num_menu_buttons < 4 ) |
1866 { | 1856 { |
1867 v20 = sub_4466C4(v19); | 1857 v20 = NPC_EventProcessor(speakingNPC->evt_D); |
1868 if ( v20 == 1 || v20 == 2 ) | 1858 if ( v20 == 1 || v20 == 2 ) |
1869 pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x16u, 0, "", 0); | 1859 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x16u, 0, "", 0); |
1870 } | 1860 } |
1871 } | 1861 } |
1872 v21 = (void *)v12->evt_E; | 1862 if ( speakingNPC->evt_E ) |
1873 if ( v21 ) | |
1874 { | 1863 { |
1875 if ( a4a < 4 ) | 1864 if ( num_menu_buttons < 4 ) |
1876 { | 1865 { |
1877 v22 = sub_4466C4(v21); | 1866 v22 = NPC_EventProcessor(speakingNPC->evt_E); |
1878 if ( v22 == 1 || v22 == 2 ) | 1867 if ( v22 == 1 || v22 == 2 ) |
1879 pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x17u, 0, "", 0); | 1868 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x17u, 0, "", 0); |
1880 } | 1869 } |
1881 } | 1870 } |
1882 v23 = (void *)v12->evt_F; | 1871 if (speakingNPC->evt_F ) |
1883 if ( v23 ) | |
1884 { | 1872 { |
1885 if ( a4a < 4 ) | 1873 if ( num_menu_buttons < 4 ) |
1886 { | 1874 { |
1887 v24 = sub_4466C4(v23); | 1875 v24 = NPC_EventProcessor(speakingNPC->evt_F); |
1888 if ( v24 == 1 || v24 == 2 ) | 1876 if ( v24 == 1 || v24 == 2 ) |
1889 pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x18u, 0, "", 0); | 1877 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x18u, 0, "", 0); |
1890 } | 1878 } |
1891 } | 1879 } |
1892 } | 1880 } |
1893 else | 1881 else |
1894 { | 1882 { |
1895 if ( v12->joins ) | 1883 if ( speakingNPC->joins ) |
1896 { | 1884 { |
1897 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, 0x88u, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);// | 1885 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, 0x88u, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);// |
1898 if (v12->Hired()) | 1886 if (speakingNPC->Hired()) |
1899 { | 1887 { |
1900 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v12->pName); // | 1888 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); // |
1901 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x4Cu, 0, pTmpBuf, 0); | 1889 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x4Cu, 0, pTmpBuf, 0); |
1902 } | 1890 } |
1903 else | 1891 else |
1904 { | 1892 { |
1905 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);// | 1893 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);// |
1906 } | 1894 } |
1907 a4a = 2; | 1895 num_menu_buttons = 2; |
1908 } | 1896 } |
1909 } | 1897 } |
1910 pWindow->_41D08F(a4a, 1, 0, 1); | 1898 pWindow->_41D08F(num_menu_buttons, 1, 0, 1); |
1911 } | 1899 } |
1912 break; | 1900 break; |
1913 case WINDOW_ChangeLocation: | 1901 case WINDOW_ChangeLocation: |
1914 pMainScreenNum = pCurrentScreen; | 1902 pMainScreenNum = pCurrentScreen; |
1915 pCurrentScreen = SCREEN_CHANGE_LOCATION; | 1903 pCurrentScreen = SCREEN_CHANGE_LOCATION; |
1953 { | 1941 { |
1954 uWidtha = v26 + 1; | 1942 uWidtha = v26 + 1; |
1955 if ( v26 + 1 == v25 && uHouse_ExitPic ) | 1943 if ( v26 + 1 == v25 && uHouse_ExitPic ) |
1956 { | 1944 { |
1957 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; | 1945 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; |
1958 v29 = (char*)pGlobalTXT_LocalizationStrings[411];// ^Pv[%s] | 1946 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S];// ^Pv[%s] |
1959 } | 1947 } |
1960 else | 1948 else |
1961 { | 1949 { |
1962 if ( v26 || !dword_591080 ) | 1950 if ( v26 || !dword_591080 ) |
1963 v27 = array_5913D8[v26 - (dword_591080 != 0)]->pName; | 1951 v27 = array_5913D8[v26 - (dword_591080 != 0)]->pName; |
1964 else | 1952 else |
1965 //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; | 1953 //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; |
1966 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; | 1954 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; |
1967 v30 = v27; | 1955 v30 = v27; |
1968 v29 = (char*)pGlobalTXT_LocalizationStrings[435];// ^Pt[%s] | 1956 v29 = (char*)pGlobalTXT_LocalizationStrings[435];// "Converse with %s" ^Pt[%s] |
1969 } | 1957 } |
1970 sprintf(&byte_591180[100 * v26], v29, v30); | 1958 sprintf(&byte_591180[100 * v26], v29, v30); |
1971 array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], | 1959 array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], |
1972 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], | 1960 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], |
1973 0x3Fu, 0x49u, 1, 0, 0x19Au, v26, 0, &byte_591180[100 * v26], 0, 0, 0); | 1961 0x3Fu, 0x49u, 1, 0, 0x19Au, v26, 0, &byte_591180[100 * v26], 0, 0, 0); |