changeset 165:572d821561f3

MenuID
author Ritor1
date Thu, 14 Feb 2013 14:48:43 +0600
parents 4b61b82a0bf7
children 71b13d70f5a6
files GUIWindow.cpp GUIWindow.h Game.cpp SaveLoad.cpp VideoPlayer.cpp VideoPlayer.h mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h
diffstat 12 files changed, 590 insertions(+), 378 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/GUIWindow.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -1056,10 +1056,7 @@
   v1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(
-    0x1D4u,
-    0,
-    (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
+  pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
   if ( array_5913D8[6] != (NPCData *)uNumDialogueNPCPortraits || !uHouse_ExitPic )
   {
     w.uFrameWidth = 130;
@@ -1073,14 +1070,9 @@
       v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(v2, &w, 0, 0);
       if ( v3 < 0 )
         v3 = 0;
-      v18.DrawTitleText(
-        pFontCreate,
-        0x1EAu,
-        v3 / 2 + 4,
-        v1,
+      v18.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, v1,
         //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C],
-        p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName,
-        3u);
+        p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName, 3);
     }
   }
   v18.uFrameWidth += 8;
@@ -1099,10 +1091,7 @@
       w.uFrameZ = 457;
       v5 = pFontArrus->CalcTextHeight(ptr_F8B1E8, &w, 13, 0);
       v6 = v5 + 7;
