diff UIHouses.cpp @ 753:e13ce1b0930d

Merge
author Gloval
date Sat, 23 Mar 2013 00:53:15 +0400
parents f39fbeb65b28
children 0b3f4b854652 9f7db515a8d7
line wrap: on
line diff
--- a/UIHouses.cpp	Sat Mar 23 00:50:58 2013 +0400
+++ b/UIHouses.cpp	Sat Mar 23 00:53:15 2013 +0400
@@ -30,6 +30,9 @@
 
 int dword_591080; // weak
 
+int in_current_building_type; // 00F8B198
+HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
+
 const stru159 pAnimatedRooms[196] = //0x4E5F70
     {
         {"",                            0x4, 0x1F4, 0, 0, 0},
@@ -624,7 +627,7 @@
   _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
   switch(dialog_menu_id)
   {
-	case 1:
+	case HOUSE_DIALOGUE_MAIN:
 		{
 		v11 = 1;
 		pOutString = 0;
@@ -675,7 +678,8 @@
 		}
 		break;
 		}
-	case 99:
+
+	case HOUSE_DIALOGUE_TOWNHALL_99:
 		{
 		v5 = &pMonsterStats->pInfos[word_F8B1A0];
 		v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
@@ -702,7 +706,7 @@
 		a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
 		break;
 		}
-	case 100:
+	case HOUSE_DIALOGUE_TOWNHALL_100:
 		{
 		v0 = window_SpeakInHouse;
 		if ( window_SpeakInHouse->field_40 == 1 )
@@ -793,7 +797,7 @@
   _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
   switch(dialog_menu_id)
   {
-	case 1:
+	case HOUSE_DIALOGUE_MAIN:
 		{
 		v8 = v14[0];
 		if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
@@ -805,7 +809,7 @@
 		_this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
 		break;
 		}
-	case 7:
+	case HOUSE_DIALOGUE_BANK_7:
 		{
 		v0 = window_SpeakInHouse;
 		if ( window_SpeakInHouse->field_40 != 1 )
@@ -862,7 +866,7 @@
 		break;
 		}
 
-	case 8:
+	case HOUSE_DIALOGUE_BANK_8:
 		{
 		v0 = window_SpeakInHouse;
 		if ( window_SpeakInHouse->field_40 != 1 )
@@ -1036,9 +1040,10 @@
     v7 = 1;
     v83 = 1;
   }
+
   switch(dialog_menu_id)
   {
-    case DIALOG_SHOP_MAIN:
+    case HOUSE_DIALOGUE_MAIN:
     {
       if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
           return;
@@ -1126,9 +1131,10 @@
       }
       break;
     }
-    case DIALOG_SHOP_ARCOMAGE_102:
+
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_102:
     {
-      __debugbreak;
+      __debugbreak();
       pOutString = pFontArrus;
       strcpy(pTmpBuf, pNPCTopics[354].pText);
       dialog_window.uFrameWidth = 460;
@@ -1146,9 +1152,9 @@
       window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
       break;
     }
-    case DIALOG_SHOP_ARCOMAGE_103:
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_103:
     {
-      __debugbreak;
+      __debugbreak();
       strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
       dialog_window.uFrameWidth = 460;
       dialog_window.uFrameZ = 452;
@@ -1161,7 +1167,7 @@
       window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
       break;
     }
-    case DIALOG_SHOP_ARCOMAGE_RESULT:
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
     {
       if ( pArcomageGame->bGameInProgress == 1 )
         return;
@@ -1181,14 +1187,15 @@
       dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf, 3);
       break;
     }
-    case DIALOG_SHOP_REST:
+
+    case HOUSE_DIALOGUE_TAVERN_REST:
     {
       if ( pParty->uNumGold >= (unsigned int)pOutString )
       {
         Party::TakeGold((unsigned int)pOutString);
         v27 = (int)window_SpeakInHouse->ptr_1C;
         PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney);
-        dialog_menu_id = 0;
+        dialog_menu_id = HOUSE_DIALOGUE_NULL;
         sub_4BD8B5();
         sub_4B1D27();
         pVideoPlayer->Unload();
@@ -1207,7 +1214,8 @@
       pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
       break;
     }
-    case DIALOG_SHOP_SKILLS:
+
+    case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
       if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
         return;
@@ -1280,7 +1288,8 @@
       dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf, 3);
       return;
     }
