comparison UIHouses.cpp @ 749:f39fbeb65b28

Fixed bought items not disappearing from Armourer.
author Nomad
date Fri, 22 Mar 2013 23:26:01 +0200
parents 585490c29945
children 0b3f4b854652 9f7db515a8d7
comparison
equal deleted inserted replaced
748:daecb0225226 749:f39fbeb65b28
625 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 625 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
626 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); 626 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
627 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u); 627 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
628 switch(dialog_menu_id) 628 switch(dialog_menu_id)
629 { 629 {
630 case 1: 630 case HOUSE_DIALOGUE_MAIN:
631 { 631 {
632 v11 = 1; 632 v11 = 1;
633 pOutString = 0; 633 pOutString = 0;
634 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604]; 634 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
635 if ( pParty->uFine ) 635 if ( pParty->uFine )
676 } 676 }
677 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); 677 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
678 } 678 }
679 break; 679 break;
680 } 680 }
681 case 99: 681
682 case HOUSE_DIALOGUE_TOWNHALL_99:
682 { 683 {
683 v5 = &pMonsterStats->pInfos[word_F8B1A0]; 684 v5 = &pMonsterStats->pInfos[word_F8B1A0];
684 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 685 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
685 v7 = v5->pName; 686 v7 = v5->pName;
686 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 687 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
703 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428); 704 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
704 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0); 705 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0);
705 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0); 706 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
706 break; 707 break;
707 } 708 }
708 case 100: 709 case HOUSE_DIALOGUE_TOWNHALL_100:
709 { 710 {
710 v0 = window_SpeakInHouse; 711 v0 = window_SpeakInHouse;
711 if ( window_SpeakInHouse->field_40 == 1 ) 712 if ( window_SpeakInHouse->field_40 == 1 )
712 { 713 {
713 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); 714 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
794 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 795 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
795 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); 796 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
796 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); 797 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
797 switch(dialog_menu_id) 798 switch(dialog_menu_id)
798 { 799 {
799 case 1: 800 case HOUSE_DIALOGUE_MAIN:
800 { 801 {
801 v8 = v14[0]; 802 v8 = v14[0];
802 if ( pDialogueWindow->pCurrentPosActiveItem != 2 ) 803 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
803 v8 = v13[0]; 804 v8 = v13[0];
804 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u); 805 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
806 if ( pDialogueWindow->pCurrentPosActiveItem != 3 ) 807 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
807 v9 = v13[0]; 808 v9 = v13[0];
808 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u); 809 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
809 break; 810 break;
810 } 811 }
811 case 7: 812 case HOUSE_DIALOGUE_BANK_7:
812 { 813 {
813 v0 = window_SpeakInHouse; 814 v0 = window_SpeakInHouse;
814 if ( window_SpeakInHouse->field_40 != 1 ) 815 if ( window_SpeakInHouse->field_40 != 1 )
815 { 816 {
816 v1 = window_SpeakInHouse->field_40 - 2; 817 v1 = window_SpeakInHouse->field_40 - 2;
863 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); 864 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
864 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4); 865 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
865 break; 866 break;
866 } 867 }
867 868
868 case 8: 869 case HOUSE_DIALOGUE_BANK_8:
869 { 870 {
870 v0 = window_SpeakInHouse; 871 v0 = window_SpeakInHouse;
871 if ( window_SpeakInHouse->field_40 != 1 ) 872 if ( window_SpeakInHouse->field_40 != 1 )
872 { 873 {
873 v1 = window_SpeakInHouse->field_40 - 2; 874 v1 = window_SpeakInHouse->field_40 - 2;
1565 v58 = pGlobalTXT_LocalizationStrings[185]; 1566 v58 = pGlobalTXT_LocalizationStrings[185];
1566 } 1567 }
1567 else 1568 else
1568 { 1569 {
1569 v58 = pGlobalTXT_LocalizationStrings[195]; 1570 v58 = pGlobalTXT_LocalizationStrings[195];
1570 if ( dialog_menu_id != 2 ) 1571 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1571 v58 = pGlobalTXT_LocalizationStrings[196]; 1572 v58 = pGlobalTXT_LocalizationStrings[196];
1572 } 1573 }
1573 DrawTextAtStatusBar(v58, 0); 1574 DrawTextAtStatusBar(v58, 0);
1574 if ( v106.x ) 1575 if ( v106.x )
1575 { 1576 {
1580 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; 1581 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
1581 v106.x = v60; 1582 v106.x = v60;
1582 v61 = (int)window_SpeakInHouse->ptr_1C; 1583 v61 = (int)window_SpeakInHouse->ptr_1C;
1583 // v62 = 9 * (v60 + 12 * v61); 1584 // v62 = 9 * (v60 + 12 * v61);
1584 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; 1585 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1585 if ( dialog_menu_id != 2 ) 1586 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1586 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; 1587 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1587 if ( !v56 || !Str ) 1588 if ( !v56 || !Str )
1588 { 1589 {
1589 v64 = pPlayer->_490EEE(v63, 1, v61, 2); 1590 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
1590 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 1591 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1756 v58 = pGlobalTXT_LocalizationStrings[185]; 1757 v58 = pGlobalTXT_LocalizationStrings[185];
1757 } 1758 }
1758 else 1759 else
1759 { 1760 {
1760 v58 = pGlobalTXT_LocalizationStrings[195]; 1761 v58 = pGlobalTXT_LocalizationStrings[195];
1761 if ( dialog_menu_id != 2 ) 1762 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1762 v58 = pGlobalTXT_LocalizationStrings[196]; 1763 v58 = pGlobalTXT_LocalizationStrings[196];
1763 } 1764 }
1764 DrawTextAtStatusBar(v58, 0); 1765 DrawTextAtStatusBar(v58, 0);
1765 if ( v106.x ) 1766 if ( v106.x )
1766 { 1767 {
1771 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; 1772 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
1772 v106.x = v60; 1773 v106.x = v60;
1773 v61 = (int)window_SpeakInHouse->ptr_1C; 1774 v61 = (int)window_SpeakInHouse->ptr_1C;
1774 // v62 = 9 * (v60 + 12 * v61); 1775 // v62 = 9 * (v60 + 12 * v61);
1775 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; 1776 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1776 if ( dialog_menu_id != 2 ) 1777 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1777 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; 1778 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1778 if ( !v56 || !Str ) 1779 if ( !v56 || !Str )
1779 { 1780 {
1780 v64 = pPlayer->_490EEE(v63, 1, v61, 2); 1781 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
1781 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 1782 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1879 } 1880 }
1880 break; 1881 break;
1881 } 1882 }
1882 default: 1883 default:
1883 { 1884 {
1884 if( dialog_menu_id > 5 ) 1885 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
1885 pNumActiveItem = dialog_menu_id - 96; 1886 pNumActiveItem = dialog_menu_id - 96;
1886 else 1887 else
1887 pNumActiveItem = dialog_menu_id - 4; 1888 pNumActiveItem = dialog_menu_id - 4;
1888 break; 1889 break;
1889 } 1890 }
2125 Str = v64; 2126 Str = v64;
2126 if ( v63 && v64 ) 2127 if ( v63 && v64 )
2127 { 2128 {
2128 v65 = pGlobalTXT_LocalizationStrings[185]; 2129 v65 = pGlobalTXT_LocalizationStrings[185];
2129 } 2130 }
2130 else if ( dialog_menu_id == 2 ) 2131 else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2131 { 2132 {
2132 v65 = pGlobalTXT_LocalizationStrings[195]; 2133 v65 = pGlobalTXT_LocalizationStrings[195];
2133 } 2134 }
2134 else 2135 else
2135 { 2136 {
2145 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]; 2146 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
2146 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF ) 2147 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
2147 { 2148 {
2148 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; 2149 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
2149 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67]; 2150 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
2150 if ( dialog_menu_id != 2 ) 2151 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2151 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; 2152 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
2152 if ( !v63 || !Str ) 2153 if ( !v63 || !Str )
2153 { 2154 {
2154 v71 = pPlayer->_490EEE(v70, 4, (int)window_SpeakInHouse->ptr_1C, 2); 2155 v71 = pPlayer->_490EEE(v70, 4, (int)window_SpeakInHouse->ptr_1C, 2);
2155 v38 = (char *)pMerchantsBuyPhrases[v71]; 2156 v38 = (char *)pMerchantsBuyPhrases[v71];
2330 v65 = pGlobalTXT_LocalizationStrings[185]; 2331 v65 = pGlobalTXT_LocalizationStrings[185];
2331 } 2332 }
2332 else 2333 else
2333 { 2334 {
2334 v65 = pGlobalTXT_LocalizationStrings[195]; 2335 v65 = pGlobalTXT_LocalizationStrings[195];
2335 if ( dialog_menu_id != 2 ) 2336 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2336 v65 = pGlobalTXT_LocalizationStrings[196]; 2337 v65 = pGlobalTXT_LocalizationStrings[196];
2337 } 2338 }
2338 DrawTextAtStatusBar(v65, 0); 2339 DrawTextAtStatusBar(v65, 0);
2339 if ( !v109 ) 2340 if ( !v109 )
2340 { 2341 {
2348 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; 2349 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
2349 v109 = v67; 2350 v109 = v67;
2350 v68 = (int)window_SpeakInHouse->ptr_1C; 2351 v68 = (int)window_SpeakInHouse->ptr_1C;
2351 // v69 = 9 * (v67 + 12 * v68); 2352 // v69 = 9 * (v67 + 12 * v68);
2352 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; 2353 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
2353 if ( dialog_menu_id != 2 ) 2354 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2354 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; 2355 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
2355 if ( !v63 || !Str ) 2356 if ( !v63 || !Str )
2356 { 2357 {
2357 v71 = pPlayer->_490EEE(v70, 4, v68, 2); 2358 v71 = pPlayer->_490EEE(v70, 4, v68, 2);
2358 v38 = (char *)pMerchantsBuyPhrases[v71]; 2359 v38 = (char *)pMerchantsBuyPhrases[v71];
2670 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); 2671 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
2671 textureW = 0; 2672 textureW = 0;
2672 v153 = 0; 2673 v153 = 0;
2673 for(int i=0; i<8; ++i) 2674 for(int i=0; i<8; ++i)
2674 { 2675 {
2675 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID); 2676 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
2676 { 2677 {
2677 textureW = ItemsInShopTexture[i]->uTextureWidth; 2678 textureW = ItemsInShopTexture[i]->uTextureWidth;
2678 textureH = ItemsInShopTexture[i]->uTextureHeight; 2679 textureH = ItemsInShopTexture[i]->uTextureHeight;
2679 if ( i >= 4 ) //low row 2680 if ( i >= 4 ) //low row
2680 { 2681 {
2839 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 2840 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
2840 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3); 2841 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
2841 return; 2842 return;
2842 } 2843 }
2843 break; 2844 break;
2844 case 6: //buy standart 2845 case HOUSE_DIALOGUE_SHOP_6: //buy standart
2845 { 2846 {
2846 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); 2847 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
2847 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy" 2848 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
2848 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2849 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2849 return; 2850 return;
3221 strcpy(Dest, ""); 3222 strcpy(Dest, "");
3222 strcpy(v46, ""); 3223 strcpy(v46, "");
3223 strcpy(v47, ""); 3224 strcpy(v47, "");
3224 strcpy(v48, ""); 3225 strcpy(v48, "");
3225 strcpy(v49, ""); 3226 strcpy(v49, "");
3226 if ( dialog_menu_id != 1 ) 3227 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
3227 { 3228 {
3228 if ( dialog_menu_id != 18 ) //buy skill 3229 if ( dialog_menu_id != HOUSE_DIALOGUE_GULD_BUY_BOOKS ) //buy skill
3229 { 3230 {
3230 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 3231 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
3231 { 3232 {
3232 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill 3233 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill
3233 if ( v58->pActiveSkills[dialog_menu_id-36] ) 3234 if ( v58->pActiveSkills[dialog_menu_id-36] )
3307 } 3308 }
3308 while ( v9 ); 3309 while ( v9 );
3309 3310
3310 GetAsyncKeyState(17); 3311 GetAsyncKeyState(17);
3311 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" 3312 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
3312 if ( dialog_menu_id != 2 ) 3313 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
3313 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" 3314 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
3314 DrawTextAtStatusBar(statusbar_string, 0); 3315 DrawTextAtStatusBar(statusbar_string, 0);
3315 if ( !v8 ) 3316 if ( !v8 )
3316 { 3317 {
3317 working_window.DrawCurrentTime( 3318 working_window.DrawCurrentTime(
3548 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 3549 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
3549 v1 = pPlayers[uActiveCharacter]; 3550 v1 = pPlayers[uActiveCharacter];
3550 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]); 3551 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
3551 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); 3552 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
3552 HIDWORD(v60) = v2; 3553 HIDWORD(v60) = v2;
3553 if ( dialog_menu_id != 1 ) 3554 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
3554 { 3555 {
3555 if ( dialog_menu_id != 10 ) 3556 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
3556 { 3557 {
3557 if ( dialog_menu_id != 11 ) 3558 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
3558 { 3559 {
3559 3560
3560 if ( dialog_menu_id == 96 ) 3561 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
3561 { 3562 {
3562 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 3563 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
3563 { 3564 {
3564 v4 = pDialogueWindow; 3565 v4 = pDialogueWindow;
3565 v61 = pDialogueWindow; 3566 v61 = pDialogueWindow;
3955 //i = v11; 3956 //i = v11;
3956 } 3957 }
3957 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 3958 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
3958 if ( result ) 3959 if ( result )
3959 { 3960 {
3960 if ( dialog_menu_id != 1 ) 3961 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
3961 { 3962 {
3962 if ( dialog_menu_id != 17 ) 3963 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_17 )
3963 { 3964 {
3964 result = dialog_menu_id - 96; 3965 result = dialog_menu_id - 96;
3965 if ( dialog_menu_id == 96 ) 3966 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
3966 { 3967 {
3967 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 3968 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
3968 if ( result ) 3969 if ( result )
3969 { 3970 {
3970 //i = 0; 3971 //i = 0;
4378 dialog_window.uFrameX = 483; 4379 dialog_window.uFrameX = 483;
4379 dialog_window.uFrameWidth = 148; 4380 dialog_window.uFrameWidth = 148;
4380 dialog_window.uFrameZ = 334; 4381 dialog_window.uFrameZ = 334;
4381 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 4382 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
4382 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 4383 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
4383 if ( dialog_menu_id > 5 ) 4384 if ( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR )
4384 { 4385 {
4385 if ( dialog_menu_id == 94 ) 4386 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
4386 { 4387 {
4387 draw_leather(); 4388 draw_leather();
4388 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 4389 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
4389 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" 4390 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
4390 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" 4391 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
4432 } 4433 }
4433 while ( v118 < result ); 4434 while ( v118 < result );
4434 } 4435 }
4435 return; 4436 return;
4436 } 4437 }
4437 if ( dialog_menu_id != 95 ) 4438 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
4438 { 4439 {
4439 result = dialog_menu_id - 96; 4440 result = dialog_menu_id - HOUSE_DIALOGUE_LEARN_SKILLS;
4440 if ( dialog_menu_id == 96 ) 4441 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
4441 { 4442 {
4442 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 4443 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
4443 if ( result ) 4444 if ( result )
4444 { 4445 {
4445 v31 = pDialogueWindow; 4446 v31 = pDialogueWindow;
4536 return; 4537 return;
4537 } 4538 }
4538 } 4539 }
4539 else 4540 else
4540 { 4541 {
4541 if ( dialog_menu_id == 5 ) 4542 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
4542 { 4543 {
4543 draw_leather(); 4544 draw_leather();
4544 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 4545 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
4545 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" 4546 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
4546 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 4547 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
4562 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); 4563 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5);
4563 v9 = uPlayerID; 4564 v9 = uPlayerID;
4564 v10 = (char *)pMerchantsRepairPhrases[v29]; 4565 v10 = (char *)pMerchantsRepairPhrases[v29];
4565 goto LABEL_35; 4566 goto LABEL_35;
4566 } 4567 }
4567 if ( dialog_menu_id == 1 ) 4568 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
4568 { 4569 {
4569 /* result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 4570 /* result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
4570 if ( result ) 4571 if ( result )
4571 { 4572 {
4572 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard" 4573 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard"
4652 } 4653 }
4653 4654
4654 4655
4655 return; 4656 return;
4656 } 4657 }
4657 if ( dialog_menu_id != 2 ) 4658 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
4658 { 4659 {
4659 if ( dialog_menu_id != 3 ) 4660 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL)
4660 { 4661 {
4661 result = dialog_menu_id - 4; 4662 result = dialog_menu_id - HOUSE_DIALOGUE_SHOP_IDENTIFY;
4662 if ( dialog_menu_id == 4 ) 4663 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
4663 { 4664 {
4664 draw_leather(); 4665 draw_leather();
4665 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 4666 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
4666 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" 4667 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
4667 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 4668 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
4745 } 4746 }
4746 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); 4747 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
4747 v3 = 0; 4748 v3 = 0;
4748 v49 = 0; 4749 v49 = 0;
4749 v122 = 0; 4750 v122 = 0;
4750 if ( dialog_menu_id == 2 ) 4751 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
4751 { 4752 {
4752 do 4753 do
4753 { 4754 {
4754 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 4755 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
4755 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID); 4756 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID);
4880 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 4881 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
4881 if ( result ) 4882 if ( result )
4882 { 4883 {
4883 v66 = 0; 4884 v66 = 0;
4884 v117 = 0; 4885 v117 = 0;
4885 if ( dialog_menu_id == 2 ) 4886 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
4886 { 4887 {
4887 do 4888 do
4888 { 4889 {
4889 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 4890 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
4890 ++v117; 4891 ++v117;
4911 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" 4912 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
4912 } 4913 }
4913 else 4914 else
4914 { 4915 {
4915 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" 4916 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
4916 if ( dialog_menu_id != 2 ) 4917 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
4917 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" 4918 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
4918 } 4919 }
4919 DrawTextAtStatusBar(v69, 0); 4920 DrawTextAtStatusBar(v69, 0);
4920 if ( !v117 ) 4921 if ( !v117 )
4921 { 4922 {
4929 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; 4930 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
4930 v117 = v71; 4931 v117 = v71;
4931 v72 = (int)window_SpeakInHouse->ptr_1C; 4932 v72 = (int)window_SpeakInHouse->ptr_1C;
4932 // v73 = 9 * (v71 + 12 * v72); 4933 // v73 = 9 * (v71 + 12 * v72);
4933 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71]; 4934 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71];
4934 if ( dialog_menu_id != 2 ) 4935 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
4935 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; 4936 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
4936 v74 =&pParty->SpecialItemsInShops[v72][v71]; 4937 v74 =&pParty->SpecialItemsInShops[v72][v71];
4937 if ( v67 && Str ) 4938 if ( v67 && Str )
4938 { 4939 {
4939 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 4940 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"