diff mm7_5.cpp @ 151:9abdd40a107b

pCurrentScreen
author Ritor1
date Tue, 12 Feb 2013 15:28:08 +0600
parents d92c78ab54fe
children f4ebd13c2a8e
line wrap: on
line diff
--- a/mm7_5.cpp	Tue Feb 12 10:17:35 2013 +0600
+++ b/mm7_5.cpp	Tue Feb 12 15:28:08 2013 +0600
@@ -332,8 +332,8 @@
           //goto _actor_init_dlg;
           pActor->InitializeDialogue(v0);
           continue;
-        case UIMSG_Quit|0x2:
-        case 0x87:
+        case UIMSG_86:
+        case UIMSG_87:
           if ( bNoNPCHiring != 1 && !pCurrentScreen )
           {
             if ( pMessageQueue_50CBD0->uNumMessages )
@@ -382,19 +382,19 @@
             }
           }
           continue;
-        case 0x51:
+        case UIMSG_51:
           sub_4BDB56_buy_skill____();
           continue;
         case UIMSG_AF:
           sub_4B2001(uMessageParam);
           continue;
-        case 0x195:
+        case UIMSG_195:
           sub_4BCACC_bounties(uMessageParam);
           continue;
-        case 0x88:
+        case UIMSG_88:
           sub_4BC49B(uMessageParam);
           continue;
-        case 0x19A:
+        case UIMSG_19A:
           _4B4224_UpdateNPCTopics(uMessageParam);
           continue;
         case UIMSG_StartNewGame:
@@ -407,7 +407,7 @@
             pGUIWindow_CurrentMenu->Release();
             uGameState = 4;
 LABEL_188:
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = v0;
           }
           else
@@ -425,7 +425,7 @@
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
-          pCurrentScreen = 12;
+          pCurrentScreen = SCREEN_LOADGAME;
           GameUI_DrawLoadMenu(v0);
           continue;
         case UIMSG_Quit:
@@ -436,7 +436,7 @@
             if ( pMessageQueue_50CBD0->uNumMessages )
               pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
             pGUIWindow_CurrentMenu->Release();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = v0;
             if ( !uMessageParam )
               pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
@@ -451,11 +451,11 @@
           //goto _release_tex_and_continue;
           stru_506E40.Release();
           continue;
-        case 0x80:
+        case UIMSG_80:
           pIcons_LOD->_40F9C5();
           pIcons_LOD->_4114F2();
           pGUIWindow_CurrentMenu->Release();
-          pCurrentScreen = 2;
+          pCurrentScreen = SCREEN_OPTIONS;
           v162 = 0;
           v148 = 0;
           pWindowType = (WindowType)8;
@@ -517,7 +517,7 @@
         case UIMSG_SelectLoadSlot:
           if ( pGUIWindow_CurrentMenu->field_40 == v0 )
             pKeyActionMap->_459ED1(0);
-          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
+          if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
           {
             v10 = pSaveListPosition + uMessageParam;
             if ( dword_6BE138 == pSaveListPosition + uMessageParam )
@@ -572,9 +572,9 @@
           //goto _release_tex_and_continue;
           stru_506E40.Release();
           continue;
-        case UIMSG_StartNewGame|0x2:
+        case UIMSG_Game_OpenSaveGameDialog:
           pGUIWindow_CurrentMenu->Release();
-          pCurrentScreen = 11;
+          pCurrentScreen = SCREEN_SAVEGAME;
           GameUI_DrawSaveMenu();
           continue;
         case UIMSG_Game_OpenOptionsDialog:
@@ -582,7 +582,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
           viewparams->field_48 = v0;
-          pCurrentScreen = 2;
+          pCurrentScreen = SCREEN_OPTIONS;
           uTextureID_507C60 = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
           uTextureID_507C6C = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
           uTextureID_507C68 = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
@@ -670,7 +670,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
           viewparams->field_48 = 1;
-          pCurrentScreen = 26;
+          pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
           uTextureID_507BF4 = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
           uTextureID_507BF8 = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
           uTextureID_507BFC = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
@@ -707,7 +707,7 @@
           continue;
         //default:
           //continue;
-        case UIMSG_ResetKeyMapping|0x1:
+        case UIMSG_1A3:
           if ( dword_506E68 != -1 )
             goto LABEL_623;
           v14 = uMessageParam;
@@ -756,7 +756,7 @@
         case 0x1A0:
           dword_506F08 = v0;
           continue;
-        case UIMSG_StartNPCDialogue|0x100:
+        case UIMSG_1A1:
           dword_506F08 = 2;
           continue;
         case UIMSG_OpenVideoOptions:
@@ -764,7 +764,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
           viewparams->field_48 = v0;
-          pCurrentScreen = 28;
+          pCurrentScreen = SCREEN_VIDEO_OPTIONS;
           uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
           uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
           uTextureID_507C18 = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
@@ -817,11 +817,11 @@
             }
           }
           continue;
