changeset 362:38bfbee60146

Menu options
author Ritor1
date Fri, 22 Feb 2013 01:28:48 +0600
parents b803545c1b96
children 3abebb74fd09 c1a45052d634
files GUIWindow.h Texture.cpp Texture.h mm7_5.cpp mm7_data.cpp mm7_data.h
diffstat 6 files changed, 160 insertions(+), 203 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Thu Feb 21 22:42:52 2013 +0600
+++ b/GUIWindow.h	Fri Feb 22 01:28:48 2013 +0600
@@ -312,10 +312,10 @@
   UIMSG_19B = 0x19B,
   UIMSG_19C = 0x19C,
   UIMSG_OpenKeyMappingOptions = 0x19F,
-  UIMSG_1A0 = 0x1A0,
-  UIMSG_1A1 = 0x1A1,
+  UIMSG_SelectKeyPage1 = 0x1A0,
+  UIMSG_SelectKeyPage2 = 0x1A1,
   UIMSG_ResetKeyMapping = 0x1A2,
-  UIMSG_1A3 = 0x1A3,
+  UIMSG_ChangeKeyButton = 0x1A3,
   UIMSG_OpenVideoOptions = 0x1A5,
   UIMSG_ToggleBloodsplats = 0x1A6,
   UIMSG_ToggleColoredLights = 0x1A7,
--- a/Texture.cpp	Thu Feb 21 22:42:52 2013 +0600
+++ b/Texture.cpp	Fri Feb 22 01:28:48 2013 +0600
@@ -116,13 +116,13 @@
 Texture *pTexture_pressrigh;
 Texture *pTexture_buttminu;
 Texture *pTexture_buttplus;
-unsigned int uTextureID_50792C; // weak
-unsigned int uTextureID_507930; // weak
-unsigned int uTextureID_507934; // weak
-unsigned int uTextureID_507938; // weak
-unsigned int uTextureID_50793C; // weak
-unsigned int uTextureID_507940; // weak
-unsigned int uTextureID_507944; // weak
+unsigned int uTextureID_Quit1; // weak
+unsigned int uTextureID_Resume1; // weak
+unsigned int uTextureID_Controls1; // weak
+unsigned int uTextureID_Save1; // weak
+unsigned int uTextureID_Load1; // weak
+unsigned int uTextureID_New1; // weak
+unsigned int uTextureID_Options; // weak
 
 
 unsigned int uTextureID_ib_td5_A;
@@ -169,11 +169,11 @@
 Texture *pTexture_RestUI_CurrentHourglassFrame; // idb
 
 
-unsigned int uTextureID_507BF4; // weak
-unsigned int uTextureID_507BF8; // weak
-unsigned int uTextureID_507BFC; // weak
-unsigned int uTextureID_507C00; // weak
-unsigned int uTextureID_507C04; // weak
+unsigned int uTextureID_Optkb; // weak
+unsigned int uTextureID_Optkb_h; // weak
+unsigned int uTextureID_KeyResume1; // weak
+unsigned int uTextureID_Optkb_1; // weak
+unsigned int uTextureID_Optkb_2; // weak
 
 
 unsigned int uTextureID_507C10; // weak
@@ -186,17 +186,15 @@
 unsigned int uTextureID_507C50; // weak
 unsigned int uTextureID_507C54; // weak
 unsigned int uTextureID_507C58; // weak
-unsigned int uTextureID_507C60; // weak
-unsigned int uTextureID_507C64[777]; // weak
-unsigned int uTextureID_507C68; // weak
-unsigned int uTextureID_507C6C; // weak
-unsigned int uTextureID_507C70; // weak
-unsigned int uTextureID_507C74; // weak
-unsigned int uTextureID_507C84; // weak
+unsigned int uTextureID_ControlBG; // weak
+unsigned int uTextureID_Con_Smoo[3]; // weak
+unsigned int uTextureID_Con_ArrL; // weak
+unsigned int uTextureID_Con_ArrR; // weak
+unsigned int uTextureID_Option04; // weak
 unsigned int pTextureIDs_SoundLevels[10];