-      pRenderer->_4A6A68(
-        8u,
-        352 - (v5 + 7),
-        (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
+      pRenderer->_4A6A68(8, 352 - (v5 + 7), (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
         (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - (v5 + 7));
       pRenderer->DrawTextureIndexed(8u, 347 - v6, pTexture_591428);
       v7 = FitTextInAWindow(ptr_F8B1E8, pFontArrus, &w, 0xDu, 0);
@@ -1113,14 +1102,11 @@
       goto LABEL_58;
     while ( 1 )
     {
-      pRenderer->DrawTextureIndexed(
-        *(&_4E5E50_transui_x + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
-        *(&_4E5EE0_transui_y + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
+      pRenderer->DrawTextureIndexed(*(&pNPCPortraits_x + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
+        *(&pNPCPortraits_y + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
         (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
-      pRenderer->DrawTextureIndexed(
-        *(&_4E5E50_transui_x + v8 + 6 * uNumDialogueNPCPortraits - 6),
-        *(&_4E5EE0_transui_y + v8 + 6 * uNumDialogueNPCPortraits - 6),
-        pDialogueNPCPortraits[v8]);
+      pRenderer->DrawTextureIndexed(*(&pNPCPortraits_x + v8 + 6 * uNumDialogueNPCPortraits - 6),
+        *(&pNPCPortraits_y + v8 + 6 * uNumDialogueNPCPortraits - 6), pDialogueNPCPortraits[v8]);
       if ( uNumDialogueNPCPortraits < 4 )
         break;
 LABEL_57:
@@ -1156,9 +1142,9 @@
     goto LABEL_56;
   }
   v4 = (char *)array_5913D8[6] - 1;
-  pRenderer->DrawTextureIndexed(_4E5E50_transui_x - 4, _4E5EE0_transui_y - 4,
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4,
     (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
-  pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[(signed int)v4]);
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[(signed int)v4]);
   if ( pCurrentScreen == SCREEN_E )
   {
     CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
@@ -1170,9 +1156,7 @@
   }
   else
   {
-    sprintf(
-      pTmpBuf,
-      pGlobalTXT_LocalizationStrings[429],
+    sprintf( pTmpBuf, pGlobalTXT_LocalizationStrings[429],
       //p2DEvents_minus1_::08[13 * (unsigned int)ptr_507BC0->ptr_1C],
       p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterName,
       //p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]);
@@ -1248,10 +1232,7 @@
 LABEL_58:
   if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic )
   {
-    pRenderer->DrawTextureIndexed(
-      0x22Cu,
-      0x1C3u,
-      (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
+    pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
     v16 = (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0);
     v14 = 451;
     v12 = 476;
@@ -1855,7 +1836,7 @@
         case WINDOW_Book:
           pWindow->InitializeBookView();
           break;
-        case WINDOW_A:
+        case WINDOW_Dialogue:
           pMainScreenNum = pCurrentScreen;
           pCurrentScreen = SCREEN_NPC_DIALOGUE;
           pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit"
@@ -1960,7 +1941,7 @@
                          (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0);
           pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, 0x5Au, 0, 0x59u, pWindow->Hint,
                          (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 0);
-          pWindow->CreateButton(_4E5E50_transui_x, _4E5EE0_transui_y, 0x3Fu, 0x49u, 1, 0, 0x5Au, 1u, 0x20u, pWindow->Hint, 0, 0, 0);
+          pWindow->CreateButton(pNPCPortraits_x, pNPCPortraits_y, 0x3Fu, 0x49u, 1, 0, 0x5Au, 1u, 0x20u, pWindow->Hint, 0, 0, 0);
           pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x5Au, 1u, 0, pWindow->Hint, 0);
           break;
         case WINDOW_SpellBook: // окно книги заклов
@@ -2011,8 +1992,8 @@
           v29 = pGlobalTXT_LocalizationStrings[435];//Побеседовать с ^Pt[%s]
         }
         sprintf(&byte_591180[100 * v26], v29, v30);
-        array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(*(&_4E5E50_transui_x + v26 + 6 * uNumDialogueNPCPortraits - 6),
-                                             *(&_4E5EE0_transui_y + v26 + 6 * uNumDialogueNPCPortraits - 6),
+        array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(*(&pNPCPortraits_x + v26 + 6 * uNumDialogueNPCPortraits - 6),
+                                             *(&pNPCPortraits_y + v26 + 6 * uNumDialogueNPCPortraits - 6),
                                              0x3Fu, 0x49u, 1, 0, 0x19Au, v26, 0, &byte_591180[100 * v26], 0, 0, 0);
         ++v26;
         v25 = uNumDialogueNPCPortraits;
@@ -2035,7 +2016,7 @@
                      (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0);
       pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, 0x19Bu, 0, 0x59u, pWindow->Hint,
                      (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 0);
-      pWindow->CreateButton(_4E5E50_transui_x, _4E5EE0_transui_y, 0x3Fu, 0x49u, 1, 0, 0x19Bu, 1, 0x20u, pWindow->Hint, 0);
+      pWindow->CreateButton(pNPCPortraits_x, pNPCPortraits_y, 0x3Fu, 0x49u, 1, 0, 0x19Bu, 1, 0x20u, pWindow->Hint, 0);
       pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x19Bu, 1u, 0, pWindow->Hint, 0);
       return pWindow;
     }
--- a/GUIWindow.h	Thu Feb 14 09:27:19 2013 +0600
+++ b/GUIWindow.h	Thu Feb 14 14:48:43 2013 +0600
@@ -15,10 +15,11 @@
   MENU_FINISHED = 0x4,
   MENU_5 = 0x5,
   MENU_CREATEPARTY = 0x6,
-  MENU_7 = 0x7,
-  MENU_Credits = 0x8,
-  MENU_LOAD = 0x9,
+  MENU_NAMEPANELESC = 0x7,
+  MENU_CREDITSPROC = 0x8,
+  MENU_LOADINGPROC = 0x9,
   MENU_10 = 0xA,
+  MENU_CREDITSCLOSE = 0xB,
 };
 
 
@@ -38,7 +39,7 @@
   WINDOW_CharacterRecord = 0x4,
   WINDOW_Options = 0x6,
   WINDOW_Book = 0x9,
-  WINDOW_A = 0xA,
+  WINDOW_Dialogue = 0xA,
   WINDOW_QuickReference = 0xC,
   WINDOW_Rest = 0x10,
   WINDOW_ChangeLocation = 0x11,
--- a/Game.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/Game.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -210,7 +210,7 @@
   MSG Msg; // [sp+28h] [bp-3Ch]@20
   char Source[64]; // [sp+44h] [bp-20h]@76
 
-  bLoading = uCurrentMenuID == MENU_LOAD;
+  bLoading = uCurrentMenuID == MENU_LOADINGPROC;
   SetCurrentMenuID((MENU_STATE)-1);
   if (bLoading)
   {
--- a/SaveLoad.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/SaveLoad.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -614,7 +614,7 @@
   int bNotArena; // [sp+2Ch] [bp-8h]@1
   unsigned int v6; // [sp+30h] [bp-4h]@1
 
-  __debugbreak();
+  //__debugbreak();
 
   v1 = uSlot;
   v6 = uSlot;
--- a/VideoPlayer.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/VideoPlayer.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -293,7 +293,7 @@
   unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8
 
   pVideoPlayer->bStopBeforeSchedule = false;
-  pVideoPlayer->field_40 = 0;
+  pVideoPlayer->pResetflag = 0;
   bGameoverLoop = 1;
   if ( !bNoVideo )
   {
@@ -1168,6 +1168,6 @@
 void VideoPlayer::PlayDeathMovie()
 {
   bStopBeforeSchedule = 0;
-  field_40 = 0;
+  pResetflag = 0;
   pGame->pCShow->PlayMovie(MOVIE_Death, 1);
 }
\ No newline at end of file
--- a/VideoPlayer.h	Thu Feb 14 09:27:19 2013 +0600
+++ b/VideoPlayer.h	Thu Feb 14 14:48:43 2013 +0600
@@ -121,7 +121,7 @@
   {
     //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame);
     bStopBeforeSchedule = false;
-    field_40 = 0;
+    pResetflag = 0;
     byte_F8BC0C = 0;
     //pBinkMovie = nullptr;
   }
@@ -129,7 +129,7 @@
   virtual ~VideoPlayer()
   {
     bStopBeforeSchedule = false;
-    field_40 = 0;
+    pResetflag = 0;
     pVideoFrame.Release();
   }
 
@@ -162,7 +162,7 @@
   int field_34;
   MovieHeader *pMightVideoHeaders;
   MovieHeader *pMagicVideoHeaders;
-  int field_40;
+  int pResetflag;
   int field_44;
   unsigned int uNumMightVideoHeaders;
   unsigned int uNumMagicVideoHeaders;
--- a/mm7_2.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_2.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -4400,20 +4400,8 @@
         v3 = byte_591180;
         do
         {
-          array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(
-                                              *(&_4E5E50_transui_x + v2 + 6 * v1 - 6),
-                                              *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
-                                              0x3Fu,
-                                              0x49u,
-                                              1,
-                                              0,
-                                              0x19Au,
-                                              v2,
-                                              0,
-                                              v3,
-                                              0,
-                                              0,
-                                              0);
+          array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6),
+                                              0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0);
           v1 = uNumDialogueNPCPortraits;
           ++v2;
           v3 += 100;
@@ -5101,7 +5089,7 @@
   pRenderer->ClearBlack();
   pRenderer->EndScene();
   pRenderer->Present();
-  pVideoPlayer->field_40 = 0;
+  pVideoPlayer->pResetflag = 0;
   _449B57_test_bit(pParty->_award_bits, 99);
   _this.Load("winbg.pcx", 2);
   pRenderer->BeginScene();
@@ -11439,7 +11427,7 @@
   GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
   GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
   pRenderer->BeginScene();
-  if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD )
+  if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOADINGPROC )
   {
     pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0);
     if ( a4 )
@@ -11542,7 +11530,7 @@
     if ( pGUIWindow_CurrentMenu->field_40 == 3 )
       pGUIWindow_CurrentMenu->field_40 = 0;
   }
-  if (GetCurrentMenuID() == MENU_LOAD)
+  if (GetCurrentMenuID() == MENU_LOADINGPROC)
   {
     //v18 = pGlobalTXT_LocalizationStrings[135];
     v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"Загрузка"
@@ -12049,8 +12037,8 @@
   ++pIcons_LOD->uTexturePacksCount;
   if ( !pIcons_LOD->uNumPrevLoadedFiles )
     pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-  pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); // создание окна
-  auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); // создание кнопок
+  pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
+  auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
   pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, 
                                                     UIMSG_MainMenu_ShowPartyCreationWnd, 0, 78, "", pNew, 0);
   auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
@@ -12072,7 +12060,7 @@
     POINT pt;
     pMouse->GetCursorPos(&pt);
     pWindow = pWindow_MainMenu;
-    if ( GetCurrentMenuID() == MENU_SAVELOAD)//если меню загрузки
+    if ( GetCurrentMenuID() == MENU_SAVELOAD)
     {
       if ( pCurrentScreen != SCREEN_LOADGAME )
       {
@@ -12080,13 +12068,13 @@
         pTexture_PCX.Load("lsave640.pcx", 0);
         pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
         pCurrentScreen = SCREEN_LOADGAME;
-        GameUI_DrawLoadMenu(0);//процесс прорисовки окна Загрузка
+        GameUI_DrawLoadMenu(0);
       }
       pWindow = pGUIWindow_CurrentMenu;
     }
 
     MSG msg;
-    while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )//ожидание сообщения из внешнего источника
+    while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
     {
       if (msg.message == WM_QUIT)
         Game_DeinitializeAndTerminate(0);
@@ -12103,13 +12091,13 @@
       pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
       if (pAsyncMouse)
         pAsyncMouse->_46B736_consume_click_lists(1);
-      GUI_MainMenuMessageProc();//процедура проверки сообщений поступающих из внешних устройств для всей группы вступительных окон
+      GUI_MainMenuMessageProc();
       GUI_UpdateWindows();
       if (pAsyncMouse)
         pAsyncMouse->_46B736_consume_click_lists(1);
-      if (GetCurrentMenuID() != MENU_MAIN)// если не Главное меню
-      {
-        if (GetCurrentMenuID() == MENU_LOAD)// если меню Загрузка
+      if (GetCurrentMenuID() != MENU_MAIN)
+      {
+        if (GetCurrentMenuID() == MENU_LOADINGPROC)
         {
           pIcons_LOD->_4114F2();
           pGUIWindow_CurrentMenu->Release();
@@ -13977,54 +13965,59 @@
     Log::Warning(L"MM: entering main loop");
     while ( 1 )
     {
-      MainMenu_Loop(); // прорисовка Главного меню и тут же прорисовка меню Загрузка
+      MainMenu_Loop();
       uGameState = 0;
 //LABEL_21:
       while ( 1 )
       {
         switch (uGameState)
         {
-          case GAME_FINISHED: // выход из игры
+          case GAME_FINISHED:
             pGame->Deinitialize();
-            return true; // выход из функции MM_Main в Win_Main
-        }
-        if (GetCurrentMenuID() == MENU_FINISHED) // меню Выход
+            return true;
+        }
+        if (GetCurrentMenuID() == MENU_FINISHED)
         {
           uGameState = GAME_FINISHED;
-          continue; // в начало цикла
-        }
-        if (GetCurrentMenuID() == MENU_NEWGAME)                // меню Новая игра
+          continue;
+        }
+        if (GetCurrentMenuID() == MENU_NEWGAME)
         {
           if ( pAudioPlayer->hAILRedbook )
-            AIL_redbook_stop(pAudioPlayer->hAILRedbook);      // остановить музыку
-          pParty->Reset();                                    // сброс группы
+            AIL_redbook_stop(pAudioPlayer->hAILRedbook);
+          pParty->Reset();
           for (uint k = 0; k < 50; ++k)
             pOtherOverlayList->pOverlays[k].Reset();
-          strcpy(pCurrentMapName, pStartingMapName);         // текущая карта
-          pParty->CreateDefaultParty(0);                     // создать группу по умолчанию
+          strcpy(pCurrentMapName, pStartingMapName);
+          pParty->CreateDefaultParty(0);
           PlayerCreationUI_Initialize();
-          if ( PlayerCreationUI_Loop() )                    //процесс создания группы
+          if ( PlayerCreationUI_Loop() )
           {
             DeleteCCharFont();
-            break;// выход из цикла
+            break;
           }
           DeleteCCharFont();
           bFlashQuestBook = true;
-          pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);       //заставка
-          Autosave();                                       //автосохранение
-          //goto LABEL_48;
-          pGame->Loop(); // процесс игры
-          break; // выход из цикла
-        }
-        if (GetCurrentMenuID() == MENU_CREDITS) // меню Создатели
+          pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);
+          Autosave();
+          pGame->Loop();
+          if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
+          {
+            SetCurrentMenuID(MENU_NEWGAME);
+            uGameState = 0;
+            continue;
+          }
+          break;
+        }
+        if (GetCurrentMenuID() == MENU_CREDITS)
         {
          if ( pAudioPlayer->hAILRedbook )
-          AIL_redbook_stop(pAudioPlayer->hAILRedbook);// отключить звук
+          AIL_redbook_stop(pAudioPlayer->hAILRedbook);
          extern MENU_STATE __cdecl CreditsMenu__Loop();
-         CreditsMenu__Loop(); // процесс воспроизведения окна Создатели
+         CreditsMenu__Loop();
          break;
         }
-        if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOAD) //??? неизвестно что это
+        if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOADINGPROC)
         {
           uGameState = 0;
         }
@@ -14060,7 +14053,7 @@
             pAsyncKeyboard->Resume();
         }*/
 //LABEL_48:
-        pGame->Loop(); //game
+        pGame->Loop();
 LABEL_49:
         if ( uGameState == 3 )
           __debugbreak();
@@ -14071,7 +14064,7 @@
           uGameState = 0;
           continue;
         }*/
-        if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )//press NewGame button out GameMenu window
+        if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
         {
           SetCurrentMenuID(MENU_NEWGAME);
           uGameState = 0;
@@ -14373,10 +14366,11 @@
     case MENU_FINISHED:    return L"MENU_FINISHED";
     case MENU_5:           return L"MENU_5";
     case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
-    case MENU_7:           return L"MENU_7";
-    case MENU_Credits:     return L"MENU_Credits";
-    case MENU_LOAD:        return L"MENU_LOAD";
+    case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC";
+    case MENU_CREDITSPROC: return L"MENU_CREDITSPROC";
+    case MENU_LOADINGPROC: return L"MENU_LOADINGPROC";
     case MENU_10:          return L"MENU_10";
+    case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE";
     default:               return L"unk";
   };
 };
--- a/mm7_3.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_3.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -15616,7 +15616,7 @@
 //----- (00444A51) --------------------------------------------------------
 char *__cdecl TransitionUI_Draw()
 {
-  MapInfo *v0; // esi@5
+  MapInfo *pMapInfo; // esi@5
   char *v1; // eax@6
   char *result; // eax@12
   std::string v3; // [sp-18h] [bp-84h]@11
@@ -15633,31 +15633,19 @@
   v10 = pMapStats->GetMapInfo(pCurrentMapName);
   v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexed(
-    _4E5E50_transui_x - 4,
-    _4E5EE0_transui_y - 4,
-    (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
-  pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pTexture_outside);
   uTextureID_507B04 = uTextureID_right_panel;
-  pRenderer->DrawTextureTransparent(
-    0x1D4u,
-    0,
-    (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
-  pRenderer->DrawTextureIndexed(
-    0x22Cu,
-    0x1C3u,
-    (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
-  pRenderer->DrawTextureIndexed(
-    0x1DCu,
-    0x1C3u,
-    (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
+  pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
+  pRenderer->DrawTextureIndexed(556, 451, (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
+  pRenderer->DrawTextureIndexed(476, 451, (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
   if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
     v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
-  v0 = &pMapStats->pInfos[v10];
+  pMapInfo = &pMapStats->pInfos[v10];
   v8.uFrameX = 493;
   v8.uFrameWidth = 126;
   v8.uFrameZ = 366;
-  v8.DrawTitleText(pFontCreate, 0, 5u, 0, v0->pName, 3u);
+  v8.DrawTitleText(pFontCreate, 0, 5u, 0, pMapInfo->pName, 3);
   v8.uFrameX = 483;
   v8.uFrameWidth = 148;
   v8.uFrameZ = 334;
@@ -15669,9 +15657,11 @@
   {
     if ( v10 )
     {
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
-      v1 = pTmpBuf;
-      goto LABEL_12;
+      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
+      v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf, &v8, 0, 0)) / 2 + 101;
+      result = v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf, 3);
+      dword_5B5924 = 1;
+      return result;
     }
     v1 = "";
   }
@@ -15680,12 +15670,8 @@
     MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0);
     v1 = "";
   }
-LABEL_12:
-  v7 = 3;
-  v6 = v1;
-  v5 = 0;
   v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
-  result = v8.DrawTitleText(pFontCreate, 0, v4, v5, v6, v7);
+  result = v8.DrawTitleText(pFontCreate, 0, v4, 0, v1, 3);
   dword_5B5924 = 1;
   return result;
 }
@@ -15768,7 +15754,7 @@
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
   pRenderer->DrawTextureTransparent(0x1D4u, 0,
     (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
-  pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pTexture_outside);
   pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
     (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
   pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
@@ -16005,15 +15991,9 @@
   GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
   v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(
-    0x1D4u,
-    0,
-    (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
-  pRenderer->DrawTextureIndexed(
-    _4E5E50_transui_x - 4,
-    _4E5EE0_transui_y - 4,
-    (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
-  pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
+  pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
+  pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]);
   v3 = v0->uProfession;
   if ( v3 )
   {
@@ -16987,7 +16967,14 @@
         {
           case EVENT_CheckSeason:
             if ( !sub_4465DF_check_season(_evt->v5) )
-              goto LABEL_291;
+            {
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
+            }
             v11 = _evt->v6;
             goto LABEL_130;
           case EVENT_ShowMovie:
@@ -16998,7 +16985,7 @@
             if ( pVideoPlayer->field_54 )
               pVideoPlayer->Unload();
             pVideoPlayer->bStopBeforeSchedule = 0;
-            pVideoPlayer->field_40 = 0;
+            pVideoPlayer->pResetflag = 0;
             if (pAsyncMouse)
               pAsyncMouse->Suspend();
             v128 = pCurrentScreen;
@@ -17014,16 +17001,47 @@
             {
               pParty->uAlignment = 0;
               v18 = 0;
-LABEL_23:
               LOBYTE(v17) = 1;
               SetUserInterface(v18, v17);
-              goto LABEL_28;
+              if ( !v15 || v128 == 3 )
+              {
+                pCurrentScreen = v128;
+                if ( v128 == 3 )
+                  pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
+                if ( v128 == 13 )
+                  pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
+              }
+              if (pAsyncMouse)
+                pAsyncMouse->Resume();
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             if ( !_strcmpi(v16, "arbiter evil") )
             {
               v18 = 2;
               pParty->uAlignment = 2;
-              goto LABEL_23;
+              LOBYTE(v17) = 1;
+              SetUserInterface(v18, v17);
+              if ( !v15 || v128 == 3 )
+              {
+                pCurrentScreen = v128;
+                if ( v128 == 3 )
+                  pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
+                if ( v128 == 13 )
+                  pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
+              }
+              if (pAsyncMouse)
+                pAsyncMouse->Resume();
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             if ( !_strcmpi(v16, "pcout01") )    // moving to harmondale from emerald isle
             {
@@ -17031,7 +17049,6 @@
               pParty->RestAndHeal();
               pParty->field_764 = 0;
             }
-LABEL_28:
             if ( !v15 || v128 == 3 )
             {
               pCurrentScreen = v128;
@@ -17042,7 +17059,12 @@
             }
             if (pAsyncMouse)
               pAsyncMouse->Resume();
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_CheckSkill:
             v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
             if ( v127 < 0 )
@@ -17074,9 +17096,15 @@
                   {
                     ++v20;
                     if ( v20 >= 4 )
-                      goto LABEL_291;
+                    {
+                      ++v122;
+                      //v4 = v124;
+                      //v5 = pSomeEVT;
+                      //v6 = v123;
+                      //v7 = "";
+                      break;
+                    }
                   }
-LABEL_50:
                   v11 = _evt->v11;
                   goto LABEL_130;
                 }
@@ -17090,8 +17118,16 @@
             v138 = v24 & 0x80;
             v139 = v24 & 0x100;
             if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
-              goto LABEL_50;
-            goto LABEL_291;
+            {
+              v11 = _evt->v11;
+              goto LABEL_130;
+            }
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SpeakNPC:
             if ( a3 )
             {
@@ -17109,7 +17145,12 @@
               bDialogueUI_InitializeActor_NPC_ID = _evt->v5
                                                  + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ChangeEvent:
             v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
             if ( v25 )
@@ -17122,13 +17163,23 @@
               stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0;
               LOBYTE(v26->field_2) |= 0x20u;
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetNPCGreeting:
             v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
             pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
             pNPCStats->pNewNPCData[v27].greet = v28;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetNPCTopic:
             v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
@@ -17196,26 +17247,47 @@
                 }
               }
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_NPCSetItem:
-            sub_448518_npc_set_item(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-              _evt->v13);
-            goto LABEL_291;
+            sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetActorItem:
-            Actor::GiveItem(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-              _evt->v13);
-            goto LABEL_291;
+            Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetNPCGroupNews:
             pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetActorGroup:
             __debugbreak();
             *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ChangeGroup:
             v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
@@ -17226,14 +17298,19 @@
               v41 = pActors;//[0].uGroup;
               do
               {
-				if ( v41->uGroup == v38 )
-				  v41->uGroup = v39;
+                if ( v41->uGroup == v38 )
+                v41->uGroup = v39;
                 ++v41;
                 --v40;
               }
               while ( v40 );
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ChangeGroupAlly:
             v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
@@ -17244,14 +17321,19 @@
               v45 = pActors;//[0].uAlly;
               do
               {
-				if ( v45->uGroup == v42 )
-				  v45->uAlly = v43;
+                if ( v45->uGroup == v42 )
+                v45->uAlly = v43;
                 ++v45;
                 --v44;
               }
               while ( v44 );
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_MoveNPC:
             pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].house = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
             if ( ptr_507BC0 )
@@ -17292,11 +17374,21 @@
                   pVideoPlayer->bLoopPlaying = 0;
               }
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_Jmp:
             //v124 = -1;
             v122 = _evt->v5 - 1;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ShowFace:
             v50 = _evt->v5;
             if ( (unsigned __int8)v50 <= 3u )
@@ -17304,25 +17396,41 @@
               v117 = 0;
               v113 = _evt->v6;
               v53 = (unsigned __int8)v50;
-              goto LABEL_108;
+              v52 = &pParty->pPlayers[v53];
+              v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             if ( v50 == 4 )
             {
               v117 = 0;
               v113 = _evt->v6;
               v52 = pPlayers[uActiveCharacter];
-              goto LABEL_109;
+              v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             if ( v50 != 5 )
             {
               v117 = 0;
               v113 = _evt->v6;
               v53 = rand() % 4;
-LABEL_108:
               v52 = &pParty->pPlayers[v53];
-LABEL_109:
               v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
-              goto LABEL_291;
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             v51 = pParty->pPlayers;
             do
@@ -17331,7 +17439,7 @@
               ++v51;
             }
             while ( (signed int)v51 < (signed int)pParty->pHirelings );
-LABEL_291:
+//LABEL_291:
             ++v122;
             //v4 = v124;
             //v5 = pSomeEVT;
@@ -17363,7 +17471,12 @@
               v56 = &pParty->pPlayers[v57];
 LABEL_120:
               v56->PlaySound(v114, v118);
-              goto LABEL_291;
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             v55 = pParty->pPlayers;
             do
@@ -17372,22 +17485,33 @@
               ++v55;
             }
             while ( (signed int)v55 < (signed int)pParty->pHirelings );
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ForPartyMember:
             v127 = _evt->v5;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SummonItem:
-            sub_42F7EB_DropItemAt(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+            sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
               _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
               _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
               _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
               _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
-              _evt->v25,
-              _evt->v26,
-              0,
-              0);
-            goto LABEL_291;
+              _evt->v25, _evt->v26, 0, 0);
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
           case EVENT_Compare:
             v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
             if ( v127 == 5 )
@@ -17396,16 +17520,20 @@
               v59 = pParty->pPlayers;
               while ( 1 )
               {
-                LOBYTE(v60) = v59->CompareVariable(
-                                (enum VariableType)(_evt->v5
-                                                  + ((uint)_evt->v6 << 8)),
-                                v58);
+                LOBYTE(v60) = v59->CompareVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v58);
                 if ( v60 )
                   break;
                 ++v130;
                 ++v59;
                 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
-                  goto LABEL_291;
+                {
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
+                }
               }
 LABEL_129:
               v11 = _evt->v11;
@@ -17442,7 +17570,12 @@
 LABEL_140:
             if ( v62 )
               goto LABEL_129;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_IsActorAlive:
             v62 = IsActorAlive(
                     _evt->v5,
@@ -17457,7 +17590,12 @@
               if ( (void *)pParty->pPickedItem.uItemID == v63 )
               {
                 pMouse->RemoveHoldingItem();
-                goto LABEL_291;
+                ++v122;
+                //v4 = v124;
+                //v5 = pSomeEVT;
+                //v6 = v123;
+                //v7 = "";
+                break;
               }
               v65 = 0;
               v66 = pPlayers[uActiveCharacter];
@@ -17467,7 +17605,12 @@
                 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
                 {
                   v66->RemoveItemAtInventoryIndex(v65);
-                  goto LABEL_291;
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
                 }
                 ++v65;
                 v67 += 4;
@@ -17480,7 +17623,12 @@
                 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
                 {
                   *(&v66->pEquipment.uOffHand + v68) = 0;
-                  goto LABEL_291;
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
                 }
                 ++v68;
                 v69 += 4;
@@ -17522,7 +17670,14 @@
 LABEL_170:
                 v125 += 4;
                 if ( v125 > (signed int)&pPlayers[4] )
-                  goto LABEL_291;
+                {
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
+                }
               }
             }
             v75 = v127;
@@ -17537,10 +17692,13 @@
                   if ( v127 == 6 )
                     goto LABEL_180;
 LABEL_183:
-                  ((Player *)v6)->SubtractVariable(
-                    (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
-                    v63);
-                  goto LABEL_291;
+                  ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63);
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
                 }
                 if ( uActiveCharacter )
                 {
@@ -17566,7 +17724,12 @@
               ++v76;
             }
             while ( (signed int)v76 < (signed int)pParty->pHirelings );
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_Set:
             v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
             v78 = v127;
@@ -17581,10 +17744,13 @@
                   if ( v127 == 6 )
                     goto LABEL_194;
 LABEL_197:
-                  ((Player *)v6)->SetVariable(
-                    (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
-                    v77);
-                  goto LABEL_291;
+                  ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77);
+                  ++v122;
+                  //v4 = v124;
+                  //v5 = pSomeEVT;
+                  //v6 = v123;
+                  //v7 = "";
+                  break;
                 }
                 if ( uActiveCharacter )
                 {
@@ -17610,7 +17776,12 @@
               ++v79;
             }
             while ( (signed int)v79 < (signed int)pParty->pHirelings );
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_Add:
             v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
             v81 = v127;
@@ -17658,7 +17829,12 @@
             v83 = _evt->v5 + ((uint)_evt->v6 << 8);
             if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
               viewparams->bRedrawGameUI = 1;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_InputString:
             if ( !dword_597F18 )
             {
@@ -17690,16 +17866,15 @@
 LABEL_131:
               v122 = v11 - 1;
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_RandomGoTo:
             //v124 = -1;
-            v11 = (unsigned __int8)*(&_evt->v5
-                                   + rand()
-                                   % ((_evt->v5 != 0)
-                                    + (_evt->v6 != 0)
-                                    + (_evt->v7 != 0)
-                                    + (_evt->v8 != 0)
-                                    + (_evt->v9 != 0)
+            v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
                                     + (_evt->v10 != 0)));
             goto LABEL_131;
           case EVENT_ReceiveDamage:
@@ -17715,7 +17890,14 @@
             if ( v86 == 4 )
             {
               if ( !uActiveCharacter )
-                goto LABEL_291;
+              {
+                ++v122;
+                //v4 = v124;
+                //v5 = pSomeEVT;
+                //v6 = v123;
+                //v7 = "";
+                break;
+              }
               v119 = _evt->v6;
               v88 = pPlayers[uActiveCharacter];
               v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
@@ -17730,7 +17912,12 @@
               v88 = &pParty->pPlayers[v89];
 LABEL_234:
               v88->ReceiveDamage(v115, v119);
-              goto LABEL_291;
+              ++v122;
+              //v4 = v124;
+              //v5 = pSomeEVT;
+              //v6 = v123;
+              //v7 = "";
+              break;
             }
             v87 = pParty->pPlayers;
             do
@@ -17739,53 +17926,92 @@
               ++v87;
             }
             while ( (signed int)v87 < (signed int)pParty->pHirelings );
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ToggleIndoorLight:
             pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetFacesBit:
-            sub_44892E_set_faces_bit(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-              _evt->v13);
-            goto LABEL_291;
+            sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ToggleChestFlag:
-            Chest::ToggleFlag(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-              _evt->v13);
-            goto LABEL_291;
+            Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ToggleActorFlag:
-            Actor::ToggleFlag(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-              _evt->v13);
-            goto LABEL_291;
+            Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
+              _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ToggleActorGroupFlag:
             ToggleActorGroupFlag(
               _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
               _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
               _evt->v13);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetSnow:
             if ( !_evt->v5 )
               pWeather->bRenderSnow = _evt->v6 != 0;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_StatusText:
             v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             if ( _5C3420_pDecoration )
             {
               if ( _5C3420_pDecoration == (LevelDecoration *)1 )
               {
-				  ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
-                goto LABEL_291;
+                ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
+                ++v122;
+                //v4 = v124;
+                //v5 = pSomeEVT;
+                //v6 = v123;
+                //v7 = "";
+                break;
               }
               if ( a3 == 1 )
               {
                 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
-LABEL_248:
+//LABEL_248:
                 ShowStatusBarString(v91, 2u);
-                goto LABEL_291;
+                ++v122;
+                //v4 = v124;
+                //v5 = pSomeEVT;
+                //v6 = v123;
+                //v7 = "";
+                break;
               }
             }
             else
@@ -17793,10 +18019,21 @@
               if ( a3 == 1 )
               {
                 v91 = &pLevelStr[pLevelStrOffsets[v90]];
-                goto LABEL_248;
-              }
-            }
-            goto LABEL_291;
+                ShowStatusBarString(v91, 2u);
+                ++v122;
+                //v4 = v124;
+                //v5 = pSomeEVT;
+                //v6 = v123;
+                //v7 = "";
+                break;
+              }
+            }
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ShowMessage:
             v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             if ( _5C3420_pDecoration )
@@ -17809,50 +18046,80 @@
             {
               strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_CastSpell:
-            sub_448DF8_cast_spell(
-              _evt->v5,
-              _evt->v6,
-              _evt->v7,
-              _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
+            sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
               _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
               _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
               _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
               _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
               _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetTexture:
             sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SetSprite:
-            SetDecorationSprite(
-              _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-              _evt->v9,
-              (char *)&_evt->v10);
-            goto LABEL_291;
+            SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10);
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SummonMonsters:
-            sub_448CF4_spawn_monsters(
-              _evt->v5,
-              _evt->v6,
-              _evt->v7,
+            sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,
               _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
               _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
               _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
               _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
               _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_MouseOver:
           case EVENT_LocationName:
             --v122;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_ChangeDoorState:
             sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_OpenChest:
             if ( !Chest::Open(_evt->v5) )
               goto LABEL_301;
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_MoveToMap:
             v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
@@ -17867,16 +18134,7 @@
             {
               if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
                 pRenderer->_49FD3A();
-              sub_444839_move_map(
-                _evt->v29,
-                _evt->v30,
-                v135,
-                v132,
-                v126,
-                v129,
-                v95,
-                v134,
-                (char *)&_evt->v31);
+              sub_444839_move_map(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31);
               dword_5C3418 = uEventID;
               dword_5C341C = v122 + 1;
               goto LABEL_301;
@@ -17958,7 +18216,12 @@
                 goto LABEL_302;
               }
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_PlaySound:
             v120 = 0;
             v116 = 0;
@@ -17978,7 +18241,12 @@
             if ( v102 )
               item.uItemID = v102;
             pParty->SetHoldingItem(&item);
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_SpeakInHouse:
             v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
             if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) )
@@ -17997,7 +18265,12 @@
               ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
               ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
             }
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
           case EVENT_PressAnyKey:
             v121 = 33;
             v105 = v122 + 1;
@@ -18005,7 +18278,12 @@
           case EVENT_Exit:
             goto LABEL_301;
           default:
-            goto LABEL_291;
+            ++v122;
+            //v4 = v124;
+            //v5 = pSomeEVT;
+            //v6 = v123;
+            //v7 = "";
+            break;
         }
       }
       //++v4;
--- a/mm7_4.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_4.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -5450,7 +5450,7 @@
           {
             pGUIWindow_CurrentMenu->field_40 = 0;
             pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0);
-            SetCurrentMenuID(MENU_7);
+            SetCurrentMenuID(MENU_NAMEPANELESC);
           }
         }
         else