-    case DIALOG_SHOP_BYE_FOOD:
+
+    case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
     {
       *(_QWORD *)Str = pParty->uNumFoodRations;
       //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
@@ -1306,7 +1315,8 @@
       pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
       break;
     }
-    case DIALOG_SHOP_ARCOMAGE_MAIN:
+
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
     {
       if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
       {
@@ -1466,9 +1476,10 @@
   dialog_window.uFrameZ = 334;
   pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
+
   switch(dialog_menu_id)
   {
-    case DIALOG_SHOP_MAIN:
+    case HOUSE_DIALOGUE_MAIN:
     {
       pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
       if ( pNumActiveItem )
@@ -1509,7 +1520,8 @@
       }
       break;
     }
-    case DIALOG_SHOP_BUY_STANDART:
+
+    case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
     {
       pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
       v48 = 0;
@@ -1556,7 +1568,7 @@
         else
         {
           v58 = pGlobalTXT_LocalizationStrings[195];
-          if ( dialog_menu_id != 2 )
+          if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
             v58 = pGlobalTXT_LocalizationStrings[196];
         }
         DrawTextAtStatusBar(v58, 0);
@@ -1571,7 +1583,7 @@
             v61 = (int)window_SpeakInHouse->ptr_1C;
             //  v62 = 9 * (v60 + 12 * v61);
             v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
-            if ( dialog_menu_id != 2 )
+            if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
               v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
             if ( !v56 || !Str )
             {
@@ -1596,7 +1608,8 @@
       }
       break;
     }
-    case DIALOG_SHOP_SELL:
+
+    case HOUSE_DIALOGUE_SHOP_SELL:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -1614,7 +1627,8 @@
       dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
       break;
     }
-    case DIALOG_SHOP_IDENTIFY:
+
+    case HOUSE_DIALOGUE_SHOP_IDENTIFY:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -1641,7 +1655,8 @@
       }
       break;
     }
-    case DIALOG_SHOP_REPAIR:
+
+    case HOUSE_DIALOGUE_SHOP_REPAIR:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -1661,7 +1676,8 @@
       return;
     }
     break;
-    case DIALOG_SHOP_DISPLAY_EQUIPMENT:
+
+    case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -1699,7 +1715,8 @@
       }
       break;
     }
-    case DIALOG_SHOP_BUY_SPECIAL:
+
+    case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
     {
       pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
       v109 = 0;
@@ -1742,7 +1759,7 @@
         else
         {
           v58 = pGlobalTXT_LocalizationStrings[195];
-          if ( dialog_menu_id != 2 )
+          if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
             v58 = pGlobalTXT_LocalizationStrings[196];
         }
         DrawTextAtStatusBar(v58, 0);
@@ -1757,7 +1774,7 @@
             v61 = (int)window_SpeakInHouse->ptr_1C;
             //  v62 = 9 * (v60 + 12 * v61);
             v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
-            if ( dialog_menu_id != 2 )
+            if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
               v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
             if ( !v56 || !Str )
             {
@@ -1782,7 +1799,8 @@
       }
       break;
     }
-    case DIALOG_SHOP_SKILLS:
+
+    case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
       if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
         return;