-unsigned int uTextureID_507CB0; // weak
-unsigned int uTextureID_507CB4; // weak
-unsigned int uTextureID_507CB8; // weak
+unsigned int uTextureID_Option03; // weak
+unsigned int uTextureID_Option01;
+unsigned int uTextureID_Option02; // weak
 
 
 unsigned int uTextureID_5118C8; // weak
--- a/Texture.h	Thu Feb 21 22:42:52 2013 +0600
+++ b/Texture.h	Fri Feb 22 01:28:48 2013 +0600
@@ -218,13 +218,13 @@
 extern Texture *pTexture_pressrigh;
 extern Texture *pTexture_buttminu;
 extern Texture *pTexture_buttplus;
-extern unsigned int uTextureID_50792C; // weak
-extern unsigned int uTextureID_507930; // weak
-extern unsigned int uTextureID_507934; // weak
-extern unsigned int uTextureID_507938; // weak
-extern unsigned int uTextureID_50793C; // weak
-extern unsigned int uTextureID_507940; // weak
-extern unsigned int uTextureID_507944; // weak
+extern unsigned int uTextureID_Quit1;
+extern unsigned int uTextureID_Resume1;
+extern unsigned int uTextureID_Controls1;
+extern unsigned int uTextureID_Save1;
+extern unsigned int uTextureID_Load1;
+extern unsigned int uTextureID_New1;
+extern unsigned int uTextureID_Options;
 
 
 extern unsigned int uTextureID_ib_td5_A;
@@ -271,11 +271,11 @@
 extern Texture *pTexture_RestUI_CurrentHourglassFrame; // idb
 
 
-extern unsigned int uTextureID_507BF4; // weak
-extern unsigned int uTextureID_507BF8; // weak
-extern unsigned int uTextureID_507BFC; // weak
-extern unsigned int uTextureID_507C00; // weak
-extern unsigned int uTextureID_507C04; // weak
+extern unsigned int uTextureID_Optkb; // weak
+extern unsigned int uTextureID_Optkb_h; // weak
+extern unsigned int uTextureID_KeyResume1; // weak
+extern unsigned int uTextureID_Optkb_1; // weak
+extern unsigned int uTextureID_Optkb_2; // weak
 
 
 extern unsigned int uTextureID_507C10; // weak
@@ -288,17 +288,15 @@
 extern unsigned int uTextureID_507C50; // weak
 extern unsigned int uTextureID_507C54; // weak
 extern unsigned int uTextureID_507C58; // weak
-extern unsigned int uTextureID_507C60; // weak
-extern unsigned int uTextureID_507C64[]; // weak
-extern unsigned int uTextureID_507C68; // weak
-extern unsigned int uTextureID_507C6C; // weak
-extern unsigned int uTextureID_507C70; // weak
-extern unsigned int uTextureID_507C74; // weak
-extern unsigned int uTextureID_507C84; // weak
+extern unsigned int uTextureID_ControlBG; // weak
+extern unsigned int uTextureID_Con_Smoo[3]; // weak
+extern unsigned int uTextureID_Con_ArrL; // weak
+extern unsigned int uTextureID_Con_ArrR; // weak
+extern unsigned int uTextureID_Option04; // weak
 extern unsigned int pTextureIDs_SoundLevels[10];
-extern unsigned int uTextureID_507CB0; // weak
-extern unsigned int uTextureID_507CB4; // weak
-extern unsigned int uTextureID_507CB8; // weak
+extern unsigned int uTextureID_Option03; // weak
+extern unsigned int uTextureID_Option01;
+extern unsigned int uTextureID_Option02; // weak
 
 
 extern unsigned int uTextureID_5118C8; // weak
