changeset 990:087a9af8e0ec

MessageParam
author Ritor1
date Mon, 13 May 2013 18:03:55 +0600
parents bb37d33934b0
children 3a3ab572eff5 bdbbdfa77ea6
files GUIWindow.h Player.cpp Render.cpp UIBooks.cpp UICharacter.cpp UIHouses.cpp UISaveLoad.cpp mm7_1.cpp mm7_2.cpp mm7_4.cpp mm7_5.cpp mm7_6.cpp mm7_data.cpp mm7_data.h
diffstat 14 files changed, 235 insertions(+), 215 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Mon May 13 09:39:58 2013 +0600
+++ b/GUIWindow.h	Mon May 13 18:03:55 2013 +0600
@@ -16,7 +16,7 @@
 
   UIMSG_CHEST_ClickItem = 12,
 
-  UIMSG_E = 14,
+  UIMSG_MouseLeftClickInScreen = 14,
   UIMSG_F = 15,
 
   UIMSG_11 = 17,
@@ -268,6 +268,7 @@
   WINDOW_SpellBook = 0x12,
   WINDOW_GreetingNPC = 19,
   WINDOW_Chest = 0x14,
+  WINDOW_22 = 0x16,
   WINDOW_SaveLoadButtons = 23,
   WINDOW_MainMenu_Load = 0x18,
   WINDOW_HouseInterior = 0x19,