@@ -6208,7 +6208,7 @@
   pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr);
   pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, "", 0);
   pCurrentScreen = SCREEN_CREATORS;
-  SetCurrentMenuID(MENU_Credits);
+  SetCurrentMenuID(MENU_CREDITSPROC);
   do
   {
     while ( PeekMessageA(&Msg, 0, 0, 0, 1) )
@@ -6240,7 +6240,7 @@
       GUI_MainMenuMessageProc();
     }
   }
-  while ( GetCurrentMenuID() == MENU_Credits );
+  while ( GetCurrentMenuID() == MENU_CREDITSPROC );
   pAudioPlayer->_4AA258(1);
   pAllocator->FreeChunk(ptr);
   pAllocator->FreeChunk(pFontQuick);
@@ -11082,42 +11082,19 @@
 {
   NPCData *v0; // ST40_4@1
   signed int v1; // edi@1
-  GUIWindow *v2; // ecx@1
+  //GUIWindow *v2; // ecx@1
 
   v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
   v1 = 0;
   pDialogueWindow->eWindowType = WINDOW_MainMenu;
   pDialogueWindow->Release();
-  v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_A, 1, 0);
-  pDialogueWindow = v2;
+  pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0);
   if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) )
   {
-    v2->CreateButton(
-      0x1E0u,
-      0xA0u,
-      0x8Cu,
-      0x1Eu,
-      1,
-      0,
-      0x88u,
-      0x4Du,
-      0,
-      pGlobalTXT_LocalizationStrings[407],
-      0);
+    pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, 136, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);
     v1 = 1;
   }