--- a/mm7_5.cpp	Thu Feb 21 22:42:52 2013 +0600
+++ b/mm7_5.cpp	Fri Feb 22 01:28:48 2013 +0600
@@ -592,12 +592,12 @@
           pGUIWindow_CurrentMenu->Release();
           viewparams->field_48 = v0;
           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);
-          uTextureID_507C70 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
-          uTextureID_507C74 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
-          uTextureID_507C64[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
+          uTextureID_ControlBG = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
+          uTextureID_Con_Smoo[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
+          uTextureID_Con_Smoo[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
+          uTextureID_Con_ArrL = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
+          uTextureID_Con_ArrR = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
+          uTextureID_Con_Smoo[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
           pTextureIDs_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
           pTextureIDs_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
           pTextureIDs_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
@@ -608,71 +608,59 @@
           pTextureIDs_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
           pTextureIDs_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
           pTextureIDs_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
-          uTextureID_507C84 = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
-          uTextureID_507CB0 = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
-          uTextureID_507CB8 = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
-          uTextureID_507CB4 = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
+          uTextureID_Option04 = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
+          uTextureID_Option03 = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
+          uTextureID_Option02 = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
+          uTextureID_Option01 = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x16u, 0x10Eu,
-            (uTextureID_507C6C != -1 ? pIcons_LOD->pTextures[uTextureID_507C6C].uTextureWidth : 24),
-            (uTextureID_507C6C != -1 ? pIcons_LOD->pTextures[uTextureID_507C6C].uTextureHeight : 26),
+            (uTextureID_Con_Smoo[2] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[2]].uTextureWidth : 24),
+            (uTextureID_Con_Smoo[2] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[2]].uTextureHeight : 26),
             v0, 0, 0xB8u, 0x80u, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x5Du, 0x10Eu,
-            (uTextureID_507C68 != -1 ? pIcons_LOD->pTextures[uTextureID_507C68].uTextureWidth : 24),
-            (uTextureID_507C68 != -1 ? pIcons_LOD->pTextures[uTextureID_507C68].uTextureHeight : 26),
+            (uTextureID_Con_Smoo[1] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[1]].uTextureWidth : 24),
+            (uTextureID_Con_Smoo[1] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[1]].uTextureHeight : 26),
             v0, 0, 0xB8u, 0x40u, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xA4u, 0x10Eu,
-            (uTextureID_507C64[0] != -1 ? pIcons_LOD->pTextures[uTextureID_507C64[0]].uTextureWidth : 24),
-            (uTextureID_507C64[0] != -1 ? pIcons_LOD->pTextures[uTextureID_507C64[0]].uTextureHeight : 26),
+            (uTextureID_Con_Smoo[0] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[0]].uTextureWidth : 24),
+            (uTextureID_Con_Smoo[0] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[0]].uTextureHeight : 26),
             v0, 0, 0xB8u, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x12Fu,
-            (uTextureID_507CB4 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB4].uTextureWidth : 24),
-            (uTextureID_507CB4 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB4].uTextureHeight : 26),
+            (uTextureID_Option01 != -1 ? pIcons_LOD->pTextures[uTextureID_Option01].uTextureWidth : 24),
+            (uTextureID_Option01 != -1 ? pIcons_LOD->pTextures[uTextureID_Option01].uTextureHeight : 26),
             v0, 0, 0xB9u, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x12Fu,
-            (uTextureID_507CB8 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB8].uTextureWidth : 24),
-            (uTextureID_507CB8 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB8].uTextureHeight : 26),
+            (uTextureID_Option02 != -1 ? pIcons_LOD->pTextures[uTextureID_Option02].uTextureWidth : 24),
+            (uTextureID_Option02 != -1 ? pIcons_LOD->pTextures[uTextureID_Option02].uTextureHeight : 26),
             v0, 0, 0xBBu, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x145u,