@@ -1864,7 +1882,7 @@
     }
     default:
     {
-      if( dialog_menu_id > 5 )
+      if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
         pNumActiveItem = dialog_menu_id - 96;
       else
         pNumActiveItem = dialog_menu_id - 4;
@@ -1991,7 +2009,7 @@
   pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
   switch(dialog_menu_id)
   {
-    case DIALOG_SHOP_MAIN:
+    case HOUSE_DIALOGUE_MAIN:
     {
       if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
       {
@@ -2032,7 +2050,7 @@
       }
       return;
     }
-    case DIALOG_SHOP_BUY_STANDART:
+    case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
     {
       pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
       v114 = 0;
@@ -2110,7 +2128,7 @@
         {
           v65 = pGlobalTXT_LocalizationStrings[185];
         }
-        else if ( dialog_menu_id == 2 )
+        else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
         {
           v65 = pGlobalTXT_LocalizationStrings[195];
         }
@@ -2130,7 +2148,7 @@
         {
           v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
           v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
-          if ( dialog_menu_id != 2 )
+          if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
             v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
           if ( !v63 || !Str )
           {
@@ -2149,7 +2167,7 @@
       }
       return;
     }
-    case DIALOG_SHOP_SELL:
+    case HOUSE_DIALOGUE_SHOP_SELL:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2167,7 +2185,7 @@
       dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
       return; 
     }
-    case DIALOG_SHOP_IDENTIFY:
+    case HOUSE_DIALOGUE_SHOP_IDENTIFY:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2193,7 +2211,7 @@
       dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
       return;
     }
-    case DIALOG_SHOP_DISPLAY_EQUIPMENT:
+    case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2231,7 +2249,7 @@
       }
       return;
     }
-    case DIALOG_SHOP_BUY_SPECIAL:
+    case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
     {
       pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
       v114 = 0;
@@ -2315,7 +2333,7 @@
         else
         {
           v65 = pGlobalTXT_LocalizationStrings[195];
-          if ( dialog_menu_id != 2 )
+          if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
             v65 = pGlobalTXT_LocalizationStrings[196];
         }
         DrawTextAtStatusBar(v65, 0);
@@ -2333,7 +2351,7 @@
           v68 = (int)window_SpeakInHouse->ptr_1C;
           //  v69 = 9 * (v67 + 12 * v68);
           v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
-          if ( dialog_menu_id != 2 )
+          if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
             v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
           if ( !v63 || !Str )
           {
@@ -2352,7 +2370,7 @@
       }
       return;
     }
-    case DIALOG_SHOP_SKILLS:
+    case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
       if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
         return;
@@ -2611,7 +2629,7 @@
     hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
     switch (dialog_menu_id)
     {
-    case DIALOG_SHOP_MAIN:
+    case HOUSE_DIALOGUE_MAIN:
         {
         if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
             return;
@@ -2648,14 +2666,14 @@
             }
         }
         break;
-    case DIALOG_SHOP_BUY_STANDART:
+    case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
         {
         pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
         textureW = 0;
         v153 = 0;
         for(int i=0; i<8; ++i)
             {
-            if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID);
+            if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
                 {
                 textureW = ItemsInShopTexture[i]->uTextureWidth;
                 textureH = ItemsInShopTexture[i]->uTextureHeight;
@@ -2728,7 +2746,7 @@
         return;
         }
         break;
-    case DIALOG_SHOP_SELL:
+    case HOUSE_DIALOGUE_SHOP_SELL:
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2750,7 +2768,7 @@
       return;
     }
     break;
-    case DIALOG_SHOP_IDENTIFY:
+    case HOUSE_DIALOGUE_SHOP_IDENTIFY:
         {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2794,7 +2812,7 @@
             }
         }
         break;
-    case DIALOG_SHOP_REPAIR:
+    case HOUSE_DIALOGUE_SHOP_REPAIR:
         {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2824,7 +2842,7 @@
         return;
         }
         break;
-    case 6: //buy standart
+    case HOUSE_DIALOGUE_SHOP_6: //buy standart
         {
         pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
         DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
@@ -2890,7 +2908,7 @@
         return;
         }
         break;
-    case DIALOG_SHOP_DISPLAY_EQUIPMENT:
+    case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
         {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -2937,7 +2955,7 @@
         return;
         }
         break;
-    case DIALOG_SHOP_BUY_SPECIAL:
+    case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
         {
         pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
         v11 = 0;
@@ -3027,7 +3045,7 @@
                 return;
         }
         break;
