Mercurial > mm7
diff 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 |
line wrap: on
line diff
--- a/UI/UIShops.cpp Thu Jul 18 14:43:06 2013 +0200 +++ b/UI/UIShops.cpp Thu Jul 18 16:11:57 2013 +0200 @@ -127,7 +127,7 @@ { case HOUSE_DIALOGUE_MAIN: { - pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); if ( pNumActiveItem ) { pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; @@ -191,7 +191,7 @@ v109 = v48; } while ( (signed int)v48 < 6 ); - pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); if ( pNumActiveItem ) { v55 = 0; @@ -260,7 +260,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 @@ -279,7 +279,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 @@ -307,7 +307,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + if ( !HouseUI_CheckIfPlayerCanInteract()) return; if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 @@ -382,7 +382,7 @@ pItemNum += 70; } while ( (signed int)v109 < 6 ); - pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); if ( pNumActiveItem ) { v55 = 0; @@ -448,7 +448,7 @@ case HOUSE_DIALOGUE_LEARN_SKILLS: { - if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + if (!HouseUI_CheckIfPlayerCanInteract()) return; v0 = 0; all_text_height = 0; @@ -678,7 +678,7 @@ { case HOUSE_DIALOGUE_MAIN: { - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" @@ -737,7 +737,7 @@ } v153 += 105; } - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; pItemCount = 0; for ( int i = 0; i < 8; ++i ) @@ -803,7 +803,7 @@ ++v61; } while ( v61 < 8 ); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; v68 = 0; pItemCount = 0; @@ -886,7 +886,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell" - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + if ( !HouseUI_CheckIfPlayerCanInteract()) return; if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 @@ -906,7 +906,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify" - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v1 = pMouse->GetCursorPos(&a2)->x - 14; pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5); @@ -940,7 +940,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + if ( !HouseUI_CheckIfPlayerCanInteract()) return; if( (v31 = pMouse->GetCursorPos(&v135)->x - 14, pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5), @@ -962,7 +962,7 @@ { pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy" - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; pItemCount = 0; for( int i = 0; i < 6 ; ++i ) @@ -1020,7 +1020,7 @@ break; case HOUSE_DIALOGUE_LEARN_SKILLS: { - if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if (!HouseUI_CheckIfPlayerCanInteract() ) return; v152 = 0; v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); @@ -1219,7 +1219,7 @@ { case HOUSE_DIALOGUE_MAIN: { - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; @@ -1318,7 +1318,7 @@ ++v114; } while ( v114 < 6 ); - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v62 = 0; v109 = 0; @@ -1380,7 +1380,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 @@ -1398,7 +1398,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) return; if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5), pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462 @@ -1520,7 +1520,7 @@ ++v114; } while ( v114 < 6 ); - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v62 = 0; v109 = 0; @@ -1580,7 +1580,7 @@ } case HOUSE_DIALOGUE_LEARN_SKILLS: { - if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + if (!HouseUI_CheckIfPlayerCanInteract()) return; all_text_height = 0; v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); @@ -1790,7 +1790,7 @@ pYellowColor = TargetColor(225, 205, 35); if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) { - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) return; pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" @@ -1888,7 +1888,7 @@ ++v122; } while ( v122 < 6 ); - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v66 = 0; v117 = 0; @@ -2019,7 +2019,7 @@ ++v122; } while ( v122 < 6 ); - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v66 = 0; v117 = 0; @@ -2129,7 +2129,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() + if ( !HouseUI_CheckIfPlayerCanInteract() || (v11 = pMouse->GetCursorPos(&v107)->x - 14, v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), result = (int)pMouse->GetCursorPos(&v105), @@ -2149,7 +2149,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v2 = pMouse->GetCursorPos(&a2)->x - 14; v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); @@ -2186,7 +2186,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() + if ( !HouseUI_CheckIfPlayerCanInteract() || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), result = (int)pMouse->GetCursorPos(&v106), @@ -2205,7 +2205,7 @@ } if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) { - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( HouseUI_CheckIfPlayerCanInteract() ) { v3 = 0; all_text_height = 0; @@ -2318,7 +2318,7 @@ OnInventoryLeftClick(); return; } - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + if ( !HouseUI_CheckIfPlayerCanInteract() ) { pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); return;