-            (uTextureID_507CB0 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB0].uTextureWidth : 24),
-            (uTextureID_507CB0 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB0].uTextureHeight : 26),
+            (uTextureID_Option03 != -1 ? pIcons_LOD->pTextures[uTextureID_Option03].uTextureWidth : 24),
+            (uTextureID_Option03 != -1 ? pIcons_LOD->pTextures[uTextureID_Option03].uTextureHeight : 26),
             v0, 0, 0xE1u, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x145u,
-            (uTextureID_507C84 != -1 ? pIcons_LOD->pTextures[uTextureID_507C84].uTextureWidth : 24),
-            (uTextureID_507C84 != -1 ? pIcons_LOD->pTextures[uTextureID_507C84].uTextureHeight : 26),
+            (uTextureID_Option04 != -1 ? pIcons_LOD->pTextures[uTextureID_Option04].uTextureWidth : 24),
+            (uTextureID_Option04 != -1 ? pIcons_LOD->pTextures[uTextureID_Option04].uTextureHeight : 26),
             v0, 0, 0xE2u, 0, 0, v1, 0);
           pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, 111, 4, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C70], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0);
           pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xA2u, 0x10u, 0x10u, v0, 0, 0x6Fu, 5, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C74], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0);
           pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xA2u, 0xACu, 0x11u, v0, 0, 0x6Fu, 0, 0, v1, 0);
           pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 4, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C70], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0);
           pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 5, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C74], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0);
           pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xD8u, 0xACu, 0x11u, v0, 0, 0x70u, 0, 0, v1, 0);
           pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 4, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C70], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0);
           pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 5u, 0, v1,
-                         &pIcons_LOD->pTextures[uTextureID_507C74], 0);
+                         &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0);
           pGUIWindow_CurrentMenu->CreateButton(0x107u, 0x10Eu, 0xACu, 0x11u, v0, 0, 0xBAu, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, 0x71u, 0, 0,
             pGlobalTXT_LocalizationStrings[619],// "Return to Game"
             0);
           pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x8Cu, 0xD6u, 0x28u, v0, 0, 0x19Fu, 0, 0x4Bu, v1, 0);
-          pTexture = 0;
-          v150 = v1;
-          v143 = 86;
-          v138 = 0;
-          v134 = 421;
-          v131 = 0;
-          v129 = v0;
-          v126 = 40;
-          v124 = 214;
-          v122 = 194;
-          v120 = 19;
-          //goto LABEL_117;
-          pGUIWindow_CurrentMenu->CreateButton(v120, v122, v124, v126, v129, v131, v134, v138, v143, v150, pTexture);
+          pGUIWindow_CurrentMenu->CreateButton(19, 194, 214, 40, v0, 0, 421, 0, 86, v1, 0);
           continue;
         case UIMSG_OpenKeyMappingOptions:
           if ( pMessageQueue_50CBD0->uNumMessages )
@@ -680,11 +668,11 @@
           pGUIWindow_CurrentMenu->Release();
           viewparams->field_48 = 1;
           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);
-          uTextureID_507C00 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
-          uTextureID_507C04 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
+          uTextureID_Optkb = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
+          uTextureID_Optkb_h = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
+          uTextureID_KeyResume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
+          uTextureID_Optkb_1 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
+          uTextureID_Optkb_2 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, "", 0);
           pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, "", 0);
@@ -706,7 +694,7 @@
           pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 0xCu, 0, "", 0);
           pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 0xDu, 0, "", 0);
           dword_506E68 = -1;
-          dword_506F08 = 1;
+          KeyboardPageNum = 1;
           memset(word_506E6C, 0, 0x1Cu);
           word_506E6C[14] = 0;
           memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
@@ -716,11 +704,14 @@
           continue;
         //default:
           //continue;
-        case UIMSG_1A3:
+        case UIMSG_ChangeKeyButton:
           if ( dword_506E68 != -1 )
-            goto LABEL_623;
+          {
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
+          }
           v14 = uMessageParam;