-  pDialogueWindow->CreateButton(
-    0x1E0u,
-    30 * v1 + 160,
-    0x8Cu,
-    0x1Eu,
-    1,
-    0,
-    0x88u,
-    0x4Cu,
-    0,
-    pGlobalTXT_LocalizationStrings[406],
-    0);
+  pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять
   pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1);
 }
 
@@ -11311,8 +11288,8 @@
                    (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
                    0);
     pDialogueWindow->CreateButton(
-      _4E5E50_transui_x,
-      _4E5EE0_transui_y,
+      pNPCPortraits_x,
+      pNPCPortraits_y,
       63u,
       73u,
       1,
--- a/mm7_5.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_5.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -753,7 +753,7 @@
           v130 = 0;
           v127 = 219;
           goto _play_sound_and_continue;
-        case 0x1A0:
+        case UIMSG_1A0:
           dword_506F08 = v0;
           continue;
         case UIMSG_1A1:
@@ -3790,25 +3790,25 @@
       pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex);
       switch (pUIMessageType) // For buttons of window MainMenu
       {
-        case UIMSG_MainMenu_ShowPartyCreationWnd:// Окно создания группы
+        case UIMSG_MainMenu_ShowPartyCreationWnd:
         {
           GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
           SetCurrentMenuID(MENU_NEWGAME);
         }
         continue;
-        case UIMSG_MainMenu_ShowLoadWindow:// Окно Загрузка
+        case UIMSG_MainMenu_ShowLoadWindow:
         {
           GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0);
           SetCurrentMenuID(MENU_SAVELOAD);
         }
         continue;
