Mercurial > mm7
comparison UI/UIShops.cpp @ 1393:28f87f5234a1
More hardcoded UI colors moved to varibables.
author | Nomad |
---|---|
date | Thu, 18 Jul 2013 16:11:57 +0200 |
parents | b51332ab228f |
children | d071e0e9ba75 |
comparison
equal
deleted
inserted
replaced
1392:e3e9c0467529 | 1393:28f87f5234a1 |
---|---|
125 | 125 |
126 switch(dialog_menu_id) | 126 switch(dialog_menu_id) |
127 { | 127 { |
128 case HOUSE_DIALOGUE_MAIN: | 128 case HOUSE_DIALOGUE_MAIN: |
129 { | 129 { |
130 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 130 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); |
131 if ( pNumActiveItem ) | 131 if ( pNumActiveItem ) |
132 { | 132 { |
133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; |
134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; |
135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; |
189 pItemNum += 70; | 189 pItemNum += 70; |
190 v48 = (const char **)((char *)v48 + 1); | 190 v48 = (const char **)((char *)v48 + 1); |
191 v109 = v48; | 191 v109 = v48; |
192 } | 192 } |
193 while ( (signed int)v48 < 6 ); | 193 while ( (signed int)v48 < 6 ); |
194 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 194 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); |
195 if ( pNumActiveItem ) | 195 if ( pNumActiveItem ) |
196 { | 196 { |
197 v55 = 0; | 197 v55 = 0; |
198 v106.x = 0; | 198 v106.x = 0; |
199 v106.x = 0; | 199 v106.x = 0; |
258 case HOUSE_DIALOGUE_SHOP_SELL: | 258 case HOUSE_DIALOGUE_SHOP_SELL: |
259 { | 259 { |
260 draw_leather(); | 260 draw_leather(); |
261 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 261 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
262 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); | 262 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); |
263 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 263 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
264 return; | 264 return; |
265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), | 265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), |
266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 | 266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 |
267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) | 267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) |
268 return; | 268 return; |
277 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | 277 case HOUSE_DIALOGUE_SHOP_IDENTIFY: |
278 { | 278 { |
279 draw_leather(); | 279 draw_leather(); |
280 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 280 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
281 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); | 281 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); |
282 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 282 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
283 return; | 283 return; |
284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), | 284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), |
285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 | 285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 |
286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) | 286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) |
287 return; | 287 return; |
305 case HOUSE_DIALOGUE_SHOP_REPAIR: | 305 case HOUSE_DIALOGUE_SHOP_REPAIR: |
306 { | 306 { |
307 draw_leather(); | 307 draw_leather(); |
308 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 308 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
309 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); | 309 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); |
310 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 310 if ( !HouseUI_CheckIfPlayerCanInteract()) |
311 return; | 311 return; |
312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), | 312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), |
313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 | 313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 |
314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) | 314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) |
315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) ) | 315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) ) |
380 } | 380 } |
381 v109 = (const char **)((char *)v109 + 1); | 381 v109 = (const char **)((char *)v109 + 1); |
382 pItemNum += 70; | 382 pItemNum += 70; |
383 } | 383 } |
384 while ( (signed int)v109 < 6 ); | 384 while ( (signed int)v109 < 6 ); |
385 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 385 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); |
386 if ( pNumActiveItem ) | 386 if ( pNumActiveItem ) |
387 { | 387 { |
388 v55 = 0; | 388 v55 = 0; |
389 v106.x = 0; | 389 v106.x = 0; |
390 do | 390 do |
446 break; | 446 break; |
447 } | 447 } |
448 | 448 |
449 case HOUSE_DIALOGUE_LEARN_SKILLS: | 449 case HOUSE_DIALOGUE_LEARN_SKILLS: |
450 { | 450 { |
451 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 451 if (!HouseUI_CheckIfPlayerCanInteract()) |
452 return; | 452 return; |
453 v0 = 0; | 453 v0 = 0; |
454 all_text_height = 0; | 454 all_text_height = 0; |
455 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); | 455 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); |
456 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 456 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
676 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u); | 676 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u); |
677 switch (dialog_menu_id) | 677 switch (dialog_menu_id) |
678 { | 678 { |
679 case HOUSE_DIALOGUE_MAIN: | 679 case HOUSE_DIALOGUE_MAIN: |
680 { | 680 { |
681 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 681 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
682 return; | 682 return; |
683 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 683 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
684 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 684 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
685 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 685 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" |
686 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 686 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
735 } | 735 } |
736 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1); | 736 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1); |
737 } | 737 } |
738 v153 += 105; | 738 v153 += 105; |
739 } | 739 } |
740 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 740 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
741 return; | 741 return; |
742 pItemCount = 0; | 742 pItemCount = 0; |
743 for ( int i = 0; i < 8; ++i ) | 743 for ( int i = 0; i < 8; ++i ) |
744 { | 744 { |
745 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID ) | 745 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID ) |
801 } | 801 } |
802 v153 += 105; | 802 v153 += 105; |
803 ++v61; | 803 ++v61; |
804 } | 804 } |
805 while ( v61 < 8 ); | 805 while ( v61 < 8 ); |
806 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 806 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
807 return; | 807 return; |
808 v68 = 0; | 808 v68 = 0; |
809 pItemCount = 0; | 809 pItemCount = 0; |
810 do | 810 do |
811 { | 811 { |
884 case HOUSE_DIALOGUE_SHOP_SELL: | 884 case HOUSE_DIALOGUE_SHOP_SELL: |
885 { | 885 { |
886 draw_leather(); | 886 draw_leather(); |
887 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 887 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
888 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell" | 888 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell" |
889 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 889 if ( !HouseUI_CheckIfPlayerCanInteract()) |
890 return; | 890 return; |
891 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), | 891 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), |
892 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 | 892 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 |
893 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) ) | 893 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) ) |
894 return; | 894 return; |
904 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | 904 case HOUSE_DIALOGUE_SHOP_IDENTIFY: |
905 { | 905 { |
906 draw_leather(); | 906 draw_leather(); |
907 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 907 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
908 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify" | 908 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify" |
909 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 909 if ( HouseUI_CheckIfPlayerCanInteract() ) |
910 { | 910 { |
911 v1 = pMouse->GetCursorPos(&a2)->x - 14; | 911 v1 = pMouse->GetCursorPos(&a2)->x - 14; |
912 pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5); | 912 pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5); |
913 if ( pMouse->GetCursorPos(&v141)->x > 13 ) | 913 if ( pMouse->GetCursorPos(&v141)->x > 13 ) |
914 { | 914 { |
938 case HOUSE_DIALOGUE_SHOP_REPAIR: | 938 case HOUSE_DIALOGUE_SHOP_REPAIR: |
939 { | 939 { |
940 draw_leather(); | 940 draw_leather(); |
941 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 941 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
942 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); | 942 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); |
943 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 943 if ( !HouseUI_CheckIfPlayerCanInteract()) |
944 return; | 944 return; |
945 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14, | 945 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14, |
946 pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5), | 946 pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5), |
947 pMouse->GetCursorPos(&v140)->x <= 13) | 947 pMouse->GetCursorPos(&v140)->x <= 13) |
948 || pMouse->GetCursorPos(&v138)->x >= 462 | 948 || pMouse->GetCursorPos(&v138)->x >= 462 |
960 break; | 960 break; |
961 case HOUSE_DIALOGUE_SHOP_6: //buy standart ??? | 961 case HOUSE_DIALOGUE_SHOP_6: //buy standart ??? |
962 { | 962 { |
963 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); | 963 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); |
964 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy" | 964 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy" |
965 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 965 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
966 return; | 966 return; |
967 pItemCount = 0; | 967 pItemCount = 0; |
968 for( int i = 0; i < 6 ; ++i ) | 968 for( int i = 0; i < 6 ; ++i ) |
969 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID) | 969 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID) |
970 ++pItemCount; | 970 ++pItemCount; |
1018 return; | 1018 return; |
1019 } | 1019 } |
1020 break; | 1020 break; |
1021 case HOUSE_DIALOGUE_LEARN_SKILLS: | 1021 case HOUSE_DIALOGUE_LEARN_SKILLS: |
1022 { | 1022 { |
1023 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1023 if (!HouseUI_CheckIfPlayerCanInteract() ) |
1024 return; | 1024 return; |
1025 v152 = 0; | 1025 v152 = 0; |
1026 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 1026 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
1027 pActiveButton = v38 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; | 1027 pActiveButton = v38 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
1028 if ( (signed int)pActiveButton < v38 / 3 ) | 1028 if ( (signed int)pActiveButton < v38 / 3 ) |
1217 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u); | 1217 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u); |
1218 switch(dialog_menu_id) | 1218 switch(dialog_menu_id) |
1219 { | 1219 { |
1220 case HOUSE_DIALOGUE_MAIN: | 1220 case HOUSE_DIALOGUE_MAIN: |
1221 { | 1221 { |
1222 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1222 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1223 { | 1223 { |
1224 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 1224 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; |
1225 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 1225 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; |
1226 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 1226 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; |
1227 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 1227 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
1316 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); | 1316 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); |
1317 } | 1317 } |
1318 ++v114; | 1318 ++v114; |
1319 } | 1319 } |
1320 while ( v114 < 6 ); | 1320 while ( v114 < 6 ); |
1321 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1321 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1322 { | 1322 { |
1323 v62 = 0; | 1323 v62 = 0; |
1324 v109 = 0; | 1324 v109 = 0; |
1325 do | 1325 do |
1326 { | 1326 { |
1378 case HOUSE_DIALOGUE_SHOP_SELL: | 1378 case HOUSE_DIALOGUE_SHOP_SELL: |
1379 { | 1379 { |
1380 draw_leather(); | 1380 draw_leather(); |
1381 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1381 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1382 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); | 1382 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); |
1383 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1383 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
1384 return; | 1384 return; |
1385 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), | 1385 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), |
1386 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 | 1386 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 |
1387 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) | 1387 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) |
1388 return; | 1388 return; |
1396 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | 1396 case HOUSE_DIALOGUE_SHOP_IDENTIFY: |
1397 { | 1397 { |
1398 draw_leather(); | 1398 draw_leather(); |
1399 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1399 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1400 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); | 1400 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); |
1401 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1401 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1402 return; | 1402 return; |
1403 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5), | 1403 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5), |
1404 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462 | 1404 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462 |
1405 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) | 1405 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) |
1406 return; | 1406 return; |
1518 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); | 1518 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); |
1519 } | 1519 } |
1520 ++v114; | 1520 ++v114; |
1521 } | 1521 } |
1522 while ( v114 < 6 ); | 1522 while ( v114 < 6 ); |
1523 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1523 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1524 { | 1524 { |
1525 v62 = 0; | 1525 v62 = 0; |
1526 v109 = 0; | 1526 v109 = 0; |
1527 do | 1527 do |
1528 { | 1528 { |
1578 } | 1578 } |
1579 return; | 1579 return; |
1580 } | 1580 } |
1581 case HOUSE_DIALOGUE_LEARN_SKILLS: | 1581 case HOUSE_DIALOGUE_LEARN_SKILLS: |
1582 { | 1582 { |
1583 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 1583 if (!HouseUI_CheckIfPlayerCanInteract()) |
1584 return; | 1584 return; |
1585 all_text_height = 0; | 1585 all_text_height = 0; |
1586 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 1586 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
1587 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100; | 1587 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100; |
1588 if ( pItemNum < v5 / 3 ) | 1588 if ( pItemNum < v5 / 3 ) |
1788 dialog_window.uFrameZ = 334; | 1788 dialog_window.uFrameZ = 334; |
1789 pWhiteColor = TargetColor(255, 255, 255); | 1789 pWhiteColor = TargetColor(255, 255, 255); |
1790 pYellowColor = TargetColor(225, 205, 35); | 1790 pYellowColor = TargetColor(225, 205, 35); |
1791 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) | 1791 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
1792 { | 1792 { |
1793 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1793 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
1794 return; | 1794 return; |
1795 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 1795 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
1796 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 1796 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
1797 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 1797 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" |
1798 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 1798 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
1886 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); | 1886 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); |
1887 } | 1887 } |
1888 ++v122; | 1888 ++v122; |
1889 } | 1889 } |
1890 while ( v122 < 6 ); | 1890 while ( v122 < 6 ); |
1891 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 1891 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1892 { | 1892 { |
1893 v66 = 0; | 1893 v66 = 0; |
1894 v117 = 0; | 1894 v117 = 0; |
1895 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 1895 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
1896 { | 1896 { |
2017 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); | 2017 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); |
2018 } | 2018 } |
2019 ++v122; | 2019 ++v122; |
2020 } | 2020 } |
2021 while ( v122 < 6 ); | 2021 while ( v122 < 6 ); |
2022 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2022 if ( HouseUI_CheckIfPlayerCanInteract() ) |
2023 { | 2023 { |
2024 v66 = 0; | 2024 v66 = 0; |
2025 v117 = 0; | 2025 v117 = 0; |
2026 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 2026 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
2027 { | 2027 { |
2127 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL) | 2127 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL) |
2128 { | 2128 { |
2129 draw_leather(); | 2129 draw_leather(); |
2130 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 2130 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
2131 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" | 2131 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" |
2132 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() | 2132 if ( !HouseUI_CheckIfPlayerCanInteract() |
2133 || (v11 = pMouse->GetCursorPos(&v107)->x - 14, | 2133 || (v11 = pMouse->GetCursorPos(&v107)->x - 14, |
2134 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), | 2134 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), |
2135 result = (int)pMouse->GetCursorPos(&v105), | 2135 result = (int)pMouse->GetCursorPos(&v105), |
2136 *(int *)result <= 13) | 2136 *(int *)result <= 13) |
2137 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) | 2137 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) |
2147 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) | 2147 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) |
2148 { | 2148 { |
2149 draw_leather(); | 2149 draw_leather(); |
2150 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 2150 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
2151 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" | 2151 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" |
2152 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2152 if ( HouseUI_CheckIfPlayerCanInteract() ) |
2153 { | 2153 { |
2154 v2 = pMouse->GetCursorPos(&a2)->x - 14; | 2154 v2 = pMouse->GetCursorPos(&a2)->x - 14; |
2155 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); | 2155 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); |
2156 result = (int)pMouse->GetCursorPos(&v111); | 2156 result = (int)pMouse->GetCursorPos(&v111); |
2157 if ( *(int *)result > 13 ) | 2157 if ( *(int *)result > 13 ) |
2184 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) | 2184 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) |
2185 { | 2185 { |
2186 draw_leather(); | 2186 draw_leather(); |
2187 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 2187 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
2188 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" | 2188 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" |
2189 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() | 2189 if ( !HouseUI_CheckIfPlayerCanInteract() |
2190 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, | 2190 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, |
2191 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), | 2191 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), |
2192 result = (int)pMouse->GetCursorPos(&v106), | 2192 result = (int)pMouse->GetCursorPos(&v106), |
2193 *(int *)result <= 13) | 2193 *(int *)result <= 13) |
2194 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) | 2194 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) |
2203 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | 2203 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); |
2204 return; | 2204 return; |
2205 } | 2205 } |
2206 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) | 2206 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) |
2207 { | 2207 { |
2208 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2208 if ( HouseUI_CheckIfPlayerCanInteract() ) |
2209 { | 2209 { |
2210 v3 = 0; | 2210 v3 = 0; |
2211 all_text_height = 0; | 2211 all_text_height = 0; |
2212 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 2212 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
2213 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); | 2213 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); |
2316 if ( pCurrentScreen == SCREEN_E ) | 2316 if ( pCurrentScreen == SCREEN_E ) |
2317 { | 2317 { |
2318 OnInventoryLeftClick(); | 2318 OnInventoryLeftClick(); |
2319 return; | 2319 return; |
2320 } | 2320 } |
2321 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2321 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
2322 { | 2322 { |
2323 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 2323 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
2324 return; | 2324 return; |
2325 } | 2325 } |
2326 | 2326 |