-          if ( dword_506F08 != v0 )
+          if ( KeyboardPageNum != v0 )
             v14 = uMessageParam + 14;
           dword_506E68 = v14;
           pKeyActionMap->EnterText(0, v0, pGUIWindow_CurrentMenu);
@@ -762,11 +753,11 @@
           v130 = 0;
           v127 = 219;
           goto _play_sound_and_continue;
-        case UIMSG_1A0:
-          dword_506F08 = v0;
-          continue;
-        case UIMSG_1A1:
-          dword_506F08 = 2;
+        case UIMSG_SelectKeyPage1:
+          KeyboardPageNum = v0;
+          continue;
+        case UIMSG_SelectKeyPage2:
+          KeyboardPageNum = 2;
           continue;
         case UIMSG_OpenVideoOptions:
           if ( pMessageQueue_50CBD0->uNumMessages )
@@ -1348,7 +1339,7 @@
                       pEventTimer->Resume();
                       continue;
                     case SCREEN_OPTIONS:
-                      thisa = (signed int)&uTextureID_507C60;
+                      thisa = (signed int)&uTextureID_ControlBG;
                       do
                       {
                         if ( *(int *)thisa )
@@ -1356,7 +1347,7 @@
                         thisa += 4;
                       }
                       while ( thisa < (signed int)&dword_507CBC );
-                      memset(&uTextureID_507C60, 0, 0x5Cu);
+                      memset(&uTextureID_ControlBG, 0, 0x5Cu);
                       pIcons_LOD->_40F9C5();
                       WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
                       WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
@@ -1437,7 +1428,7 @@
                         ++v32;
                         if ( v32 >= 28 )
                         {
-                          thisb = (signed int)&uTextureID_507BF4;
+                          thisb = (signed int)&uTextureID_Optkb;
                           do
                           {
                             if ( *(int *)thisb )
@@ -1445,7 +1436,7 @@
                             thisb += 4;
                           }
                           while ( thisb < (signed int)&dword_507C08 );
-                          memset(&uTextureID_507BF4, 0, 0x14u);
+                          memset(&uTextureID_Optkb, 0, 0x14u);
                           pIcons_LOD->_40F9C5();
                           uAction = 0;
                           do
@@ -1479,7 +1470,8 @@
                           break;
                         }
                       }
-                      goto LABEL_623;
+                      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+                      continue;
                     case SCREEN_REST:
                       if ( dword_506F14 )
                       {
@@ -1726,31 +1718,31 @@
               if ( !pIcons_LOD->uNumPrevLoadedFiles )
                 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
               pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)3, 0, 0);
-              uTextureID_507944 = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
-              uTextureID_507940 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
-              uTextureID_50793C = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
-              uTextureID_507938 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
-              uTextureID_507934 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
-              uTextureID_507930 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
-              uTextureID_50792C = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
+              uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
+              uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
               pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, v0, 0, 0x7Cu, 0, 0x4Eu,
                              pGlobalTXT_LocalizationStrings[614],// "New Game"
-                             (Texture *)(uTextureID_507940 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507940] : 0), 0);
+                             (Texture *)(uTextureID_New1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_New1] : 0), 0);
               pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, v0, 0, 0x7Eu, 0, 0x53u,
                              pGlobalTXT_LocalizationStrings[615],// "Save Game"
-                             (Texture *)(uTextureID_507938 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507938] : 0), 0);
+                             (Texture *)(uTextureID_Save1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Save1] : 0), 0);
               pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, v0, 0, 0x7Du, 0, 0x4Cu,
                              pGlobalTXT_LocalizationStrings[616],// "Load Game"
-                             (Texture *)(uTextureID_50793C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50793C] : 0), 0);
+                             (Texture *)(uTextureID_Load1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Load1] : 0), 0);
               pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, v0, 0, 0x7Fu, 0, 0x43u,
                              pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