-        case UIMSG_ShowCredits:// Окно Создатели
+        case UIMSG_ShowCredits:
         {
           GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0);
           SetCurrentMenuID(MENU_CREDITS);
         }
         continue;
-        case UIMSG_ExitToWindows:// Окно Выход
+        case UIMSG_ExitToWindows:
         {
           GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
           SetCurrentMenuID(MENU_FINISHED);
@@ -3818,14 +3818,14 @@
 
       switch (pUIMessageType) // For buttons of window LoadGame
       {
-        case UIMSG_LoadGame:// Процесс загрузки
+        case UIMSG_LoadGame:
         {
           if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
             continue;
-          SetCurrentMenuID(MENU_LOAD);
-          continue;
-        }
-        case UIMSG_SelectLoadSlot:   // Выбранный слот сохранёнки
+          SetCurrentMenuID(MENU_LOADINGPROC);
+          continue;
+        }
+        case UIMSG_SelectLoadSlot:
         {
             //main menu save/load wnd   clicking on savegame lines
           if (pGUIWindow_CurrentMenu->field_40 == 1)
@@ -3851,12 +3851,12 @@
           }
           continue;
         }
-        case UIMSG_LoadSlot: // Нажатие на слот в окне Загрузка
+        case UIMSG_LoadSlot:
         {
           GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0);
         continue;
         }
