comparison mm7_2.cpp @ 531:72a92f0ec766

AlchemistDialog clean 1
author zipi
date Sun, 03 Mar 2013 11:24:48 +0000
parents 3d2292597422
children a4fe569c0d63
comparison
equal deleted inserted replaced
530:3d2292597422 531:72a92f0ec766
1667 v104.uFrameX = 483; 1667 v104.uFrameX = 483;
1668 v104.uFrameWidth = 148; 1668 v104.uFrameWidth = 148;
1669 v104.uFrameZ = 334; 1669 v104.uFrameZ = 334;
1670 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 1670 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
1671 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 1671 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
1672 if ( dword_F8B19C == 1 ) 1672 switch(dword_F8B19C)
1673 { 1673 {
1674 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1674 case 1:
1675 if ( result ) 1675 {
1676 { 1676 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1677 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; 1677 if ( result )
1678 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; 1678 {
1679 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; 1679 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
1680 v72 = 0; 1680 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
1681 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; 1681 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
1682 v73 = pShopOptions; 1682 v72 = 0;
1683 do 1683 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
1684 { 1684 v73 = pShopOptions;
1685 v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0); 1685 do
1686 ++v73; 1686 {
1687 v72 += v74; 1687 v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0);
1688 } 1688 ++v73;
1689 while ( (signed int)v73 < (signed int)&unk_F8B1C8 ); 1689 v72 += v74;
1690 v75 = pDialogueWindow; 1690 }
1691 Str = (char *)((174 - v72) / 4); 1691 while ( (signed int)v73 < (signed int)&unk_F8B1C8 );
1692 result = (POINT *)pDialogueWindow->pStartingPosActiveItem; 1692 v75 = pDialogueWindow;
1693 v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton); 1693 Str = (char *)((174 - v72) / 4);
1694 v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138; 1694 result = (POINT *)pDialogueWindow->pStartingPosActiveItem;
1695 v28 = -pDialogueWindow->pNumPresenceButton < 0; 1695 v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton);
1696 v112 = pDialogueWindow->pStartingPosActiveItem; 1696 v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138;
1697 if ( v28 ^ __OFSUB__((int)result, v76) ) 1697 v28 = -pDialogueWindow->pNumPresenceButton < 0;
1698 { 1698 v112 = pDialogueWindow->pStartingPosActiveItem;
1699 _this = (Player *)2; 1699 if ( v28 ^ __OFSUB__((int)result, v76) )
1700 v111 = (const char **)pShopOptions; 1700 {
1701 do 1701 _this = (Player *)2;
1702 { 1702 v111 = (const char **)pShopOptions;
1703 v78 = v75->GetControl(v112); 1703 do
1704 v79 = v111; 1704 {
1705 v78->uY = (unsigned int)&Str[v77]; 1705 v78 = v75->GetControl(v112);
1706 v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0); 1706 v79 = v111;
1707 v81 = v78->uY; 1707 v78->uY = (unsigned int)&Str[v77];
1708 v82 = _this; 1708 v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0);
1709 v78->uHeight = v80; 1709 v81 = v78->uY;
1710 v77 = v81 + v80 - 1; 1710 v82 = _this;
1711 v78->uW = v77; 1711 v78->uHeight = v80;
1712 v83 = v106; 1712 v77 = v81 + v80 - 1;
1713 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 ) 1713 v78->uW = v77;
1714 v83 = v108; 1714 v83 = v106;
1715 v104.DrawTitleText(pFontArrus, 0, v81, v83, *v111, 3u); 1715 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 )
1716 v75 = pDialogueWindow; 1716 v83 = v108;
1717 _this = (Player *)((char *)_this + 1); 1717 v104.DrawTitleText(pFontArrus, 0, v81, v83, *v111, 3u);
1718 ++v111; 1718 v75 = pDialogueWindow;
1719 ++v112; 1719 _this = (Player *)((char *)_this + 1);
1720 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); 1720 ++v111;
1721 } 1721 ++v112;
1722 while ( (signed int)v112 < (signed int)result ); 1722 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
1723 } 1723 }
1724 } 1724 while ( (signed int)v112 < (signed int)result );
1725 } 1725 }
1726 else 1726 }
1727 { 1727 return result;
1728 if ( dword_F8B19C != 2 ) 1728 }
1729 { 1729 case 3:
1730 if ( dword_F8B19C == 3 ) 1730 {
1731 {
1732 draw_leather(); 1731 draw_leather();
1733 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1732 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1734 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); 1733 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1735 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1734 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1736 if ( !result 1735 if ( !result
1748 v44 = (int)window_SpeakInHouse->ptr_1C; 1747 v44 = (int)window_SpeakInHouse->ptr_1C;
1749 v113 = uActiveCharacter - 1; 1748 v113 = uActiveCharacter - 1;
1750 v45 = _this->_490EEE(v87, 4, v44, 3); 1749 v45 = _this->_490EEE(v87, 4, v44, 3);
1751 v39 = v113; 1750 v39 = v113;
1752 v38 = (char *)pMerchantsSellPhrases[v45]; 1751 v38 = (char *)pMerchantsSellPhrases[v45];
1753 goto LABEL_45; 1752 v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93);
1754 } 1753 v92 = 3;
1755 if ( dword_F8B19C == 4 ) 1754 v90 = v21;
1756 { 1755 v88 = v108;
1757 draw_leather(); 1756 v86 = v3;
1757 v85 = v3;
1758 v84 = &v104;
1759 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
1760 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
1761 }
1762 case 4:
1763 {
1764 draw_leather();
1758 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1765 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1759 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); 1766 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1760 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1767 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1761 if ( !result 1768 if ( !result
1762 || (v36 = pMouse->GetCursorPos(&a2)->x - 14, 1769 || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
1776 v41 = (int)window_SpeakInHouse->ptr_1C; 1783 v41 = (int)window_SpeakInHouse->ptr_1C;
1777 v113 = uActiveCharacter - 1; 1784 v113 = uActiveCharacter - 1;
1778 v42 = _this->_490EEE(v37, 4, v41, 4); 1785 v42 = _this->_490EEE(v37, 4, v41, 4);
1779 v39 = v113; 1786 v39 = v113;
1780 v38 = (char *)pMerchantsIdentifyPhrases[v42]; 1787 v38 = (char *)pMerchantsIdentifyPhrases[v42];
1781 goto LABEL_45; 1788 }
1782 } 1789 else
1783 v89 = window_SpeakInHouse->ptr_1C; 1790 {
1784 v38 = "%24"; 1791 v89 = window_SpeakInHouse->ptr_1C;
1785 v87 = v37; 1792 v38 = "%24";
1786 LABEL_44: 1793 v87 = v37;
1787 v39 = uActiveCharacter - 1; 1794 v39 = uActiveCharacter - 1;
1788 LABEL_45: 1795 }
1789 v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93); 1796 v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93);
1790 v92 = 3; 1797 v92 = 3;
1791 v90 = v21; 1798 v90 = v21;
1792 v88 = v108; 1799 v88 = v108;
1793 v86 = v3; 1800 v86 = v3;
1794 v85 = v3; 1801 v85 = v3;
1795 v84 = &v104; 1802 v84 = &v104;
1796 goto LABEL_46; 1803 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
1797 } 1804 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
1798 if ( dword_F8B19C == 94 ) 1805 }
1799 { 1806 case 94:
1800 draw_leather(); 1807 {
1808 draw_leather();
1801 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1809 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1802 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; 1810 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
1803 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; 1811 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
1804 v22 = 0; 1812 v22 = 0;
1805 v23 = pShopOptions; 1813 v23 = pShopOptions;
1844 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); 1852 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
1845 } 1853 }
1846 while ( (signed int)v112 < (signed int)result ); 1854 while ( (signed int)v112 < (signed int)result );
1847 } 1855 }
1848 return result; 1856 return result;
1849 } 1857 }
1850 if ( dword_F8B19C != 95 ) 1858 case 2:
1851 { 1859 {
1852 result = (POINT *)(dword_F8B19C - 96); 1860 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
1853 if ( dword_F8B19C != 96 1861 v3 = 0;
1854 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 ) 1862 v114 = 0;
1855 return result; 1863 do
1864 {
1865 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
1866 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
1867 {
1868 v46 = ItemsInShopTexture[v114];
1869 v47 = 152 - v46->uTextureHeight;
1870 if ( (signed int)v47 < 1 )
1871 v47 = 0;
1872 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
1873 if ( v114 )
1874 {
1875 if ( v114 == 5 )
1876 {
1877 v49 = ItemsInShopTexture[5]->uTextureWidth;
1878 if ( (signed int)v48 > 457 - v49 )
1879 v48 = 457 - v49;
1880 }
1881 }
1882 else if ( (signed int)v48 < 18 )
1883 v48 = 18;
1884 pRenderer->DrawTextureTransparent(v48, v47, v46);
1885 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
1886 }
1887 ++v114;
1888 }
1889 while ( v114 < 6 );
1890 v114 = 0;
1891 do
1892 {
1893 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
1894 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
1895 {
1896 v50 = ItemsInShopTexture[v114 + 6];
1897 v51 = 308 - v50->uTextureHeight;
1898 if ( (signed int)v51 < 1 )
1899 v51 = 0;
1900 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
1901 if ( v114 )
1902 {
1903 if ( v114 == 5 )
1904 {
1905 v53 = ItemsInShopTexture[11]->uTextureWidth;
1906 if ( (signed int)v52 > 457 - v53 )
1907 v52 = 457 - v53;
1908 }
1909 }
1910 else
1911 {
1912 if ( (signed int)v52 < 18 )
1913 v52 = 18;
1914 }
1915 pRenderer->DrawTextureTransparent(v52, v51, v50);
1916 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
1917 }
1918 ++v114;
1919 }
1920 while ( v114 < 6 );
1921 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1922 if ( result )
1923 {
1924 v62 = 0;
1925 v109 = 0;
1926 do
1927 {
1928 // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
1929 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID);
1930 ++v109;
1931 ++v62;
1932 }
1933 while ( v62 < 12 );
1934 v63 = GetAsyncKeyState(17);
1935 v64 = _this->CanSteal();
1936 Str = (char *)v64;
1937 if ( v63 && v64 )
1938 {
1939 v65 = pGlobalTXT_LocalizationStrings[185];
1940 }
1941 else if ( dword_F8B19C == 2 )
1942 {
1943 v65 = pGlobalTXT_LocalizationStrings[195];
1944 }
1945 else
1946 {
1947 v65 = pGlobalTXT_LocalizationStrings[196];
1948 }
1949 DrawTextAtStatusBar(v65, 0);
1950 if ( !v109 )
1951 {
1952 v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1953 return 0;
1954 }
1955 v66 = pMouse->GetCursorPos(&v98);
1956 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
1957 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
1958 {
1959 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
1960 v109 = v67;
1961 v68 = (int)window_SpeakInHouse->ptr_1C;
1962 // v69 = 9 * (v67 + 12 * v68);
1963 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
1964 if ( dword_F8B19C != 2 )
1965 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
1966 if ( !v63 || !Str )
1967 {
1968 v93 = 0;
1969 v91 = 2;
1970 v89 = window_SpeakInHouse->ptr_1C;
1971 v87 = v70;
1972 v113 = uActiveCharacter - 1;
1973 v71 = _this->_490EEE(v70, 4, v68, 2);
1974 v39 = v113;
1975 v38 = (char *)pMerchantsBuyPhrases[v71];
1976 }
1977 else
1978 {
1979 v38 = pGlobalTXT_LocalizationStrings[181];
1980 v93 = 0;
1981 v91 = 2;
1982 v89 = window_SpeakInHouse->ptr_1C;
1983 v87 = v70;
1984 v39 = uActiveCharacter - 1;
1985 }
1986 v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93);
1987 v92 = 3;
1988 v90 = v21;
1989 v88 = v108;
1990 v86 = v3;
1991 v85 = v3;
1992 v84 = &v104;
1993 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
1994 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
1995 }
1996 }
1997 return result;
1998 }
1999 case 95:
2000 {
2001 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
2002 v3 = 0;
2003 v114 = 0;
2004 do
2005 {
2006 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2007 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
2008 {
2009 v54 = ItemsInShopTexture[v114];
2010 v55 = 152 - v54->uTextureHeight;
2011 if ( (signed int)v55 < 1 )
2012 v55 = 0;
2013 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
2014 if ( v114 )
2015 {
2016 if ( v114 == 5 )
2017 {
2018 v57 = ItemsInShopTexture[5]->uTextureWidth;
2019 if ( (signed int)v56 > 457 - v57 )
2020 v56 = 457 - v57;
2021 }
2022 }
2023 else
2024 {
2025 if ( (signed int)v56 < 18 )
2026 v56 = 18;
2027 }
2028 pRenderer->DrawTextureTransparent(v56, v55, v54);
2029 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
2030 }
2031 ++v114;
2032 }
2033 while ( v114 < 6 );
2034 v114 = 0;
2035 do
2036 {
2037 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak
2038 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
2039 {
2040 v58 = ItemsInShopTexture[v114 + 6];
2041 v59 = 308 - v58->uTextureHeight;
2042 if ( (signed int)v59 < 1 )
2043 v59 = 0;
2044 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
2045 if ( v114 )
2046 {
2047 if ( v114 == 5 )
2048 {
2049 v61 = ItemsInShopTexture[11]->uTextureWidth;
2050 if ( (signed int)v60 > 457 - v61 )
2051 v60 = 457 - v61;
2052 }
2053 }
2054 else
2055 {
2056 if ( (signed int)v60 < 18 )
2057 v60 = 18;
2058 }
2059 pRenderer->DrawTextureTransparent(v60, v59, v58);
2060 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
2061 }
2062 ++v114;
2063 }
2064 while ( v114 < 6 );
2065 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
2066 if ( result )
2067 {
2068 v62 = 0;
2069 v109 = 0;
2070 do
2071 {
2072 //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2073 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
2074 ++v109;
2075 ++v62;
2076 }
2077 while ( v62 < 12 );
2078 v63 = GetAsyncKeyState(17);
2079 v64 = _this->CanSteal();
2080 Str = (char *)v64;
2081 if ( v63 && v64 )
2082 {
2083 v65 = pGlobalTXT_LocalizationStrings[185];
2084 }
2085 else
2086 {
2087 v65 = pGlobalTXT_LocalizationStrings[195];
2088 if ( dword_F8B19C != 2 )
2089 v65 = pGlobalTXT_LocalizationStrings[196];
2090 }
2091 DrawTextAtStatusBar(v65, 0);
2092 if ( !v109 )
2093 {
2094 v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
2095 return 0;
2096 }
2097 v66 = pMouse->GetCursorPos(&v98);
2098 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
2099 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
2100 {
2101 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
2102 v109 = v67;
2103 v68 = (int)window_SpeakInHouse->ptr_1C;
2104 // v69 = 9 * (v67 + 12 * v68);
2105 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
2106 if ( dword_F8B19C != 2 )
2107 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
2108 if ( !v63 || !Str )
2109 {
2110 v93 = 0;
2111 v91 = 2;
2112 v89 = window_SpeakInHouse->ptr_1C;
2113 v87 = v70;
2114 v113 = uActiveCharacter - 1;
2115 v71 = _this->_490EEE(v70, 4, v68, 2);
2116 v39 = v113;
2117 v38 = (char *)pMerchantsBuyPhrases[v71];
2118 }
2119 else
2120 {
2121 v38 = pGlobalTXT_LocalizationStrings[181];
2122 v93 = 0;
2123 v91 = 2;
2124 v89 = window_SpeakInHouse->ptr_1C;
2125 v87 = v70;
2126 v39 = uActiveCharacter - 1;
2127 }
2128 v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93);
2129 v92 = 3;
2130 v90 = v21;
2131 v88 = v108;
2132 v86 = v3;
2133 v85 = v3;
2134 v84 = &v104;
2135 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
2136 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
2137 }
2138 }
2139 return result;
2140 }
2141 case 96:
2142 {
2143 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
2144 return 0;
1856 v2 = pDialogueWindow; 2145 v2 = pDialogueWindow;
1857 v3 = 0; 2146 v3 = 0;
1858 v4 = window_SpeakInHouse->ptr_1C; 2147 v4 = window_SpeakInHouse->ptr_1C;
1859 v112 = 0; 2148 v112 = 0;
1860 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0); 2149 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0);
1939 v90 = pTmpBuf; 2228 v90 = pTmpBuf;
1940 v88 = v106; 2229 v88 = v106;
1941 v86 = 0; 2230 v86 = 0;
1942 v85 = 0; 2231 v85 = 0;
1943 v84 = &v104; 2232 v84 = &v104;
1944 LABEL_46:
1945 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); 2233 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
1946 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); 2234 return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
1947 } 2235 }
1948 } 2236 default:
1949 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); 2237 {
1950 v3 = 0; 2238 return (POINT *)dword_F8B19C - 96;
1951 v114 = 0; 2239 }
1952 if ( dword_F8B19C == 2 ) 2240 }
1953 {
1954 do
1955 {
1956 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
1957 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
1958 {
1959 v46 = ItemsInShopTexture[v114];
1960 v47 = 152 - v46->uTextureHeight;
1961 if ( (signed int)v47 < 1 )
1962 v47 = 0;
1963 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
1964 if ( v114 )
1965 {
1966 if ( v114 == 5 )
1967 {
1968 v49 = ItemsInShopTexture[5]->uTextureWidth;
1969 if ( (signed int)v48 > 457 - v49 )
1970 v48 = 457 - v49;
1971 }
1972 }
1973 else
1974 {
1975 if ( (signed int)v48 < 18 )
1976 v48 = 18;
1977 }
1978 pRenderer->DrawTextureTransparent(v48, v47, v46);
1979 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
1980 }
1981 ++v114;
1982 }
1983 while ( v114 < 6 );
1984 v114 = 0;
1985 do
1986 {
1987 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
1988 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
1989 {
1990 v50 = ItemsInShopTexture[v114 + 6];
1991 v51 = 308 - v50->uTextureHeight;
1992 if ( (signed int)v51 < 1 )
1993 v51 = 0;
1994 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
1995 if ( v114 )
1996 {
1997 if ( v114 == 5 )
1998 {
1999 v53 = ItemsInShopTexture[11]->uTextureWidth;
2000 if ( (signed int)v52 > 457 - v53 )
2001 v52 = 457 - v53;
2002 }
2003 }
2004 else
2005 {
2006 if ( (signed int)v52 < 18 )
2007 v52 = 18;
2008 }
2009 pRenderer->DrawTextureTransparent(v52, v51, v50);
2010 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
2011 }
2012 ++v114;
2013 }
2014 while ( v114 < 6 );
2015 }
2016 else
2017 {
2018 do
2019 {
2020 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2021 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
2022 {
2023 v54 = ItemsInShopTexture[v114];
2024 v55 = 152 - v54->uTextureHeight;
2025 if ( (signed int)v55 < 1 )
2026 v55 = 0;
2027 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
2028 if ( v114 )
2029 {
2030 if ( v114 == 5 )
2031 {
2032 v57 = ItemsInShopTexture[5]->uTextureWidth;
2033 if ( (signed int)v56 > 457 - v57 )
2034 v56 = 457 - v57;
2035 }
2036 }
2037 else
2038 {
2039 if ( (signed int)v56 < 18 )
2040 v56 = 18;
2041 }
2042 pRenderer->DrawTextureTransparent(v56, v55, v54);
2043 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
2044 }
2045 ++v114;
2046 }
2047 while ( v114 < 6 );
2048 v114 = 0;
2049 do
2050 {
2051 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak
2052 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
2053 {
2054 v58 = ItemsInShopTexture[v114 + 6];
2055 v59 = 308 - v58->uTextureHeight;
2056 if ( (signed int)v59 < 1 )
2057 v59 = 0;
2058 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
2059 if ( v114 )
2060 {
2061 if ( v114 == 5 )
2062 {
2063 v61 = ItemsInShopTexture[11]->uTextureWidth;
2064 if ( (signed int)v60 > 457 - v61 )
2065 v60 = 457 - v61;
2066 }
2067 }
2068 else
2069 {
2070 if ( (signed int)v60 < 18 )
2071 v60 = 18;
2072 }
2073 pRenderer->DrawTextureTransparent(v60, v59, v58);
2074 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
2075 }
2076 ++v114;
2077 }
2078 while ( v114 < 6 );
2079 }
2080 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
2081 if ( result )
2082 {
2083 v62 = 0;
2084 v109 = 0;
2085 if ( dword_F8B19C == 2 )
2086 {
2087 do
2088 {
2089 // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
2090 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID);
2091 ++v109;
2092 ++v62;
2093 }
2094 while ( v62 < 12 );
2095 }
2096 else
2097 {
2098 do
2099 {
2100 //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2101 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
2102 ++v109;
2103 ++v62;
2104 }
2105 while ( v62 < 12 );
2106 }
2107 v63 = GetAsyncKeyState(17);
2108 v64 = _this->CanSteal();
2109 Str = (char *)v64;
2110 if ( v63 && v64 )
2111 {
2112 v65 = pGlobalTXT_LocalizationStrings[185];
2113 }
2114 else
2115 {
2116 v65 = pGlobalTXT_LocalizationStrings[195];
2117 if ( dword_F8B19C != 2 )
2118 v65 = pGlobalTXT_LocalizationStrings[196];
2119 }
2120 DrawTextAtStatusBar(v65, 0);
2121 if ( !v109 )
2122 {
2123 v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
2124 return 0;
2125 }
2126 v66 = pMouse->GetCursorPos(&v98);
2127 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
2128 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
2129 {
2130 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
2131 v109 = v67;
2132 v68 = (int)window_SpeakInHouse->ptr_1C;
2133 // v69 = 9 * (v67 + 12 * v68);
2134 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
2135 if ( dword_F8B19C != 2 )
2136 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
2137 if ( !v63 || !Str )
2138 {
2139 v93 = 0;
2140 v91 = 2;
2141 v89 = window_SpeakInHouse->ptr_1C;
2142 v87 = v70;
2143 v113 = uActiveCharacter - 1;
2144 v71 = _this->_490EEE(v70, 4, v68, 2);
2145 v39 = v113;
2146 v38 = (char *)pMerchantsBuyPhrases[v71];
2147 goto LABEL_45;
2148 }
2149 v38 = pGlobalTXT_LocalizationStrings[181];
2150 v93 = 0;
2151 v91 = 2;
2152 v89 = window_SpeakInHouse->ptr_1C;
2153 v87 = v70;
2154 goto LABEL_44;
2155 }
2156 }
2157 }
2158 return result;
2159 } 2241 }
2160 2242
2161 2243
2162 //----- (004BA928) -------------------------------------------------------- 2244 //----- (004BA928) --------------------------------------------------------
2163 void __cdecl ArmorShopDialog() 2245 void __cdecl ArmorShopDialog()