-                             (Texture *)(uTextureID_507934 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507934] : 0), 0);
+                             (Texture *)(uTextureID_Controls1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Controls1] : 0), 0);
               pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, v0, 0, 0x84u, 0, 0x51u,
                              pGlobalTXT_LocalizationStrings[618],// "Quit"
-                             (Texture *)(uTextureID_50792C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50792C] : 0), 0);
+                             (Texture *)(uTextureID_Quit1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Quit1] : 0), 0);
               pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, v0, 0, 0x7Bu, 0, 0x52u,
                              pGlobalTXT_LocalizationStrings[619],// "Return to Game"
-                             (Texture *)(uTextureID_507930 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507930] : 0), 0);
+                             (Texture *)(uTextureID_Resume1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Resume1] : 0), 0);
               pGUIWindow_CurrentMenu->_41D08F(6, v0, 0, 0);
               viewparams->field_48 = v0;
               stru_506E40.Release();
@@ -2609,7 +2601,11 @@
           continue;
         case UIMSG_19:
           if ( bUnderwater == 1 )
-            goto LABEL_682;
+          {
+            ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
+          }
           if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
             //goto LABEL_90;
           {
@@ -2617,13 +2613,7 @@
             v0 = 1;
             continue;
           }
-          v79 = pPlayer2->uQuickSpell;
-          v175 = uActiveCharacter;
-          v159 = 0;
-          v147 = 0;
-          v80 = uActiveCharacter - 1;
-          //goto LABEL_679;
-          _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
+          _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
           continue;
         case UIMSG_46:
         case UIMSG_8C:
@@ -2760,7 +2750,9 @@
             //goto LABEL_621;
           {
             v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
-            goto LABEL_622;
+            ShowStatusBarString(v96, 2);
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
           }
           GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90,
             (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
@@ -2772,7 +2764,9 @@
             //goto LABEL_621;
           {
             v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
-            goto LABEL_622;
+            ShowStatusBarString(v96, 2);
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
           }
           GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, (enum WindowType)90,
             (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
@@ -2865,7 +2859,9 @@
             //goto LABEL_621;
           {
             v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
-            goto LABEL_622;
+            ShowStatusBarString(v96, 2);
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
           }
           if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
           {
@@ -2945,7 +2941,9 @@
           {
 //LABEL_621:
             v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
-            goto LABEL_622;
+            ShowStatusBarString(v96, 2);
+            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            continue;
           }
           GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, (enum WindowType)90,
             (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
@@ -3155,11 +3153,7 @@
             continue;
           if ( bUnderwater == 1 )
           {
-LABEL_682:
-            v96 = pGlobalTXT_LocalizationStrings[652];// "You can not do that while you are underwater!"
-LABEL_622:
-            ShowStatusBarString(v96, 2u);
-LABEL_623:
+            ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
             v165 = 0;
             v151 = 0;
             v144 = 0;
@@ -14832,16 +14826,10 @@
     dword_506E68 = -1;
     v3->field_40 = 0;
   }
-  pRenderer->DrawTextureIndexed(
-    8u,
-    8u,
-    (Texture *)(uTextureID_507BF4 != -1 ? &pIcons_LOD->pTextures[uTextureID_507BF4] : 0));
-  if ( dword_506F08 == 1 )
-  {
-    pRenderer->DrawTextureIndexed(
-      0x13u,
-      0x12Eu,
-      (Texture *)(uTextureID_507C00 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C00] : 0));
+  pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb] : 0));
+  if ( KeyboardPageNum == 1 )
+  {
+    pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb_1 != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb_1] : 0));
     pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0);
     v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]);
     v7 = sub_414D24(0);
@@ -14904,10 +14892,7 @@
   }
   else
   {
-    pRenderer->DrawTextureIndexed(
-      0x7Fu,
-      0x12Eu,
-      (Texture *)(uTextureID_507C04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C04] : 0));
+    pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb_2 != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb_2] : 0));
     pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0);
     v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]);
     v34 = sub_414D24(14);