-        case UIMSG_DownArrow://нажатие стрелки вниз
+        case UIMSG_DownArrow:
         {
           ++pSaveListPosition;
           if ( pSaveListPosition >= uNum )
@@ -3864,23 +3864,21 @@
           if ( pSaveListPosition < 1 )
             pSaveListPosition = 0;
           pWindow = pGUIWindow_CurrentMenu;
-          v8 = pGUIWindow_CurrentMenu->uFrameY + 323;
-          GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
-          continue;
-        }
-        case UIMSG_Cancel:// Нажатие кнопки Отмена
+          GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
+          continue;
+        }
+        case UIMSG_Cancel:
         {
           GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0);
           continue;
         }
-        case UIMSG_ArrowUp:// Кнопка Вверх
+        case UIMSG_ArrowUp:
         {
           --pSaveListPosition;
           if ( pSaveListPosition < 0 )
             pSaveListPosition = 0;
           pWindow = pGUIWindow_CurrentMenu;
-          v8 = pGUIWindow_CurrentMenu->uFrameY + 197;
-          GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
+          GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
           continue;
         }
       }
@@ -3889,7 +3887,7 @@
       {
         if ( pUIMessageType > UIMSG_DownArrow )
         {
-          if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) // Выбор лица персонажа кнопка назад
+          if ( pUIMessageType == UIMSG_SelectFacePlayerBack )
           {
             pPlayer = &pParty->pPlayers[uNum];
             v12 = (char)((int)pPlayer->uFace - 1) < 0;
@@ -3912,7 +3910,7 @@
             //v1 = (char *)pParty->pPlayers;
             continue;
           }
-          if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) // выбор лица персонажа кнопка вперёд
+          if ( pUIMessageType == UIMSG_SelectFacePlayerForward )
           {
             pPlayer = &pParty->pPlayers[uNum];
             v20 = (char)((int)pPlayer->uFace + 1) % 20;
@@ -3937,7 +3935,7 @@
           {
             __debugbreak();
             GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
-            SetCurrentMenuID(MENU_LOAD);
+            SetCurrentMenuID(MENU_LOADINGPROC);
             continue;
           }
           if ( pUIMessageType != UIMSG_AE )//unknow
@@ -3946,11 +3944,7 @@
             continue;
           }
           GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