--- a/Player.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/Player.cpp	Mon May 13 18:03:55 2013 +0600
@@ -7708,7 +7708,7 @@
                     goto LABEL_187;
                   /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                   {
-                    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+                    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
                     pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
                     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                     ++pMessageQueue_50CBD0->uNumMessages;
@@ -7797,7 +7797,7 @@
       && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
       //&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
-      /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+      /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
       ++pMessageQueue_50CBD0->uNumMessages;*/
--- a/Render.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/Render.cpp	Mon May 13 18:03:55 2013 +0600
@@ -887,7 +887,7 @@
   int v21; // ecx@43
   //char v22; // zf@44
   int v23; // ecx@47
-  int v24; // edi@52
+  //int v24; // edi@52
   int v25; // eax@54
   int v26; // ecx@54
   int v27; // eax@56
@@ -932,7 +932,7 @@
   int v66; // edx@163
   int v67; // ecx@164
   int v68; // ecx@167
-  int v69; // eax@173
+  //int v69; // eax@173
   int v70; // edi@178
   //int v71; // eax@178
   //int v72; // ecx@178
@@ -1132,7 +1132,7 @@
       v21 = terrain_76DFC8[v17];
       while ( 1 )
       {
-        v125 = v21;
+        v125 = terrain_76DFC8[v17];
         if ( v21 < v124 )
           break;
         terrain_76DBC8[v16] = v21;
@@ -1156,12 +1156,12 @@
         ++v16;
       }
       v16 = 0;
-      v24 = terrain_76E3C8[v18];
+      //v24 = terrain_76E3C8[v18];
       v126 = 0;
-      if ( v120 > v24 )
+      if ( v120 > terrain_76E3C8[v18] )
       {
         v125 = v120;
-        memset32(terrain_76D5C8, v122, 4 * (v120 - v24 + 1));
+        memset32(terrain_76D5C8, v122, 4 * (v120 - terrain_76E3C8[v18] + 1));
         do
         {
           v25 = v126;
@@ -1517,13 +1517,14 @@
     default:
       break;
   }
-  v69 = v16 - 1;
+  //v69 = v16 - 1;
   ptr_801A08 = pVerticesSR_806210;
   ptr_801A04 = pVerticesSR_801A10;
-  v126 = v69;
+  //v126 = v69;
+
   if ( v105 && v105 != 7 && v105 != 3 && v105 != 4 )//блок
   {
-    for ( i = v69; i >= 1; --i )
+    for ( i = v16 - 1; i >= 1; --i )
     {
       //v70 = i;
       //v71 = terrain_76D7C8[i];//88
@@ -1584,7 +1585,7 @@
   }
   else
   {
-    for ( i = v69; i >= 1; --i )
+    for ( i = v16 - 1; i >= 1; --i )
     {
       //v86 = i;
       //v87 = terrain_76D5C8[i];
--- a/UIBooks.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/UIBooks.cpp	Mon May 13 18:03:55 2013 +0600
@@ -396,7 +396,7 @@
   GUIWindow a1; // [sp+8h] [bp-54h]@10
 
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11);
-  if ( dword_506548 || !dword_506528 )
+  if ( BtnUp_flag || !dword_506528 )
   {
     v13 = pTex_tab_an_6a__zoom_off;
     v11 = pViewport->uViewportTL_Y + 2;
@@ -409,7 +409,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v11, v13);
-  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
+  if ( BtnDown_flag || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v14 = pTex_tab_an_7a__zoot_off;
     v12 = pViewport->uViewportTL_Y + 38;
@@ -443,14 +443,14 @@
   a1.uFrameZ = 407;
   a1.uFrameHeight = v4 * 264 / v4;
   a1.uFrameW = a1.uFrameHeight + 69;
-  if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
+  if ( BtnDown_flag && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     v5 = dword_50651C++;
     dword_506528 += num_achieved_awards;
     byte_506130[v5] = num_achieved_awards;
   }
-  if ( dword_506548 && dword_50651C )
+  if ( BtnUp_flag && dword_50651C )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     --dword_50651C;
@@ -461,9 +461,9 @@
     dword_506528 = 0;
     dword_50651C = 0;
   }
-  dword_506544 = 0;
+  BtnDown_flag = 0;
   v6 = achieved_awards[dword_506528];
-  dword_506548 = 0;
+  BtnUp_flag = 0;
   num_achieved_awards = 0;
   //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
   v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
@@ -502,7 +502,7 @@
   GUIWindow a1; // [sp+Ch] [bp-54h]@9
 
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
-  if ( dword_506548 || !dword_506528 )
+  if ( BtnUp_flag || !dword_506528 )
   {
     v10 = pTex_tab_an_6a__zoom_off;
     v8 = pViewport->uViewportTL_Y + 2;
@@ -515,7 +515,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v8, v10);
-  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
+  if ( BtnDown_flag || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v11 = pTex_tab_an_7a__zoot_off;
     v9 = pViewport->uViewportTL_Y + 38;
@@ -541,14 +541,14 @@
   a1.uFrameHeight = 264;
   a1.uFrameZ = 407;
   a1.uFrameW = 333;
-  if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
+  if ( BtnDown_flag && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     v2 = dword_50651C++;
     dword_506528 += num_achieved_awards;
     byte_506130[v2] = num_achieved_awards;
   }
-  if ( dword_506548 && dword_50651C )
+  if ( BtnUp_flag && dword_50651C )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     --dword_50651C;
@@ -560,8 +560,8 @@
     dword_50651C = 0;
     dword_506528 = 0;
   }
-  dword_506544 = 0;
-  dword_506548 = 0;
+  BtnDown_flag = 0;
+  BtnUp_flag = 0;
   num_achieved_awards = 0;
   while ( v3 < num_achieved_awards_2 )
   {
@@ -620,7 +620,7 @@
 
   v31 = 0;
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
-  if ( dword_506548 || !dword_506528 )
+  if ( BtnUp_flag || !dword_506528 )
   {
     v24 = pTex_tab_an_6a__zoom_off;
     v17 = pViewport->uViewportTL_Y + 2;
@@ -633,7 +633,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v17, v24);
-  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
+  if ( BtnDown_flag || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v25 = pTex_tab_an_7a__zoot_off;
     v18 = pViewport->uViewportTL_Y + 38;
@@ -646,7 +646,7 @@
     v1 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v1, v18, v25);
-  if ( !dword_506540 )
+  if ( !Book_PageBtn3_flag )//Potions_page_flag
   {
     if (_506568_autonote_type != AUTONOTE_POTION_RECEPIE)
     {
@@ -672,7 +672,7 @@
   _506568_autonote_type = AUTONOTE_POTION_RECEPIE;
   pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
 LABEL_16:
-  if ( dword_50653C )
+  if ( Book_PageBtn4_flag )//Fontains_page_flag
   {
     if ( _506568_autonote_type != v2 )
     {
@@ -696,7 +696,7 @@
   v3 = pViewport->uViewportTL_X + 399;
 LABEL_22:
   pRenderer->DrawTextureTransparent(v3, v19, v26);
-  if ( dword_506538 )
+  if ( Book_PageBtn5_flag )//Autonotes_Obelisks_page_flag
   {
     if ( _506568_autonote_type != AUTONOTE_OBELISK)
     {
@@ -720,7 +720,7 @@
   v4 = pViewport->uViewportTL_X + 397;
 LABEL_28:
   pRenderer->DrawTextureTransparent(v4, v20, v27);
-  if ( dword_506534 )
+  if ( Book_PageBtn6_flag )//Autonotes_Seer_page_flag
   {
     if ( _506568_autonote_type != AUTONOTE_SEER)
     {
@@ -744,7 +744,7 @@
   v5 = pViewport->uViewportTL_X + 397;
 LABEL_34:
   pRenderer->DrawTextureTransparent(v5, v21, v28);
-  if ( dword_506530 )
+  if ( Autonotes_Misc_page_flag )
   {
     if ( _506568_autonote_type != AUTONOTE_MISC)
     {
@@ -768,7 +768,7 @@
   v6 = pViewport->uViewportTL_X + 397;
 LABEL_40:
   pRenderer->DrawTextureTransparent(v6, v22, v29);
-  if ( dword_50652C )
+  if ( Autonotes_Instructors_page_flag )
   {
     if ( _506568_autonote_type != AUTONOTE_TEACHER)
     {
@@ -835,7 +835,7 @@
   }
   else
   {
-    if ( dword_506544 )
+    if ( BtnDown_flag )
     {
       v10 = num_achieved_awards + dword_506528;
       if ( num_achieved_awards + dword_506528 < num_achieved_awards_2 )
@@ -846,7 +846,7 @@
         pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
       }
     }
-    if ( dword_506548 && dword_50651C )
+    if ( BtnUp_flag && dword_50651C )
     {
       --dword_50651C;
       dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
@@ -859,15 +859,15 @@
     }
   }
   v12 = dword_506528;
-  dword_50652C = 0;
-  dword_506544 = 0;
-  dword_506548 = 0;
+  Autonotes_Instructors_page_flag = 0;
+  BtnDown_flag = 0;
+  BtnUp_flag = 0;
   num_achieved_awards = 0;
-  dword_506530 = 0;
-  dword_506534 = 0;
-  dword_506538 = 0;
-  dword_50653C = 0;
-  dword_506540 = 0;
+  Autonotes_Misc_page_flag = 0;
+  Book_PageBtn6_flag = 0;//Autonotes_Seer_page_flag
+  Book_PageBtn5_flag = 0;//Autonotes_Obelisks_page_flag
+  Book_PageBtn4_flag = 0;//Fontains_page_flag
+  Book_PageBtn3_flag = 0;//Potions_page_flag
   while ( v12 < num_achieved_awards_2 )
   {
     v13 = achieved_awards[v12];
@@ -899,7 +899,7 @@
   unsigned int textrX, textrY;
 
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
-  if ( dword_506548 || viewparams->field_2C / 128 >= 12 )
+  if ( BtnUp_flag || viewparams->field_2C / 128 >= 12 )
   {
     buttnTxtr = pTex_tab_an_6a__zoom_off;
     textrY = pViewport->uViewportTL_Y + 2;
@@ -912,7 +912,7 @@
     textrX = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_506544 || viewparams->field_2C / 128 <= 3 )
+  if ( BtnDown_flag || viewparams->field_2C / 128 <= 3 )
   {
     buttnTxtr = pTex_tab_an_7a__zoot_off;
     textrY = pViewport->uViewportTL_Y + 38;
@@ -925,7 +925,7 @@
     textrX = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_506540 )
+  if ( Book_PageBtn3_flag )
   {
     buttnTxtr = pTexture_506390;
     textrY = pViewport->uViewportTL_Y + 113;
@@ -938,7 +938,7 @@
     textrX = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_50653C )
+  if ( Book_PageBtn4_flag )
   {
     buttnTxtr = pTexture_506388;
     textrY = pViewport->uViewportTL_X + 150;
@@ -951,7 +951,7 @@
     textrX = pViewport->uViewportTL_Y + 399;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_506538 )
+  if ( Book_PageBtn5_flag )
   {
     buttnTxtr = pTexture_506380;
     textrY = pViewport->uViewportTL_Y + 188;
@@ -964,7 +964,7 @@
     textrX = pViewport->uViewportTL_X + 397;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_506534 )
+  if ( Book_PageBtn6_flag )
   {
     buttnTxtr = pTexture_506378;
     textrY = pViewport->uViewportTL_Y + 226;
@@ -977,27 +977,27 @@
     textrX = pViewport->uViewportTL_X + 397;
   }
   pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
-  if ( dword_506544 )
+  if ( BtnDown_flag )
     viewparams->CenterOnParty2();
-  if ( dword_506548 )
+  if ( BtnUp_flag )
     viewparams->CenterOnParty();
-  if ( dword_506540 )
+  if ( Book_PageBtn3_flag )
     viewparams->_443219();
-  if ( dword_50653C )
+  if ( Book_PageBtn4_flag )
     viewparams->_443231();
-  if ( dword_506538 )
+  if ( Book_PageBtn5_flag )
     viewparams->_44323D();
-  if ( dword_506534 )
+  if ( Book_PageBtn6_flag )
     viewparams->_443225();
 
-  if ( dword_506548 | dword_506544 | dword_506540 | dword_50653C | dword_506538 | dword_506534 )
+  if ( BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag )
     pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-  dword_506548 = 0;
-  dword_506544 = 0;
-  dword_506534 = 0;
-  dword_506538 = 0;
-  dword_50653C = 0;
-  dword_506540 = 0;
+  BtnUp_flag = 0;
+  BtnDown_flag = 0;
+  Book_PageBtn6_flag = 0;
+  Book_PageBtn5_flag = 0;
+  Book_PageBtn4_flag = 0;
+  Book_PageBtn3_flag = 0;
   DrawBook_Map_sub(97, 49, 361, 313, 0);
   pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
   map_window.uFrameWidth = game_viewport_width;
--- a/UICharacter.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/UICharacter.cpp	Mon May 13 18:03:55 2013 +0600
@@ -242,9 +242,9 @@
     a1.uFrameHeight = 290;
     a1.uFrameZ = 435;
     a1.uFrameW = 337;
-    if ( dword_506544 && num_achieved_awards + dword_506528 < num_achieved_awards_2 )
+    if ( BtnDown_flag && num_achieved_awards + dword_506528 < num_achieved_awards_2 )
         result = dword_506528++ + 1;
-    if ( dword_506548 && result )
+    if ( BtnUp_flag && result )
         {
         --result;
         dword_506528 = result;
@@ -270,8 +270,8 @@
             }
         }
     //LABEL_14:
-    dword_506544 = 0;
-    dword_506548 = 0;
+    BtnDown_flag = 0;
+    BtnUp_flag = 0;
     num_achieved_awards = 0;
     dword_50651C = 0;
 
@@ -2437,8 +2437,8 @@
         num_achieved_awards = 0;
 
         memset(pTmpBuf2, 0, 0x7D0u);
-        dword_506544 = 0;
-        dword_506548 = 0;
+        BtnDown_flag = 0;
+        BtnUp_flag = 0;
         dword_50651C = 0;
         dword_506528 = 0;
         for (int i = 0; i < 105; ++i)
--- a/UIHouses.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/UIHouses.cpp	Mon May 13 18:03:55 2013 +0600
@@ -1335,7 +1335,7 @@
     {
       /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
       {
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
+        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_PlayArcomage;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
         ++pMessageQueue_50CBD0->uNumMessages;
@@ -2140,7 +2140,7 @@
 				pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
 				/*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
 				{
-				pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+				pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
 				pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
 				*(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
 				++pMessageQueue_50CBD0->uNumMessages;
@@ -2236,7 +2236,7 @@
 					pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
 					/*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
 					{
-						pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+						pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
 						pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
 						*(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
 						++pMessageQueue_50CBD0->uNumMessages;
@@ -5377,7 +5377,7 @@
           /*result = pMessageQueue_50CBD0->uNumMessages;
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
             result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
             *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
--- a/UISaveLoad.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/UISaveLoad.cpp	Mon May 13 18:03:55 2013 +0600
@@ -184,7 +184,7 @@
     strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
     /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_SaveGame;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
       ++pMessageQueue_50CBD0->uNumMessages;
--- a/mm7_1.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_1.cpp	Mon May 13 18:03:55 2013 +0600
@@ -1254,7 +1254,7 @@
       }
       /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
         return;
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_StartNPCDialogue;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18;
 LABEL_42:
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
@@ -1270,7 +1270,7 @@
     }
     /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack;
       goto LABEL_41;
     }*/
     pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
@@ -1287,7 +1287,7 @@
     {
       pMessageQueue_50CBD0->AddMessage(UIMSG_CastQuickSpell, 0, 0);
       /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CastQuickSpell;
 LABEL_41:
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
       goto LABEL_42;*/
--- a/mm7_2.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_2.cpp	Mon May 13 18:03:55 2013 +0600
@@ -96,7 +96,7 @@
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
         {
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
           *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
           ++pMessageQueue_50CBD0->uNumMessages;
@@ -595,7 +595,7 @@
   pParty->uFallSpeed = 0;
   /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
   {
-    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
     pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
     ++pMessageQueue_50CBD0->uNumMessages;
@@ -7247,7 +7247,7 @@
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
             v12 = window_SpeakInHouse == 0;
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
@@ -10736,7 +10736,7 @@
             pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v12, 0);
             /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
-              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
+              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_StartNPCDialogue;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
               *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
--- a/mm7_4.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_4.cpp	Mon May 13 18:03:55 2013 +0600
@@ -6707,7 +6707,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
@@ -6762,7 +6762,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
@@ -6825,7 +6825,7 @@
   pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
   /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
   {
-    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
     pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
     ++pMessageQueue_50CBD0->uNumMessages;
@@ -8461,7 +8461,7 @@
     /*result = pMessageQueue_50CBD0->uNumMessages;
     if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
       result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
       *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
--- a/mm7_5.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_5.cpp	Mon May 13 18:03:55 2013 +0600
@@ -975,35 +975,31 @@
           back_to_game();
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
-          if ( pCurrentScreen > SCREEN_CHEST_INVENTORY )
-          {
-            if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) )
-            {
+          switch ( pCurrentScreen )
+          {
+            case SCREEN_E:
+				__debugbreak();
+            case SCREEN_NPC_DIALOGUE:
+            case SCREEN_CHEST:
+            case SCREEN_CHEST_INVENTORY:
+            case SCREEN_CHANGE_LOCATION:
+            case SCREEN_INPUT_BLV:
+            case SCREEN_QUICK_REFERENCE:
               if ( dword_50CDC8 )
-                goto LABEL_232;
+                break;
               CloseWindowBackground();
               uMessageParam = 1;
-              goto LABEL_232;
-            }
-          }
-          else
-          {
-            if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST )
-            {
-              if ( dword_50CDC8 )
-                goto LABEL_232;
-              CloseWindowBackground();
-              uMessageParam = 1;
-              goto LABEL_232;
-            }
-            if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 )
-            {
-              CloseWindowBackground();
-              dword_5C35C8 = 0;
-              uMessageParam = 1;
-            }
-          }
-LABEL_232:
+              break;
+            case SCREEN_HOUSE:
+              if ( !dword_50CDC8 && !dword_5C35C8 )
+              {
+                CloseWindowBackground();
+                dword_5C35C8 = 0;
+                uMessageParam = 1;
+                break;
+              }
+              break;
+          }
           if ( !ptr_507BDC )
           {
             pRenderer->ClearZBuffer(0, 479);
@@ -1014,7 +1010,36 @@
               if ( pCurrentScreen > SCREEN_67 )
               {
                 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
-                  goto LABEL_321;
+                {
+                  pIcons_LOD->_4114F2();
+                  if ( pGUIWindow_Settings )
+                  {
+                    if ( pCurrentScreen == SCREEN_CHARACTERS )
+                    {
+                      pMouse->SetCursorBitmap("MICON2");
+                    }
+                    else
+                    {
+                      pGUIWindow_Settings->Release();
+                      pGUIWindow_Settings = 0;
+                      pMouse->SetCursorBitmap("MICON1");
+                      GameUI_Footer_TimeLeft = 0;
+                      unk_50C9A0 = 0;
+                      back_to_game();
+                    }
+                  }
+                  if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
+                    uActiveCharacter = pParty->GetNextActiveCharacter();
+                  pGUIWindow_CurrentMenu->Release();
+                  if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
+                    window_SpeakInHouse = 0;
+                  pGUIWindow_CurrentMenu = 0;
+                  pEventTimer->Resume();
+                  pCurrentScreen = SCREEN_GAME;
+                  viewparams->bRedrawGameUI = 1;
+                  pIcons_LOD->_4355F7();
+                  continue;
+                }
               }
               else
               {
@@ -1380,7 +1405,36 @@
                       pVideoPlayer->Unload();
                       continue;
                     case SCREEN_CHARACTERS:
-                      goto LABEL_319;
+                      sub_4196A0();
+                      sub_419379();
+                      pIcons_LOD->_4114F2();
+                      if ( pGUIWindow_Settings )
+                      {
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
+                        {
+                          pMouse->SetCursorBitmap("MICON2");
+                        }
+                        else
+                        {
+                          pGUIWindow_Settings->Release();
+                          pGUIWindow_Settings = 0;
+                          pMouse->SetCursorBitmap("MICON1");
+                          GameUI_Footer_TimeLeft = 0;
+                          unk_50C9A0 = 0;
+                          back_to_game();
+                        }
+                      }
+                      if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
+                        uActiveCharacter = pParty->GetNextActiveCharacter();
+                      pGUIWindow_CurrentMenu->Release();
+                      if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
+                        window_SpeakInHouse = 0;
+                      pGUIWindow_CurrentMenu = 0;
+                      pEventTimer->Resume();
+                      pCurrentScreen = SCREEN_GAME;
+                      viewparams->bRedrawGameUI = 1;
+                      pIcons_LOD->_4355F7();
+                      continue;
                     default:
                       if ( pGUIWindow_Settings )
                       {
@@ -1438,10 +1492,8 @@
                   pIcons_LOD->_4355F7();
                   continue;
                 }
-LABEL_319:
                 sub_4196A0();
                 sub_419379();
-LABEL_321:
                 pIcons_LOD->_4114F2();
               }
               if ( pGUIWindow_Settings )
@@ -1839,9 +1891,10 @@
           unk_50C9A0 = 0;
           back_to_game();
           continue;
+        case UIMSG_CastSpell_8F:
+			__debugbreak();
         case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade)
         case UIMSG_CastSpell_SPIRIT_Fate:
-        case UIMSG_CastSpell_8F://???
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( unk_50C9A0 )
@@ -1905,7 +1958,7 @@
           //goto LABEL_434;
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
@@ -1962,7 +2015,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
           *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
           ++pMessageQueue_50CBD0->uNumMessages;*/
@@ -2108,12 +2161,10 @@
                     *((int *)v67 + 17) = 1;
                   else
                     pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
-//LABEL_434:
                   /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                   {
-                    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+                    pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
                     pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
-//LABEL_771:
                     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                     ++pMessageQueue_50CBD0->uNumMessages;
                   }*/
@@ -2247,9 +2298,8 @@
 			__debugbreak();
           uGameState = GAME_STATE_PLAYING;
           strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
-          goto LABEL_524;
         case UIMSG_DD:
-LABEL_524:
+			__debugbreak();
           sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer);
           memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
           if ( v216.uPropCount == 1 )
@@ -2258,10 +2308,7 @@
             v70 = atoi(v216.pProperties[0]);
             if ( v70 <= 0 || v70 >= 77 )
             {
-//LABEL_90:
               v1 = "";
-//LABEL_91:
-              //v0 = 1;
               continue;
             }
             v71 = v70;
@@ -2284,9 +2331,7 @@
                 dword_6BE364_game_settings_1 |= 1u;
                 uGameState = GAME_STATE_2;
                 OnMapLeave();
-                //goto LABEL_90;
                 v1 = "";
-                //v0 = 1;
                 continue;
               }
             }
@@ -2296,10 +2341,8 @@
           else
           {
             if ( v216.uPropCount != 3 )
-              //goto LABEL_90;
             {
               v1 = "";
-              //v0 = 1;
               continue;
             }
             v74 = atoi(v216.pProperties[0]);
@@ -2311,14 +2354,11 @@
               if ( pIndoor->GetSector(v74, thisi, v75) )
               {
                 v77 = thisi;
-//LABEL_544:
                 pParty->vPosition.x = v74;
                 pParty->vPosition.y = v77;
                 pParty->vPosition.z = v76;
                 pParty->uFallStartY = v76;
-                //goto LABEL_90;
                 v1 = "";
-                //v0 = 1;
                 continue;
               }
             }
@@ -2332,15 +2372,12 @@
                   if ( thisi > -32768 )
                   {
                     if ( thisi < 32768 && v76 >= 0 && v76 < 10000 )
-                      //goto LABEL_544;
                     {
                       pParty->vPosition.x = v74;
                       pParty->vPosition.y = v77;
                       pParty->vPosition.z = v76;
                       pParty->uFallStartY = v76;
-                      //goto LABEL_90;
                       v1 = "";
-                      //v0 = 1;
                       continue;
                     }
                   }
@@ -2351,9 +2388,7 @@
             v73 = "Can't jump to that location!";
           }
           ShowStatusBarString(v73, 6u);
-          //goto LABEL_90;
           v1 = "";
-          //v0 = 1;
           continue;
         case UIMSG_CastQuickSpell:
           if ( bUnderwater == 1 )
@@ -2363,16 +2398,15 @@
             continue;
           }
           if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
-            //goto LABEL_90;
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
           continue;
+        case UIMSG_CastSpell_GreatShot://???
+			__debugbreak();
         case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, 
-        case UIMSG_CastSpell_GreatShot://???
           if ( pRenderer->pRenderD3D )
           {
             v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
@@ -2403,7 +2437,6 @@
             else
               HIBYTE(v51->field_8) &= 0xFDu;
           }
-          //goto LABEL_416;
           v51->uPlayerID_2 = uMessageParam;
           v51->spell_target_pid = v44;
           pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
@@ -2429,14 +2462,11 @@
         case UIMSG_1B:
 			__debugbreak();
           if ( !uActiveCharacter )
-            //goto LABEL_90;
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           if ( pParty->bTurnBasedModeOn != 1 )
-            //goto LABEL_569;
           {
             if ( pActors[uMessageParam].uAIState == 5 )
               stru_50C198.LootActor(&pActors[uMessageParam]);
@@ -2445,15 +2475,12 @@
             continue;
           }
           if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
-            //goto LABEL_90;
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           if ( !(pTurnEngine->field_18 & 2) )
           {
-//LABEL_569:
             if ( pActors[uMessageParam].uAIState == 5 )
               stru_50C198.LootActor(&pActors[uMessageParam]);
             else
@@ -2463,27 +2490,21 @@
 
         case UIMSG_Attack:
           if ( !uActiveCharacter )
-            //goto LABEL_90;
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           if ( pParty->bTurnBasedModeOn != 1 )
-            //goto LABEL_577;
           {
             _42ECB5_PlayerAttacksActor();
             continue;
           }
           if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
-            //goto LABEL_90;
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           if ( !(pTurnEngine->field_18 & 2) )
-//LABEL_577:
             _42ECB5_PlayerAttacksActor();
           continue;
         case UIMSG_ExitRest:
@@ -2547,7 +2568,6 @@
             if ( !uActiveCharacter )
             {
               v1 = "";
-              //v0 = 1;
               continue;
             }
             pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
@@ -2575,7 +2595,6 @@
           if ( !uActiveCharacter )
           {
             v1 = "";
-            //v0 = 1;
             continue;
           }
           pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
@@ -2625,7 +2644,7 @@
                 dword_506F14 = 0;
                 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                 {
-                  pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+                  pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
                   pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
                   *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                   ++pMessageQueue_50CBD0->uNumMessages;
@@ -2695,7 +2714,6 @@
           }
           sprintfex(pTmpBuf, v161, v178);
           sub_41C0B8_set_status_string(pTmpBuf);
-          //v0 = 1;
           continue;
         case UIMSG_ClickInstallRemoveQuickSpellBtn:
           GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
@@ -2834,7 +2852,6 @@
             if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
             {
               if ( !pCurrentScreen )
-                //goto LABEL_693;
               {
                 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
                 pCurrentScreen = SCREEN_SPELL_BOOK;
@@ -2897,7 +2914,7 @@
 //LABEL_453:
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
           //goto LABEL_770;
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
           *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
@@ -2912,11 +2929,11 @@
           continue;
         case UIMSG_ClickAwardsUpBtn:
           GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0);
-          dword_506548 = 1;
+          BtnUp_flag = 1;
           continue;
         case UIMSG_ClickAwardsDownBtn:
           GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0);
-          dword_506544 = 1;
+          BtnDown_flag = 1;
           continue;
         case UIMSG_ChangeDetaliz:
           bRingsShownInCharScreen ^= 1;
@@ -2998,57 +3015,59 @@
           GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0);
           FillAwardsData();
           continue;
-        case UIMSG_AutonotesBook:
+        case UIMSG_AutonotesBook://не только Автозаметки (в процессе)
           switch ( uMessageParam )
           {
-            default:
-              continue;
-            case 11:
-              dword_506548 = 1;
-              continue;
-            case 10:
-              dword_506544 = 1;
-              continue;
+            case 11://Page UP
+              BtnUp_flag = 1;
+              pButton = pBtn_Book_2;
+              break;
+            case 10://Page DOWN
+              BtnDown_flag = 1;
+              pButton = pBtn_Book_1;
+              break;
             case 0:
               pButton = pBtn_Book_1;
-              dword_506544 = 1;
+              BtnDown_flag = 1;
               break;
             case 1:
-              pButton = pBtn_Book_2;
-              dword_506548 = 1;
+              pButton = pBtn_Book_2;//увеличить в MapsBook
+              BtnUp_flag = 1;
               break;
-            case 2:
-              dword_506540 = 1;
+            case 2://Potions
+              Book_PageBtn3_flag = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_3;
               break;
-            case 3:
-              dword_50653C = 1;
+            case 3://fountains
+              Book_PageBtn4_flag = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_4;
               break;
-            case 4:
-              dword_506538 = 1;
+            case 4://obelisks
+              Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_5;
               break;
-            case 5:
-              dword_506534 = 1;
+            case 5://seer
+              Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_6;
               break;
-            case 6:
+            case 6://misc
               pButton = pBtn_Autonotes_Misc;
-              dword_506530 = 1;
+              Autonotes_Misc_page_flag = 1;
               break;
-            case 7:
+            case 7://Instructors
               pButton = pBtn_Autonotes_Instructors;
-              dword_50652C = 1;
+              Autonotes_Instructors_page_flag = 1;
               break;
+            default:
+              continue;
           }
           GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
           continue;
@@ -3128,11 +3147,11 @@
           if ( !pMessageQueue_50CBD0->uNumMessages )
             //goto LABEL_768;
           {
-            pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
+            pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
             /*if ( (signed int)v115 < 40 )
             //goto LABEL_769;
             {
-              pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
+              pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
               *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
@@ -3143,10 +3162,10 @@
           if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
           {
             pMessageQueue_50CBD0->uNumMessages = 1;
-            pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
+            pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
             /*v115 = v0;
             pMessageQueue_50CBD0->uNumMessages = v0;
-            pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
+            pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
             //goto LABEL_771;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
@@ -3155,19 +3174,18 @@
           }
           v115 = 0;
           pMessageQueue_50CBD0->uNumMessages = 0;
-          pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
+          pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
           /*if ( (signed int)v115 < 40 )
             //goto LABEL_769;
           {
-            pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
+            pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
             continue;
           }*/
           continue;
-        case UIMSG_E:
-			__debugbreak();//срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame
+        case UIMSG_MouseLeftClickInScreen://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           OnGameViewportClick();
@@ -3190,7 +3208,7 @@
         case UIMSG_54:
 			__debugbreak();
           pButton2 = (GUIButton *)uMessageParam;
-          GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0);
+          GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
           continue;
         case UIMSG_Game_Action:
           if ( pMessageQueue_50CBD0->uNumMessages )
@@ -10912,7 +10930,7 @@
       pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
       /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
       {
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
         ++pMessageQueue_50CBD0->uNumMessages;
@@ -10988,7 +11006,7 @@
       pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
       /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
       {
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
         ++pMessageQueue_50CBD0->uNumMessages;
@@ -11304,7 +11322,7 @@
   {
     /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)27;
+      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_1B;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3;
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
       ++pMessageQueue_50CBD0->uNumMessages;
--- a/mm7_6.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_6.cpp	Mon May 13 18:03:55 2013 +0600
@@ -9020,7 +9020,7 @@
       {
         /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
           goto LABEL_175;
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
+        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action;
         //goto LABEL_174;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
@@ -9051,7 +9051,7 @@
         /*if ( (signed int)v15 >= 40 )
           goto LABEL_175;
 //LABEL_173:
-        pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113;
+        pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
 //LABEL_174:
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
--- a/mm7_data.cpp	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_data.cpp	Mon May 13 18:03:55 2013 +0600
@@ -1491,14 +1491,14 @@
 unsigned int uExitCancelTextureId;
 int dword_50651C; // weak
 int dword_506528; // weak
-int dword_50652C; // weak
-int dword_506530; // weak
-int dword_506534; // weak
-int dword_506538; // weak
-int dword_50653C; // weak
-int dword_506540; // weak
-int dword_506544; // weak
-int dword_506548; // weak
+int Autonotes_Instructors_page_flag; // dword_50652C
+int Autonotes_Misc_page_flag; //dword_506530
+int Book_PageBtn6_flag; //dword_506534
+int Book_PageBtn5_flag; //dword_506538
+int Book_PageBtn4_flag; // dword_50653C
+int Book_PageBtn3_flag; //dword_506540
+int BtnDown_flag; //dword_506544
+int BtnUp_flag; //dword_506548
 int quick_spell_at_page; // weak
 char byte_506550; // weak
 char *aMoonPhaseNames[5];
--- a/mm7_data.h	Mon May 13 09:39:58 2013 +0600
+++ b/mm7_data.h	Mon May 13 18:03:55 2013 +0600
@@ -919,14 +919,14 @@
 extern unsigned int uExitCancelTextureId;
 extern int dword_50651C; // weak
 extern int dword_506528; // weak
-extern int dword_50652C; // weak
-extern int dword_506530; // weak
-extern int dword_506534; // weak
-extern int dword_506538; // weak
-extern int dword_50653C; // weak
-extern int dword_506540; // weak
-extern int dword_506544; // weak
-extern int dword_506548; // weak
+extern int Autonotes_Instructors_page_flag; // dword_50652C
+extern int Autonotes_Misc_page_flag; //dword_506530
+extern int Book_PageBtn6_flag; //dword_506534
+extern int Book_PageBtn5_flag; //dword_506538
+extern int Book_PageBtn4_flag; //dword_50653C
+extern int Book_PageBtn3_flag; //dword_506540
+extern int BtnDown_flag; //dword_506544
+extern int BtnUp_flag; //dword_506548
 extern int quick_spell_at_page; // weak
 extern char byte_506550; // weak
 extern char *aMoonPhaseNames[5];