-        case UIMSG_ToggleTint|0x1:
+        case UIMSG_1A9:
           if ( uMessageParam == 4 )
           {
-            --uGammaPos;
-            if ( (uGammaPos & 0x80000000u) != 0 )
+            //--uGammaPos;
+            if ( (uGammaPos -- -1) < 0 )
             {
               uGammaPos = 0;
               //goto LABEL_128;
@@ -1117,7 +1117,7 @@
           }
           ModalWindow(pNPCTopics[453].pText, 0);
           continue;
-        case UIMSG_SkillUp|0x2:
+        case UIMSG_7B:
           pGUIWindow_CurrentMenu->Release();
           pEventTimer->Resume();
           goto LABEL_188;
@@ -1192,9 +1192,9 @@
           back_to_game();
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
-          if ( pCurrentScreen > 15 )
-          {
-            if ( pCurrentScreen >= 17 && (pCurrentScreen <= 18 || pCurrentScreen == 104) )
+          if ( pCurrentScreen > SCREEN_F )
+          {
+            if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) )
             {
 //LABEL_229:
               if ( dword_50CDC8 )
@@ -1207,7 +1207,7 @@
           }
           else
           {
-            if ( pCurrentScreen >= 14 || pCurrentScreen == 4 || pCurrentScreen == 10 )
+            if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST )
 			{
               //goto LABEL_229;
               if ( dword_50CDC8 )
@@ -1217,7 +1217,7 @@
               uMessageParam = v0;
               goto LABEL_232;
 			}
-            if ( pCurrentScreen == 13 && !dword_50CDC8 && !dword_5C35C8 )
+            if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 )
             {
               CloseWindowBackground();
               dword_5C35C8 = 0;
@@ -1234,18 +1234,18 @@
             viewparams->field_48 = v0;
             if ( pCurrentScreen )
             {
-              if ( pCurrentScreen > 103 )
+              if ( pCurrentScreen > SCREEN_67 )
               {
-                if ( pCurrentScreen == 104 )
+                if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
                   goto LABEL_321;
               }
               else
               {
-                if ( pCurrentScreen < 100 )
+                if ( pCurrentScreen < SCREEN_64 )
                 {
                   switch ( pCurrentScreen )
                   {
-                    case 23:
+                    case SCREEN_CASTING:
                       pIcons_LOD->_4114F2();
                       if ( some_active_character )
                       {
@@ -1267,7 +1267,7 @@
                       //goto LABEL_322;
                       if ( pGUIWindow_Settings )
                       {
-                       if ( pCurrentScreen == 7 )
+                       if ( pCurrentScreen == SCREEN_CHARACTERS )
                        {
                         pMouse->SetCursorBitmap("MICON2");
                        }
@@ -1288,11 +1288,11 @@
                         ptr_507BC0 = 0;
                        pGUIWindow_CurrentMenu = 0;
                        pEventTimer->Resume();
-                       pCurrentScreen = 0;
+                       pCurrentScreen = SCREEN_GAME;
                        viewparams->bRedrawGameUI = v0;
                        pIcons_LOD->_4355F7();
                        continue;
-                    case 3:
+                    case SCREEN_BOOKS:
                       pBooksWindow->Release();
                       //crt_deconstruct_ptr_6A0118();
                       pBooksWindow = 0;
@@ -1300,7 +1300,7 @@
                       //goto LABEL_322;
                       if ( pGUIWindow_Settings )
                       {
-                        if ( pCurrentScreen == 7 )
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
                         {
                          pMouse->SetCursorBitmap("MICON2");
                         }
@@ -1321,39 +1321,39 @@
                         ptr_507BC0 = 0;
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
-                      pCurrentScreen = 0;
+                      pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = v0;
                       pIcons_LOD->_4355F7();
                       continue;
-                    case 11:
-                    case 12:
+                    case SCREEN_SAVEGAME:
+                    case SCREEN_LOADGAME:
                       pIcons_LOD->_4114F2();
                       //crt_deconstruct_ptr_6A0118();
                       //goto LABEL_291;
                       stru_506E40.Release();
                       break;
-                    case 15:
-                      pCurrentScreen = 10;
+                    case SCREEN_F:
+                      pCurrentScreen = SCREEN_CHEST;
                       continue;
-                    case 10:
+                    case SCREEN_CHEST:
                       pWindow2 = pChestWindow;
                       //goto LABEL_249;
                       pWindow2->Release();
                       pIcons_LOD->_4114F2();
-                      pCurrentScreen = 0;
+                      pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = v0;
                       pEventTimer->Resume();
                       continue;
-                    case 25:
+                    case SCREEN_19:
                       pWindow2 = ptr_507BC8;
 //LABEL_249:
                       pWindow2->Release();
                       pIcons_LOD->_4114F2();
-                      pCurrentScreen = 0;
+                      pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = v0;
                       pEventTimer->Resume();
                       continue;
-                    case 2:
+                    case SCREEN_OPTIONS:
                       thisa = (signed int)&uTextureID_507C60;
                       do
                       {
@@ -1408,7 +1408,7 @@
 //LABEL_291:
                       stru_506E40.Release();
                       break;
-                    case 1:
+                    case SCREEN_MENU:
                       pIcons_LOD->_40F9C5();
                       pIcons_LOD->_4114F2();
                       pIcons_LOD->_40F9C5();
@@ -1416,7 +1416,7 @@
                       //goto LABEL_291;
                       stru_506E40.Release();
                       break;
-                    case 28:
+                    case SCREEN_VIDEO_OPTIONS:
                       if ( pRenderer->pRenderD3D )
                       {
                         WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
@@ -1435,7 +1435,7 @@
                       WriteWindowsRegistryInt(v31, v30);
                       stru_506E40.Release();
                       break;
-                    case 26:
+                    case SCREEN_KEYBOARD_OPTIONS:
                       v197 = 1;
                       v32 = 0;
                       while ( *((char *)word_506E6C + v32) != 1 )
@@ -1486,7 +1486,7 @@
                         }
                       }
                       goto LABEL_623;
-                    case 5:
+                    case SCREEN_REST:
                       if ( dword_506F14 )
                       {
                         Rest(_506F18_num_hours_to_sleep);
@@ -1507,7 +1507,7 @@
                       //goto LABEL_322;
                       if ( pGUIWindow_Settings )
                       {
-                        if ( pCurrentScreen == 7 )
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
                         {
                           pMouse->SetCursorBitmap("MICON2");
                         }
@@ -1528,16 +1528,16 @@
                        ptr_507BC0 = 0;
                        pGUIWindow_CurrentMenu = 0;
                        pEventTimer->Resume();
-                       pCurrentScreen = 0;
+                       pCurrentScreen = SCREEN_GAME;
                        viewparams->bRedrawGameUI = v0;
                        pIcons_LOD->_4355F7();
                        continue;
-                    case 14:
+                    case SCREEN_E:
                       pGUIWindow_CurrentMenu->Release();
-                      pCurrentScreen = 13;
+                      pCurrentScreen = SCREEN_HOUSE;
                       pIcons_LOD->_4114F2();
                       continue;
-                    case 13:
+                    case SCREEN_HOUSE:
                       if ( uDialogueType )
                         uDialogueType = 0;
                       if ( uGameState == 2 )
@@ -1557,7 +1557,7 @@
                       //goto LABEL_322;
                       if ( pGUIWindow_Settings )
                       {
-                        if ( pCurrentScreen == 7 )
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
                         {
                           pMouse->SetCursorBitmap("MICON2");
                         }
@@ -1578,11 +1578,11 @@
                         ptr_507BC0 = 0;
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
-                      pCurrentScreen = 0;
+                      pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = v0;
                       pIcons_LOD->_4355F7();
                       continue;
-                    case 18:
+                    case SCREEN_INPUT_BLV:
                       if ( uCurrentHouse_Animation == 153 )
                         HousePlaySomeSound(0x99u, 3);
                       pVideoPlayer->Unload();
@@ -1596,7 +1596,7 @@
                         dword_5B65CC = 0;
                       }
                       goto LABEL_317;
-                    case 4:
+                    case SCREEN_NPC_DIALOGUE:
 //LABEL_306:
                       if ( dword_5B65CC )
                       {
@@ -1607,11 +1607,11 @@
                         dword_5B65CC = 0;
                       }
                       goto LABEL_317;
-                    case 19:
+                    case SCREEN_BRANCHLESS_NPC_DIALOG:
                       memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
                       sub_4452BB();
                       goto LABEL_317;
-                    case 17:
+                    case SCREEN_CHANGE_LOCATION:
                       if ( pParty->vPosition.x < -22528 )
                         pParty->vPosition.x = -22528;
                       if ( pParty->vPosition.x > 22528 )
@@ -1621,16 +1621,16 @@
                       if ( pParty->vPosition.y > 22528 )
                         pParty->vPosition.y = 22528;
                       goto LABEL_317;
-                    case 16:
+                    case SCREEN_VIDEO:
                       pVideoPlayer->Unload();
                       continue;
-                    case 7:
+                    case SCREEN_CHARACTERS:
                       goto LABEL_319;
                     default:
                       //goto LABEL_322;
                       if ( pGUIWindow_Settings )
                       {
-                        if ( pCurrentScreen == 7 )
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
                         {
                           pMouse->SetCursorBitmap("MICON2");
                         }
@@ -1651,7 +1651,7 @@
                         ptr_507BC0 = 0;
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
-                      pCurrentScreen = 0;
+                      pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = v0;
                       pIcons_LOD->_4355F7();
                       continue;
@@ -1659,7 +1659,7 @@
                   //goto LABEL_322;
                   if ( pGUIWindow_Settings )
                   {
-                    if ( pCurrentScreen == 7 )
+                    if ( pCurrentScreen == SCREEN_CHARACTERS )
                     {
                       pMouse->SetCursorBitmap("MICON2");
                     }
@@ -1680,7 +1680,7 @@
                     ptr_507BC0 = 0;
                   pGUIWindow_CurrentMenu = 0;
                   pEventTimer->Resume();
-                  pCurrentScreen = 0;
+                  pCurrentScreen = SCREEN_GAME;
                   viewparams->bRedrawGameUI = v0;
                   pIcons_LOD->_4355F7();
                   continue;
@@ -1694,7 +1694,7 @@
 //LABEL_322:
               if ( pGUIWindow_Settings )
               {
-                if ( pCurrentScreen == 7 )
+                if ( pCurrentScreen == SCREEN_CHARACTERS )
                 {
                   pMouse->SetCursorBitmap("MICON2");
                 }
@@ -1715,7 +1715,7 @@
                 ptr_507BC0 = 0;
               pGUIWindow_CurrentMenu = 0;
               pEventTimer->Resume();
-              pCurrentScreen = 0;
+              pCurrentScreen = SCREEN_GAME;
               viewparams->bRedrawGameUI = v0;
               pIcons_LOD->_4355F7();
               continue;
@@ -1801,7 +1801,7 @@
           }
           DrawHiredNPCs();
           continue;
-        case UIMSG_OpenRestUI|0x2:
+        case UIMSG_19B:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           dword_50CDC8 = v0;
@@ -1862,7 +1862,7 @@
           if ( !_strcmpi(byte_6BE3B0, "d05.blv") )
             pParty->uTimePlayed += 1474560i64;
           continue;
-        case 0x19C:
+        case UIMSG_19C:
           CloseWindowBackground();
           pVideoPlayer->Unload();
           sub_44603D();
@@ -1872,7 +1872,7 @@
           v39 = GetAsyncKeyState(VK_SHIFT);
           v40 = CycleCharacter(v39);
           goto LABEL_421;
-        case UIMSG_LoadGame|0x8:
+        case UIMSG_5A:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           dword_50CDC8 = v0;
@@ -1895,7 +1895,7 @@
               pParty->vPosition.y = 22528;
 LABEL_317:
             sub_44603D();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
           }
           else
           {
@@ -1968,11 +1968,11 @@
             sub_461103();
             pEventTimer->Resume();
             viewparams->bRedrawGameUI = 1;
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             pGameLoadingUI_ProgressBar->Release();
           }
           goto LABEL_422;
-        case UIMSG_SaveGame|0x8:
+        case UIMSG_5B:
           goto LABEL_387;
         case UIMSG_BE:
           if ( pRenderer->pRenderD3D )
@@ -2083,9 +2083,9 @@
           unk_50C9A0 = 0;
           back_to_game();
           continue;
-        case UIMSG_ChangeGameState|0x40:
-        case 0x8D:
-        case 0x8F:
+        case UIMSG_45:
+        case UIMSG_8D:
+        case UIMSG_8F:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( unk_50C9A0 )
@@ -2506,7 +2506,7 @@
           uGameState = 0;
           strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
           goto LABEL_524;
-        case UIMSG_D5|0x8:
+        case UIMSG_DD:
 LABEL_524:
           sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer);
           memcpy(&v216, texture_frame_table_txt_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
@@ -2613,7 +2613,7 @@
           v1 = "";
           v0 = 1;
           continue;
-        case 0x19:
+        case UIMSG_19:
           if ( bUnderwater == 1 )
             goto LABEL_682;
           if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
@@ -2631,8 +2631,8 @@
           //goto LABEL_679;
           _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
           continue;
-        case 0x46:
-        case UIMSG_Quit|0x8:
+        case UIMSG_46:
+        case UIMSG_8C:
           if ( pRenderer->pRenderD3D )
           {
             v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
@@ -2677,7 +2677,7 @@
           unk_50C9A0 = 0;
           back_to_game();
           continue;
-        case 0x1C:
+        case UIMSG_1C:
           if ( !uActiveCharacter || pCurrentScreen )
             //goto LABEL_90;
           {
@@ -2686,10 +2686,10 @@
             continue;
           }
           ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)104, uMessageParam, 0);
-          pCurrentScreen = 25;
+          pCurrentScreen = SCREEN_19;
           pEventTimer->Pause();
           continue;
-        case 0x1B:
+        case UIMSG_1B:
           if ( !uActiveCharacter )
             //goto LABEL_90;
           {
@@ -2747,7 +2747,7 @@
 //LABEL_577:
             _42ECB5_PlayerAttacksActor();
           continue;
-        case UIMSG_A7:
+        case UIMSG_ExitRest:
           v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest"
           pButton = pButton_RestUI_Exit;
           pButton2 = pButton_RestUI_Exit;
@@ -2760,7 +2760,7 @@
           v133 = 0;
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case UIMSG_ShowStatus_Player|0x1:
+        case UIMSG_Wait5Minutes:
           if ( dword_506F14 == 2 )
             //goto LABEL_621;
           {
@@ -2772,7 +2772,7 @@
           dword_506F14 = v0;
           _506F18_num_hours_to_sleep = 5;
           continue;
-        case 0x60:
+        case UIMSG_Wait1Hour:
           if ( dword_506F14 == 2 )
             //goto LABEL_621;
           {
@@ -2800,7 +2800,7 @@
           pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
           pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
           continue;
-        case 0x68:
+        case UIMSG_68:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( pCurrentScreen )
@@ -2865,7 +2865,7 @@
           v176 = 0;
           v160 = 13;
           goto LABEL_619;
-        case 0x61:
+        case UIMSG_61:
           if ( dword_506F14 )
             //goto LABEL_621;
           {
@@ -2945,7 +2945,7 @@
             pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
           }
           continue;
-        case UIMSG_ShowStatus_Funds|0x8:
+        case UIMSG_AlreadyResting:
           if ( dword_506F14 == 2 )
           {
 //LABEL_621:
@@ -2958,7 +2958,7 @@
           dword_506F14 = v0;
           _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute;
           continue;
-        case 0x4E:
+        case UIMSG_4E:
           if ( dword_50654C && byte_506550 )
           {
             v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName;
@@ -2977,7 +2977,7 @@
 //_set_status_string_pTmpBuf_and_continue:
           sub_41C0B8_set_status_string(pTmpBuf);
           continue;
-        case 0x4F:
+        case UIMSG_4F:
           if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
                 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
             continue;
@@ -2999,7 +2999,7 @@
           //goto LABEL_91;
           v0 = 1;
           continue;
-        case 0x58:
+        case UIMSG_58:
           GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0);
           if ( !uActiveCharacter )
             continue;
@@ -3025,7 +3025,7 @@
             pPlayer10->PlaySound(12, 0);
           byte_506550 = 0;
           continue;
-        case 0x33:
+        case UIMSG_33:
           if ( !uActiveCharacter )
             continue;
           pPlayer3 = pPlayers[uActiveCharacter];
@@ -3083,7 +3083,7 @@
           v130 = 0;
           v127 = rand() % 2 + 204;
           goto _play_sound_and_continue;
-        case UIMSG_SaveGame|0x4:
+        case UIMSG_57:
           if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage )
             continue;
           sub_41140B();
@@ -3098,7 +3098,7 @@
           v130 = 0;
           v127 = rand() % 2 + 204;
           goto _play_sound_and_continue;
-        case UIMSG_LoadGame|0x4:
+        case UIMSG_56:
           if ( pTurnEngine->field_4 != 3 )
           {
             if ( uActiveCharacter )
@@ -3111,7 +3111,7 @@
                   pGUIWindow_CurrentMenu->Release();
                   pEventTimer->Resume();
                   viewparams->bRedrawGameUI = v0;
-                  pCurrentScreen = 0;
+                  pCurrentScreen = SCREEN_GAME;
                   pIcons_LOD->_4114F2();
                   v103 = dword_50654C + 11 * *(char *)(uNumSeconds + 6734);
                   if ( dword_50C9E8 < 40 )
@@ -3131,7 +3131,7 @@
             }
           }
           continue;
-        case 0x8E:
+        case UIMSG_8E:
           if ( pTurnEngine->field_4 == 3 )
             continue;
           v175 = 0;
@@ -3142,7 +3142,7 @@
           v79 = uMessageParam;
           _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
           continue;
-        case 0x92:
+        case UIMSG_92:
           if ( pTurnEngine->field_4 != 3 )
           {
             v175 = 0;
@@ -3155,7 +3155,7 @@
             _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
           }
           continue;
-        case 0x69:
+        case UIMSG_69:
           if ( pTurnEngine->field_4 == 3 )
             continue;
           if ( bUnderwater == 1 )
@@ -3186,22 +3186,22 @@
                 //goto LABEL_693;
               {
                 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
-                pCurrentScreen = 8;
+                pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = v0;
                 continue;
               }
-              if ( pCurrentScreen != 5
-                && pCurrentScreen != 7
-                && (pCurrentScreen <= 99
-                 || pCurrentScreen > 103) )
+              if ( pCurrentScreen != SCREEN_REST
+                && pCurrentScreen != SCREEN_CHARACTERS
+                && (pCurrentScreen <= SCREEN_63
+                 || pCurrentScreen > SCREEN_67) )
               {
                 pGUIWindow_CurrentMenu->Release();
 //LABEL_693:
                 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
-                pCurrentScreen = 8;
+                pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
@@ -3223,19 +3223,19 @@
           viewparams->bRedrawGameUI = v0;
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pCurrentScreen = 104;
+          pCurrentScreen = SCREEN_QUICK_REFERENCE;
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0);
           papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
           pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, 0x71u, 0, 0,
                          pGlobalTXT_LocalizationStrings[79],// "Exit"
                          (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0); //, v179);
           continue;
-        case 0x6B:
+        case UIMSG_6B:
           if ( pCurrentScreen )
           {
             pGUIWindow_CurrentMenu->Release();
             pEventTimer->Resume();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = v0;
           }
           stru_506E40.Release();
@@ -3268,7 +3268,7 @@
 //LABEL_709:
           dword_506544 = v0;
           continue;
-        case 0x55:
+        case UIMSG_55:
           bRingsShownInCharScreen ^= v0;
           GUIButton::_41D0D8(pCharacterScreen_DetalizBtn);
           GUIButton::_41D0D8(pCharacterScreen_DollBtn);
@@ -3291,10 +3291,10 @@
                          0);
           pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0);
           goto LABEL_422;
-        case UIMSG_Quit|0x1:
+        case UIMSG_85:
           OnPaperdollLeftClick();
           continue;
-        case UIMSG_Escape|0x2:
+        case UIMSG_73:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
           sub_4196A0();
           sub_419379();
@@ -3310,7 +3310,7 @@
           v133 = 0;
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case UIMSG_ChangeMusicVolume|0x2:
+        case UIMSG_72:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
           sub_4196A0();
           sub_419379();
@@ -3358,7 +3358,7 @@
 //_draw_status_string_and_continue:
           ShowStatusBarString(v87, 2u);
           continue;
-        case UIMSG_ChangeMusicVolume|0x4:
+        case UIMSG_74:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
           sub_419379();
           sub_4196A0();
@@ -3388,7 +3388,7 @@
           v133 = 0;
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case UIMSG_Escape|0x4:
+        case UIMSG_75:
           sub_419379();
           sub_4196A0();
           sub_419220();
@@ -3397,7 +3397,7 @@
             (int)pCharacterScreen_AwardsBtn, 0);
           sub_419100();
           continue;
-        case 71://0x47:
+        case UIMSG_AutonotesBook:
           switch ( uMessageParam )
           {
             default:
@@ -3517,18 +3517,18 @@
           sprintf(pTmpBuf, "%d / %d %s    %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
           sub_41C0B8_set_status_string(pTmpBuf);
           continue;
-        case 0xC:
-          if ( pCurrentScreen == 15 )
+        case UIMSG_C:
+          if ( pCurrentScreen == SCREEN_F )
           {
             sub_421EA6_OnInventoryLeftClick();
             continue;
           }
           sub_420E01();
           continue;
-        case UIMSG_ChangeMusicVolume|0x8:
+        case UIMSG_InventoryLeftClick:
           sub_421EA6_OnInventoryLeftClick();
           continue;
-        case 0xA:
+        case UIMSG_A:
           if ( !pRenderer->pRenderD3D )
             //goto LABEL_772;
           {
@@ -3578,13 +3578,13 @@
             continue;
           }
           continue;
-        case 0xE:
+        case UIMSG_E:
 //LABEL_772:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           OnGameViewportClick();
           continue;
-        case 0xF:
+        case UIMSG_F:
           if ( pRenderer->pRenderD3D )
           {
             LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val();
@@ -3605,7 +3605,7 @@
           v133 = 0;
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case 0x54:
+        case UIMSG_54:
           v163 = 0;
           pButton2 = (GUIButton *)uMessageParam;
           pWindowType1 = (WindowType)22;
@@ -3618,12 +3618,12 @@
 //LABEL_733:
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case 0x194:
+        case UIMSG_194:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           OnPressSpace();
           continue;
-        case UIMSG_ChangeSoundVolume|0x100:
+        case UIMSG_16F:
           if ( pCurrentScreen )
             continue;
           pParty->uFlags |= 2u;
@@ -3646,7 +3646,7 @@
             goto LABEL_789;
           viewparams->field_28 = 11;
           goto LABEL_788;
-        case UIMSG_ChangeMusicVolume|0x100:
+        case UIMSG_170:
           if ( pCurrentScreen )
             continue;
           pParty->uFlags |= 2u;
@@ -3830,7 +3830,7 @@
             //main menu save/load wnd   clicking on savegame lines
           if (pGUIWindow_CurrentMenu->field_40 == 1)
             pKeyActionMap->_459ED1(0);
-          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
+          if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
           {
             //load clicked line
               v26 = uNum + pSaveListPosition;
@@ -3960,7 +3960,7 @@
           {
             pGUIWindow_CurrentMenu->Release();
             pEventTimer->Resume();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = 1;
           }
           GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0);
@@ -4023,7 +4023,7 @@
           v17 = pCurrentScreen;
           if ( v16 && !pCurrentScreen )
             goto LABEL_83;
-          if ( pCurrentScreen == 12 )
+          if ( pCurrentScreen == SCREEN_LOADGAME )
           {
             pIcons_LOD->_4114F2();
             //crt_deconstruct_ptr_6A0118();
@@ -4036,24 +4036,24 @@
             pGUIWindow2->Release();
             pGUIWindow2 = 0;
             pEventTimer->Resume();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = v15;
             continue;
           }
-          if ( pCurrentScreen == 16 )
+          if ( pCurrentScreen == SCREEN_VIDEO )
           {
             pVideoPlayer->Unload();
           }
           else
           {
-            if ( pCurrentScreen != 27 )
+            if ( pCurrentScreen != SCREEN_1B )
               //goto LABEL_81;
             {
               pGUIWindow_CurrentMenu->Release();
               pGUIWindow2->Release();
               pGUIWindow2 = 0;
               pEventTimer->Resume();
-              pCurrentScreen = 0;
+              pCurrentScreen = SCREEN_GAME;
               viewparams->bRedrawGameUI = v15;
               continue;
             }
@@ -14363,7 +14363,7 @@
   dword_506F0C[0] = pCurrentScreen;
   result = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, v3, (int)v2);
   ptr_507BDC = result;
-  pCurrentScreen = 22;
+  pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE;
   return result;
 }
 // 4E28F8: using guessed type int pCurrentScreen;
@@ -15042,7 +15042,7 @@
         if ( pHint && pHint != (char *)1 )
           pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
         pWindow->Release();
-        if (pCurrentScreen == 11)//окно сохранения игры
+        if (pCurrentScreen == SCREEN_SAVEGAME)
           pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0);
         else
           pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0);
@@ -15109,7 +15109,7 @@
                   ItemGen2.Reset();
                   pWindow->Release();
                   pEventTimer->Resume();
-                  pCurrentScreen = 0;
+                  pCurrentScreen = SCREEN_GAME;
                   viewparams->bRedrawGameUI = 1;
                   v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
                   if ( v39 > 0 )
@@ -15210,7 +15210,7 @@
             pItemGen.Reset();
             pWindow->Release();
             pEventTimer->Resume();
-            pCurrentScreen = 0;
+            pCurrentScreen = SCREEN_GAME;
             viewparams->bRedrawGameUI = 1;
             v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
             if ( v26 > 0 )
@@ -15371,7 +15371,7 @@
           }
           pEventTimer->Resume();
           ptr_507BD0->Release();
-          pCurrentScreen = 0;
+          pCurrentScreen = SCREEN_GAME;
           //goto LABEL_114;
           viewparams->bRedrawGameUI = 1;
           continue;
@@ -15446,13 +15446,13 @@
             }
             else//pWindowType == 20 (0x14) WINDOW_Chest
             {
-              if ( pCurrentScreen == 10 )
+              if ( pCurrentScreen == SCREEN_CHEST )
               {
                 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
               }
               else
               {
-                if ( pCurrentScreen == 15 )
+                if ( pCurrentScreen == SCREEN_F )
                 {
                   pRenderer->ClearZBuffer(0, 479);
                   draw_leather();
@@ -16169,7 +16169,7 @@
   unsigned int pX; // [sp+70h] [bp-8h]@3
   unsigned int pY; // [sp+74h] [bp-4h]@3
 
-  if ( pCurrentScreen == 16 )//окно видео ролика 
+  if ( pCurrentScreen == SCREEN_VIDEO )
     return;
   if ( _this )
   {
@@ -16207,9 +16207,9 @@
     //while ( v1 < 4 );
   }
   pEventTimer->Pause();
-  if ( pCurrentScreen <= 10 )
-  {
-    if ( pCurrentScreen == 10 )//окно ящика
+  if ( pCurrentScreen <= SCREEN_CHEST )
+  {
+    if ( pCurrentScreen == SCREEN_CHEST )
     {
       __debugbreak();
       if ( !pPlayers[uActiveCharacter]->CanAct() )
@@ -16238,11 +16238,11 @@
     {
       if ( pCurrentScreen )
       {
-        if ( pCurrentScreen != 3 )
-        {
-          if ( pCurrentScreen != 7 )
-          {
-            if ( pCurrentScreen == 8 )//окно книги заклов
+        if ( pCurrentScreen != SCREEN_BOOKS )
+        {
+          if ( pCurrentScreen != SCREEN_CHARACTERS )
+          {
+            if ( pCurrentScreen == SCREEN_SPELL_BOOK )
             {
               if ( dword_507B00_spell_info_to_draw_in_popup )
                 DrawSpellDescriptionPopup((void *)(dword_507B00_spell_info_to_draw_in_popup - 1));
@@ -16250,7 +16250,7 @@
             goto LABEL_132;
           }
 LABEL_119:
-          if ( (signed int)pX > 467 && pCurrentScreen != 14 )
+          if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
           {
             identify_item();
             goto LABEL_132;
@@ -16388,19 +16388,19 @@
     GameUI_DrawItemInfo(v8);
     goto LABEL_132;
   }
-  if ( pCurrentScreen == 13 )//окно дома
+  if ( pCurrentScreen == SCREEN_HOUSE )
   {
     if ( (signed int)pY < 345 && (signed int)pX < 469 )
       sub_4B1A2D();
     goto LABEL_132;
   }
-  if ( pCurrentScreen <= 13 )
+  if ( pCurrentScreen <= SCREEN_HOUSE )
     goto LABEL_132;
-  if ( pCurrentScreen <= 15 )
+  if ( pCurrentScreen <= SCREEN_F )
     goto LABEL_119;
-  if ( pCurrentScreen != 21 )
-  {
-    v11 = pCurrentScreen == 23;
+  if ( pCurrentScreen != SCREEN_PARTY_CREATION )
+  {
+    v11 = pCurrentScreen == SCREEN_CASTING;
     if ( !v11 )
       goto LABEL_132;
     identify_item();
@@ -16510,7 +16510,7 @@
   unsigned int pY; // [sp+18h] [bp-4h]@7
 
   pXY_ = pXY;
-  if ( pCurrentScreen == 16
+  if ( pCurrentScreen == SCREEN_VIDEO
     || sub_4637E0_is_there_popup_onscreen() )
     return;
   if ( pGUIWindow2 && pGUIWindow2->ptr_1C == (void *)33 )