-//LABEL_114:
-          v40 = 10;
-//LABEL_89:
-          v2 = v40;
-          SetCurrentMenuID((MENU_STATE)v2);
+          SetCurrentMenuID(MENU_10);
           continue;
         }
         if ( pUIMessageType == UIMSG_6B )//unknow
@@ -3967,7 +3961,6 @@
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
-          //goto LABEL_93;
           pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
           *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
           ++pMessageQueue_50CBD0->uNumMessages;
@@ -3986,26 +3979,19 @@
           pVideoPlayer->bStopBeforeSchedule = 1;
           viewparams->bRedrawGameUI = 1;
           viewparams->field_48 = 1;
-          if ( !GetCurrentMenuID() || GetCurrentMenuID() == 6 || GetCurrentMenuID() == 7 )
-          {
-            v17 = pCurrentScreen;
+          if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC )
+          {
 LABEL_83:
-            if ( v17 == 16 )
-              pVideoPlayer->FastForwardToFrame(pVideoPlayer->field_40);
-            if (GetCurrentMenuID() == MENU_7)
-            {
-              v40 = 6;
-              //goto LABEL_89;
-              v2 = v40;
-              SetCurrentMenuID((MENU_STATE)v2);
+            if ( pCurrentScreen == SCREEN_VIDEO )
+              pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
+            if (GetCurrentMenuID() == MENU_NAMEPANELESC)
+            {
+              SetCurrentMenuID(MENU_CREATEPARTY);
               continue;
             }
-            if (GetCurrentMenuID() == MENU_Credits)
-            {
-              v40 = 11;
-              //goto LABEL_89;
-              v2 = v40;
-              SetCurrentMenuID((MENU_STATE)v2);
+            if (GetCurrentMenuID() == MENU_CREDITSPROC)
+            {
+              SetCurrentMenuID(MENU_CREDITSCLOSE);
               continue;
             }
             if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
@@ -4020,7 +4006,6 @@
             continue;
           }
           v16 = GetCurrentMenuID() == 8;
-          v17 = pCurrentScreen;
           if ( v16 && !pCurrentScreen )
             goto LABEL_83;
           if ( pCurrentScreen == SCREEN_LOADGAME )
@@ -4095,9 +4080,8 @@
             do
             {
               pCurrentPlayer->uVoiceID = (signed int)(pCurrentPlayer->uVoiceID + 1) % 20;
-              v10 = pCurrentPlayer->GetSexByVoice();
-            }
-            while ( v10 != pSex );
+            }
+            while ( pCurrentPlayer->GetSexByVoice() != pSex );
             pButton = pCreationUI_BtnPressRight2[uNum];
             GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1);
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
@@ -4111,12 +4095,11 @@
         if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill )
         {
           uPlayerCreationUI_SelectedCharacter = uNum;
-          v41 = 3;
+          //v41 = 3;
           //v1 = (char *)pParty->pPlayers;
-          v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
+          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
              + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
-          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
-          pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
+          pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3)
                                              + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
           continue;
         }