@@ -15066,18 +15051,12 @@
 
 
 //----- (00414F82) --------------------------------------------------------
-void __cdecl sub_414F82_DrawGameOptions()
+void __cdecl DrawGameOptions()
 {
   signed int v0; // eax@1
 
-  pRenderer->DrawTextureIndexed(
-    8u,
-    8u,
-    (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0));
-  pRenderer->DrawTextureIndexed(
-    8u,
-    0x84u,
-    (Texture *)(uTextureID_507C60 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C60] : 0));
+  pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0));
+  pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG] : 0));
   v0 = 0;
   if ( uTurnSpeed == 128 )
   {
@@ -15088,41 +15067,20 @@
     if ( uTurnSpeed == 64 )
       v0 = 1;
   }
-  pRenderer->DrawTextureIndexed(
-    dword_4E2910[v0],
-    0x10Eu,
-    (Texture *)(uTextureID_507C64[v0] != -1 ? &pIcons_LOD->pTextures[uTextureID_507C64[v0]] : 0));
+  pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_Con_Smoo[v0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Con_Smoo[v0]] : 0));
   if ( bWalkSound )
-    pRenderer->DrawTextureIndexed(
-      0x14u,
-      0x12Fu,
-      (Texture *)(uTextureID_507CB4 != -1 ? &pIcons_LOD->pTextures[uTextureID_507CB4] : 0));
+    pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_Option01 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option01] : 0));
   if ( bShowDamage )
-    pRenderer->DrawTextureIndexed(
-      0x80u,
-      0x12Fu,
-      (Texture *)(uTextureID_507CB8 != -1 ? &pIcons_LOD->pTextures[uTextureID_507CB8] : 0));
+    pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_Option02 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option02] : 0));
   if ( bFlipOnExit )
-    pRenderer->DrawTextureIndexed(
-      0x80u,
-      0x145u,
-      (Texture *)(uTextureID_507C84 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C84] : 0));
+    pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_Option04 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option04] : 0));
   if ( bAlwaysRun )
-    pRenderer->DrawTextureIndexed(
-      0x14u,
-      0x145u,
-      (Texture *)(uTextureID_507CB0 != -1 ? &pIcons_LOD->pTextures[uTextureID_507CB0] : 0));
-  pRenderer->DrawTextureIndexed(
-    17 * (char)uSoundVolumeMultiplier + 265,
-    0xA2u,
+    pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_Option03 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option03] : 0));
+  pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162,
     (Texture *)(pTextureIDs_SoundLevels[(char)uSoundVolumeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uSoundVolumeMultiplier]] : 0));
-  pRenderer->DrawTextureIndexed(
-    17 * (char)uMusicVolimeMultiplier + 265,
-    0xD8u,
+  pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216,
     (Texture *)(pTextureIDs_SoundLevels[(char)uMusicVolimeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uMusicVolimeMultiplier]] : 0));
-  pRenderer->DrawTextureIndexed(
-    17 * (char)uVoicesVolumeMultiplier + 265,
-    0x10Eu,
+  pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270,
     (Texture *)(pTextureIDs_SoundLevels[(char)uVoicesVolumeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uVoicesVolumeMultiplier]] : 0));
 }
 
@@ -15859,7 +15817,7 @@
               }
               else if (pWindowType == WINDOW_Options)
               {
-                sub_414F82_DrawGameOptions();
+                DrawGameOptions();
               }
             }
             else if (pWindowType == WINDOW_CharacterRecord)
@@ -15868,7 +15826,7 @@
             }
             continue;
           }
-          pTexture = (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0);//pWindowType == 3 (0x3)
+          pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3)
           pY = pViewport->uViewportY;
           pX = pViewport->uViewportX;
           //goto LABEL_18;
--- a/mm7_data.cpp	Thu Feb 21 22:42:52 2013 +0600
+++ b/mm7_data.cpp	Fri Feb 22 01:28:48 2013 +0600
@@ -658,7 +658,10 @@
 int pCurrentScreen = SCREEN_VIDEO; // 004E28F8
 char byte_4E28FC; // weak
 unsigned int uGammaPos;