-    case DIALOG_SHOP_SKILLS:
+    case HOUSE_DIALOGUE_LEARN_SKILLS:
         {
         if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
             return;
@@ -3206,9 +3224,9 @@
         strcpy(v47, "");
         strcpy(v48, "");
         strcpy(v49, "");
-        if ( dialog_menu_id != 1 )
+        if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
             {
-            if ( dialog_menu_id != 18 ) //buy skill
+            if ( dialog_menu_id != HOUSE_DIALOGUE_GULD_BUY_BOOKS ) //buy skill
                 {
                 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
                     {
@@ -3292,7 +3310,7 @@
 
                             GetAsyncKeyState(17);
                             statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
-                            if ( dialog_menu_id != 2 )
+                            if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
                                 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"	
                             DrawTextAtStatusBar(statusbar_string, 0);
                             if ( !v8 )
@@ -3533,14 +3551,14 @@
     //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
     v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
     HIDWORD(v60) = v2;
-    if ( dialog_menu_id != 1 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
         {
-        if ( dialog_menu_id != 10 )
+        if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
             {
-            if ( dialog_menu_id != 11 )
+            if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
                 {
 
-                if ( dialog_menu_id == 96 )
+                if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
                     {
                     if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
                         {
@@ -3940,12 +3958,12 @@
   result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
   if ( result )
   {
-    if ( dialog_menu_id != 1 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
     {
-      if ( dialog_menu_id != 17 )
+      if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_17 )
       {
         result = dialog_menu_id - 96;
-        if ( dialog_menu_id == 96 )
+        if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
         {
           result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
           if ( result )
@@ -4363,9 +4381,9 @@
   dialog_window.uFrameZ = 334;
   m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
-  if ( dialog_menu_id > 5 )
+  if ( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR )
   {
-    if ( dialog_menu_id == 94 )
+    if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -4417,10 +4435,10 @@
       }
       return;
     }
-    if ( dialog_menu_id != 95 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
     {
-      result = dialog_menu_id - 96;
-      if ( dialog_menu_id == 96 )
+      result = dialog_menu_id - HOUSE_DIALOGUE_LEARN_SKILLS;
+      if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
       {
         result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
         if ( result )
@@ -4521,7 +4539,7 @@
   }
   else
   {
-    if ( dialog_menu_id == 5 )
+    if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -4547,7 +4565,7 @@
       v10 = (char *)pMerchantsRepairPhrases[v29];
       goto LABEL_35;
     }
-    if ( dialog_menu_id == 1 )
+    if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
     {
      /* result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
       if ( result )
@@ -4637,12 +4655,12 @@
 
       return;
     }
-    if ( dialog_menu_id != 2 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
     {
-      if ( dialog_menu_id != 3 )
+      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL)
       {
-        result = dialog_menu_id - 4;
-        if ( dialog_menu_id == 4 )
+        result = dialog_menu_id - HOUSE_DIALOGUE_SHOP_IDENTIFY;
+        if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
         {
           draw_leather();
           CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -4730,7 +4748,7 @@
   v3 = 0;
   v49 = 0;
   v122 = 0;
-  if ( dialog_menu_id == 2 )
+  if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
   {
     do
     {
@@ -4865,7 +4883,7 @@
   {
     v66 = 0;
     v117 = 0;
-    if ( dialog_menu_id == 2 )
+    if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
     {
       do
       {
@@ -4896,7 +4914,7 @@
     else
     {
       v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
-      if ( dialog_menu_id != 2 )
+      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
         v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
     }
     DrawTextAtStatusBar(v69, 0);
@@ -4914,7 +4932,7 @@
       v72 = (int)window_SpeakInHouse->ptr_1C;
      // v73 = 9 * (v71 + 12 * v72);
       v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71];
-      if ( dialog_menu_id != 2 )
+      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
        // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
 	      v74 =&pParty->SpecialItemsInShops[v72][v71];
       if ( v67 && Str )