@@ -4203,9 +4186,7 @@
               break;
             case UIMSG_3A://unknow
               __debugbreak();
-              v40 = 10;
-              v2 = v40;
-              SetCurrentMenuID((MENU_STATE)v2);
+              SetCurrentMenuID(MENU_10);
               break;
           }
         }
@@ -15528,7 +15509,7 @@
           }
           continue;
         }
-        if ( pWindowType != 10 )
+        if ( pWindowType != 10 ) //pWindowType == 10
         {
           v2 = pWindowType - 3;
           if ( v2 )//pWindowType > 3
--- a/mm7_data.cpp	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_data.cpp	Thu Feb 14 14:48:43 2013 +0600
@@ -736,9 +736,9 @@
 char aBardataC[10]; // weak
 char aLoadprog[777]; // idb
 char aLoadingD_pcx[777]; // idb
-int _4E5E50_transui_x; // idb
+int pNPCPortraits_x = 521; // idb
 int dword_4E5EC8[777]; // weak
-int _4E5EE0_transui_y; // idb
+int pNPCPortraits_y = 38; // idb
 const char *pHouse_ExitPictures[11];
 char *_4E6BDC_loc_names[11];
 char aOutside[777]; // idb
--- a/mm7_data.h	Thu Feb 14 09:27:19 2013 +0600
+++ b/mm7_data.h	Thu Feb 14 14:48:43 2013 +0600
@@ -683,9 +683,9 @@
 extern char aBardataC[10]; // weak
 extern char aLoadprog[]; // idb
 extern char aLoadingD_pcx[]; // idb
-extern int _4E5E50_transui_x; // idb
+extern int pNPCPortraits_x; // idb
 extern int dword_4E5EC8[]; // weak
-extern int _4E5EE0_transui_y; // idb
+extern int pNPCPortraits_y; // idb
 extern const char *pHouse_ExitPictures[11];
 extern char *_4E6BDC_loc_names[11];
 extern char aOutside[]; // idb