-int dword_4E2910[777]; // weak
+int BtnTurnCoord[8] = 
+{
+  0xA4, 0x5D, 0x16, 0xB, 0x5, 0xD, 0x7, 0x3B,
+}; // weak
 __int16 RightClickPortraitXmin[4]={0x14, 0x83, 0xF2, 0x165};
 __int16 RightClickPortraitXmax[4]={0x53, 0xC6, 0x138, 0x1A7};
 void *off_4E2A12; // weak
@@ -702,10 +705,10 @@
 char ascii_4E2D28[8];
 char ascii_4E2D30[7];
 char ascii_4E2D38[5];
-char ascii_4E2D40[8];
-char ascii_4E2D48[6];
-char ascii_4E2D50[12];
-char ascii_4E2D5C[7];
+char ascii_4E2D40[8];// = {0xC2, 0xCF, 0xD0, 0xC0, 0xC2, 0xCE, 0};//russian text in keyboard options
+char ascii_4E2D48[6];// = {0xC2, 0xCB, 0xC5, 0xC2, 0xCE, 0};
+char ascii_4E2D50[6];// = {0xCD, 0xC0, 0xC7, 0xC0, 0xC4, 0};
+char ascii_4E2D5C[7];// = {0xC2, 0xCF, 0xC5, 0xD0, 0xC5, 0xC4, 0};
 char aMakingItemNumb[777]; // idb
 char aNpc03d[777]; // idb
 const char *format_4E2D80 = "\f%05d%s\f00000\n";
@@ -1778,7 +1781,7 @@
 int dword_506E68; // weak
 __int16 word_506E6C[18]; // weak
 unsigned int pPrevVirtualCidesMapping[27];
-int dword_506F08; // weak
+int KeyboardPageNum; // weak
 int dword_506F0C[777]; // idb
 int uRestUI_FoodRequiredToRest;
 int dword_506F14; // weak
--- a/mm7_data.h	Thu Feb 21 22:42:52 2013 +0600
+++ b/mm7_data.h	Fri Feb 22 01:28:48 2013 +0600
@@ -459,7 +459,7 @@
 extern int pCurrentScreen; // 004E28F8
 extern char byte_4E28FC; // weak
 extern unsigned int uGammaPos;
-extern int dword_4E2910[]; // weak
+extern int BtnTurnCoord[8];
 extern __int16 RightClickPortraitXmin[4];
 extern __int16 RightClickPortraitXmax[4];
 extern void *off_4E2A12; // weak
@@ -505,7 +505,7 @@
 extern char ascii_4E2D38[5];
 extern char ascii_4E2D40[8];
 extern char ascii_4E2D48[6];
-extern char ascii_4E2D50[12];
+extern char ascii_4E2D50[6];
 extern char ascii_4E2D5C[7];
 extern char aMakingItemNumb[]; // idb
 extern char aNpc03d[]; // idb
@@ -1184,7 +1184,7 @@
 extern int dword_506E68; // weak
 extern __int16 word_506E6C[18]; // weak
 extern unsigned int pPrevVirtualCidesMapping[27];
-extern int dword_506F08; // weak
+extern int KeyboardPageNum; // weak
 extern int dword_506F0C[]; // idb
 extern int uRestUI_FoodRequiredToRest;
 extern int dword_506F14; // weak
@@ -1849,7 +1849,7 @@
 char __cdecl GameMenuUI_DrawKeyBindings();
 unsigned int __thiscall sub_414D24(int _this);
 void __cdecl GameMenuUI_DrawVideoOptions();
-void __cdecl sub_414F82_DrawGameOptions();
+void __cdecl DrawGameOptions();
 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight); // idb
 char *__cdecl DrawCopyrightWindow();
 void __cdecl GUI_UpdateWindows();