changeset 975:e875f5ab0cfb

Слияние
author Ritor1
date Wed, 08 May 2013 17:36:45 +0600
parents 8a6b995a84a5 (current diff) 35f2e900618e (diff)
children 15c6b80caa3a
files UIPartyCreation.cpp mm7_5.cpp
diffstat 3 files changed, 269 insertions(+), 356 deletions(-) [+]
line wrap: on
line diff
--- a/UIPartyCreation.cpp	Wed May 08 17:36:19 2013 +0600
+++ b/UIPartyCreation.cpp	Wed May 08 17:36:45 2013 +0600
@@ -134,95 +134,45 @@
 //----- (00495B39) --------------------------------------------------------
 void __cdecl PlayerCreationUI_Draw()
 {
-  //const char *uTitleText; // ST10_4@3
   int pTextCenter; // eax@3
-  IconFrame *v3; // eax@3
+  IconFrame *pFrame; // eax@3
   int pX; // ecx@7
   GUIButton *uPosActiveItem; // edi@12
-  int v6; // esi@14
   int uNumLet; // eax@14
   char v8; // al@17
   int v9; // ecx@17
   char v10; // sf@17
-  int v11; // ecx@19
-  void *v12; // eax@20
-  int v13; // ecx@21
-  int v14; // ecx@22
-  char *v15; // ST14_4@24
   size_t v16; // eax@28
   int v17; // eax@33
-  //enum CHARACTER_RACE uNumRace; // eax@35
-  int v19; // eax@36
-  int v20; // eax@37
-  int uNumMight; // eax@44
-  unsigned int v24; // eax@44
-  int v25; // eax@44
-  unsigned int v26; // eax@44
-  int v27; // eax@44
-  unsigned int v28; // eax@44
-  int v29; // eax@44
-  unsigned int v30; // eax@44
-  int v31; // eax@44
-  unsigned int v32; // eax@44
-  int v33; // eax@44
-  unsigned int v34; // eax@44
-  int v35; // eax@44
-  unsigned int v36; // eax@44
-  PLAYER_SKILL_TYPE v37; // eax@44
-  PLAYER_SKILL_TYPE v39; // eax@44
-  PLAYER_SKILL_TYPE v41; // eax@44
-  const char *v42; // edx@44
-  char *v43; // ST1C_4@44
-  int v45; // eax@44
-  PLAYER_SKILL_TYPE v46; // eax@46
-  const char *v47; // edx@46
-  char *v48; // ST1C_4@46
-  int v50; // eax@46
+  int uStatLevel; // eax@44
+  unsigned int pStatColor; // eax@44
+  PLAYER_SKILL_TYPE pSkillsType; // eax@44
   int v51; // eax@49
   char *v52; // edi@52
   char v53; // al@52
   PLAYER_CLASS_TYPE uClassType; // edi@53
-  int v55; // ST0C_4@53
-  int v57; // eax@53
-  int v61; // ecx@55
-  int v64; // ST08_4@57
-  int v66; // ecx@57
-  int v71; // eax@59
-  int v75; // eax@61
-  int v80; // eax@63
-  int v85; // eax@65
-  int v89; // eax@67
-  int v94; // eax@69
+  int pColorText; // eax@53
   PLAYER_SKILL_TYPE pSkillId; // edi@72
   size_t pLenText; // eax@72
   signed int v104; // ecx@72
-  int pColorText; // ecx@79
-  unsigned int v107; // ST0C_4@81
   int pTextY; // ST08_4@81
-  int v111; // ST0C_4@82
-  signed int v113; // edi@82
-  int v114; // ST0C_4@82
+  signed int pBonusNum; // edi@82
   const char *uRaceName; // [sp+0h] [bp-170h]@39
   char pText[200]; // [sp+10h] [bp-160h]@14
   GUIWindow pWindow; // [sp+D8h] [bp-98h]@83
-  int v119; // [sp+12Ch] [bp-44h]@18
   size_t v120; // [sp+130h] [bp-40h]@25
-  int uY; // [sp+134h] [bp-3Ch]@18
-  int v122; // [sp+138h] [bp-38h]@18
-  int v123; // [sp+13Ch] [bp-34h]@11
-  void *v124; // [sp+140h] [bp-30h]@18
   int uColor1; // [sp+144h] [bp-2Ch]@1
   int v126; // [sp+148h] [bp-28h]@25
   int uColorGreen; // [sp+14Ch] [bp-24h]@1
-  int v128; // [sp+150h] [bp-20h]@14
-  int v129; // [sp+154h] [bp-1Ch]@18
+  int pIntervalY; // [sp+150h] [bp-20h]@14
+  int pX_Numbers; // [sp+154h] [bp-1Ch]@18
   int uColorTeal; // [sp+158h] [bp-18h]@1
   int uColorWhite; // [sp+15Ch] [bp-14h]@1
   int uX; // [sp+160h] [bp-10h]@18
   unsigned int v133; // [sp+164h] [bp-Ch]@25
   int pOrder; // [sp+168h] [bp-8h]@14
-  //char *Str; // [sp+16Ch] [bp-4h]@18
-  //Player *pPlayer;
+  int pIntervalX;
+  int pCorrective;
   const char *pSkillName;
 
   uColor1 = TargetColor(0xD1, 0xBB, 0x61);
@@ -234,10 +184,7 @@
   uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
   pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
   pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY);
-  //if (uPlayerCreationUI_SkySliderPos > 640)
-    //uPlayerCreationUI_SkySliderPos = 0;
   pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP);
-  //uTitleText = pGlobalTXT_LocalizationStrings[51];
   uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7;
   pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]);
   pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);
@@ -245,7 +192,7 @@
   pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uFace]);
   pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uFace]);
   pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uFace]);
-  v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
+  pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
   switch ( uPlayerCreationUI_SelectedCharacter )
   {
     case 0:
@@ -261,19 +208,16 @@
       pX = 488;
       break;
     default:
-      pX = v123;
+      assert(false);//if click "Knight" crash
+      //pX = v123;
       break;
   }
 
-  pRenderer->DrawTextureTransparent(pX, 29, &pIcons_LOD->pTextures[v3->uTextureID]);
+  pRenderer->DrawTextureTransparent(pX, 29, &pIcons_LOD->pTextures[pFrame->uTextureID]);
   uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem);
   uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25;
   pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]);
   pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]);
-  //if (uPlayerCreationUI_ArrowAnim < 0)
-  //  uPlayerCreationUI_ArrowAnim = 18;
-  v6 = pFontCreate->uFontHeight - 2;
-  v128 = pFontCreate->uFontHeight - 2;
   memset(pText, 0, 200);
   strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills"
   uNumLet = strlen(pText) - 1;
@@ -291,43 +235,29 @@
       uNumLet = pOrder;
     }
   }
-  pOrder = 18;
-  v124 = 0;
+
+  pIntervalX = 18;
+  pIntervalY = pFontCreate->uFontHeight - 2;
+  //v124 = 0;
   uX = 32;
-  uY = 3 * v6 + 169;
-  v122 = 5 * v6 + 169;
-  v123 = 3 * v6 + 311;
-  v129 = 493;
-  //pPlayer = pParty->pPlayers;
-  v119 = 6 * v6 + 169;
-  //do
+  pX_Numbers = 493;
 
-  //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++)
   for (int i = 0; i < 4; ++i)
   {
     auto player = pParty->pPlayers + i;
 
-    //Str = pPlayer->pName;
-	pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
-    pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
-    v11 = pGUIWindow_CurrentMenu->field_40;
-    if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) )
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
+    pRenderer->DrawTextureTransparent(pIntervalX + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
+
+    if ( pGUIWindow_CurrentMenu->field_40 && pGUIWindow_CurrentMenu->ptr_1C == (void *)i )
     {
-      v13 = v11 - 1;
-      if ( v13 )
+      switch ( pGUIWindow_CurrentMenu->field_40 )
       {
-        v14 = v13 - 1;
-        if ( v14 )
-        {
-          if ( v14 == 1 )
-          {
-            pGUIWindow_CurrentMenu->field_40 = 0;
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0);
-            SetCurrentMenuID(MENU_NAMEPANELESC);
-          }
-        }
-        else
-        {
+        case 1://press name panel
+          v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
+          pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
+          break;
+        case 2: // press enter
           pGUIWindow_CurrentMenu->field_40 = 0;
           v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
           v126 = 0;
@@ -345,89 +275,102 @@
           }
           if ( v120 && v126 != v120 )
             strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer);
-          pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
-          *(short *)&player->field_1988[27] = 1; //
-        }
-      }
-      else
-      {
-        v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
-        pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
+          pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
+          *(short *)&player->field_1988[27] = 1;
+          break;
+        case 3: // press escape
+          pGUIWindow_CurrentMenu->field_40 = 0;
+          pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
+          SetCurrentMenuID(MENU_NAMEPANELESC);
+          break;
       }
     }
     else
     {
-      pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
+      pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
     }
+
     switch (player->GetRace())
     {
-      case 0:  uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"       
+      case 0:  uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
       case 1:  uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
       case 2:  uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
-	  case 3:  uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"   
+      case 3:  uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
     }; 
-	strcpy(pTmpBuf, uRaceName);
-    pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0);
-    pTextCenter = pFontCreate->AlignText_Center(0x96, pText);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0);
-    uNumMight = player->GetActualMight();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might"
-    LOWORD(v24) = player->GetStatColor(0);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0);
-    v25 = player->GetActualIntelligence();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect"
-    LOWORD(v26) = player->GetStatColor(1);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0);
-    v27 = player->GetActualWillpower();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality"
-    LOWORD(v28) = player->GetStatColor(2);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0);
-    v29 = player->GetActualEndurance();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance"
-    LOWORD(v30) = player->GetStatColor(3);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0);
-    v31 = player->GetActualAccuracy();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy"
-    LOWORD(v32) = player->GetStatColor(4);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0);
-    v33 = player->GetActualSpeed();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed"
-    LOWORD(v34) = player->GetStatColor(5);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0);
-    v35 = player->GetActualLuck();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck"
-    LOWORD(v36) = player->GetStatColor(6);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0);
-    v37 = player->GetSkillIdxByOrder(0);
-    pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]);
+    strcpy(pTmpBuf, uRaceName);
+    pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf, 130, 0);//Race Name
+
+    pTextCenter = pFontCreate->AlignText_Center(150, pText);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills
+
+    uStatLevel = player->GetActualMight();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
+    pStatColor = player->GetStatColor(0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualIntelligence();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
+    pStatColor = player->GetStatColor(1);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualWillpower();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
+    pStatColor = player->GetStatColor(2);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualEndurance();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
+    pStatColor = player->GetStatColor(3);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualAccuracy();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
+    pStatColor = player->GetStatColor(4);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualSpeed();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
+    pStatColor = player->GetStatColor(5);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+    uStatLevel = player->GetActualLuck();
+    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
+    pStatColor = player->GetStatColor(6);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+
+
+    pSkillsType = player->GetSkillIdxByOrder(0);
+    pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0);
-    v39 = player->GetSkillIdxByOrder(1);
-    pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0);
-    v41 = player->GetSkillIdxByOrder(2);
-    pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]);
-    v45 = uColorGreen;
-    if ( (signed int)v41 >= 37 )
-      v45 = uColorTeal;
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0);
-    v46 = player->GetSkillIdxByOrder(3);
-    pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]);
-    v50 = uColorGreen;
-    if ( (signed int)v46 >= 37 )
-      v50 = uColorTeal;
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0);
-    //pPlayer++;
-    v124 = (char *)v124 + 1;
-    pOrder += 159;
-    v129 -= 158;
+
+    pSkillsType = player->GetSkillIdxByOrder(1);
+    pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf, 0, 0, 0);
+
+    pSkillsType = player->GetSkillIdxByOrder(2);
+    pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    pColorText = uColorGreen;
+    if ( (signed int)pSkillsType >= 37 )
+      pColorText = uColorTeal;
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0);
+
+    pSkillsType = player->GetSkillIdxByOrder(3);
+    pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    pColorText = uColorGreen;
+    if ( (signed int)pSkillsType >= 37 )
+      pColorText = uColorTeal;
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0);
+
+    //v124 = (char *)v124 + 1;
+    pIntervalX += 159;
+    pX_Numbers -= 158;
     uX += 158;
   }
 
-  //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges );
   strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
   v51 = strlen(pText) - 1;
   pOrder = v51;
@@ -445,102 +388,107 @@
     }
   }
   uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
-  pTextCenter = pFontCreate->AlignText_Center(193u, pText);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);
-  v57 = uColorTeal;
+  pTextCenter = pFontCreate->AlignText_Center(193, pText);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);//Classes
+
+  pColorText = uColorTeal;
   if ( uClassType )
-    v57 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0);
-  v61 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_PALADIN )
-    v61 = uColorWhite;
-  uColorGreen = v128 + 417;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0);
-  v66 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_DRUID )
-    v66 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0);
-  v71 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_CLERIC )
-    v71 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0);
-  v75 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_DRUID)
-    v75 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0);
-  v80 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_SORCERER )
-    v80 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0);
-  v85 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_ARCHER )
-    v85 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0);
-  v89 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_MONK )
-    v89 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0);
-  v94 = uColorTeal;
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0);
+
+  pColorText = uColorTeal;
   if ( uClassType != PLAYER_CLASS_THEIF )
-    v94 = uColorWhite;
+    pColorText = uColorWhite;
   pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * v128 + 417, v94, pClassNames[4], 0, 0, 0);
-  pTextCenter = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0);
+
+  pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
-  //pOrder = 0;
-  //do
-  for (pOrder = 0; pOrder < 9; ++pOrder)
+  for (uint i = 0; i < 9; ++i)
   {
-    pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4);
+    pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4);
     strcpy(pText, pSkillNames[pSkillId]);
     pLenText = strlen(pText);
     v104 = 0;
     if ( (signed int)pLenText > 0 )
     {
-	  if ( pText[v104] == 32 )
-	  {
-		pText[v104] = 0;
-	  }
-	  else
-	  {
-		while ( pText[v104] != 32 )
-		//for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104)
-		{
-		  ++v104;
-		  if ( v104 >= (signed int)pLenText )
-		   break;
-		}
-	  }
+      if ( pText[v104] == 32 )
+      {
+        pText[v104] = 0;
+      }
+      else
+      {
+        while ( pText[v104] != 32 )
+        {
+          ++v104;
+          if ( v104 >= (signed int)pLenText )
+          break;
+        }
+      }
     }
-    uColorGreen = -5;
-    if ( (signed int)v124 > 2 )
-      uColorGreen = 0;
+    pCorrective = -10;//-5
+    if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 )
+      pCorrective = 0;
     pColorText = uColorTeal;
     if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
       pColorText = uColorWhite;
-	pTextCenter = pFontCreate->AlignText_Center(100, pText);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (pOrder / 3) + pTextCenter + uColorGreen + 17, v128 * (pOrder % 3) + 417, pColorText, pText, 0, 0, 0);
-    //++pOrder;
+    pTextCenter = pFontCreate->AlignText_Center(100, pText);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
   }
-  //while ( pOrder < 9 );
+
   pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
-  v113 = PlayerCreation_ComputeAttributeBonus();
-  sprintf(pTmpBuf, "%d", v113);
+  pBonusNum = PlayerCreation_ComputeAttributeBonus();
+  sprintf(pTmpBuf, "%d", pBonusNum);
   pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf);
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0);
   if ( GameUI_Footer_TimeLeft > GetTickCount() )
   {
     pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
-    if ( v113 < 0 )
+    if ( pBonusNum < 0 )
       pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
     pWindow.uFrameWidth = 300;
     pWindow.uFrameHeight = 100;
--- a/mm7_2.cpp	Wed May 08 17:36:19 2013 +0600
+++ b/mm7_2.cpp	Wed May 08 17:36:45 2013 +0600
@@ -6751,7 +6751,7 @@
       pRenderer->Present();
     }
   }
-  GUI_MainMenuMessageProc(); //Ritor1: unknow
+  GUI_MainMenuMessageProc();
   pRenderer->BeginScene();
   GUI_UpdateWindows();
   pRenderer->EndScene();
--- a/mm7_5.cpp	Wed May 08 17:36:19 2013 +0600
+++ b/mm7_5.cpp	Wed May 08 17:36:45 2013 +0600
@@ -3305,15 +3305,14 @@
   PLAYER_SKILL_TYPE v6; // edi@37
   GUIWindow *pWindow; // eax@56
   GUIButton *pButton; // eax@59
-  //int v15; // edi@70
-  //char v16; // zf@73
+  int v15; // edi@70
   char v20; // dl@116
   unsigned int v21; // eax@116
   unsigned int v25; // eax@120
   unsigned int v26; // ecx@127
   SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36
   signed int v41; // [sp-10h] [bp-20h]@29
-  int uNum; // [sp+4h] [bp-Ch]@3
+  int pParam; // [sp+4h] [bp-Ch]@3
   UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3
   int pSex; // [sp+Ch] [bp-4h]@3
 
@@ -3323,8 +3322,8 @@
     do
     {
       int param2;
-      pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &param2);
-      auto player = &pParty->pPlayers[uNum];
+      pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &param2);
+      auto player = &pParty->pPlayers[pParam];
 
       switch (pUIMessageType) // For buttons of window MainMenu
       {
@@ -3346,8 +3345,8 @@
           break;
         case UIMSG_PlayerCreation_SelectAttribute:
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
-          uPlayerCreationUI_SelectedCharacter = uNum;
+                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
+          uPlayerCreationUI_SelectedCharacter = pParam;
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreation_VoicePrev:
@@ -3359,7 +3358,7 @@
             else --player->uVoiceID;
           }
           while (player->GetSexByVoice() != pSex);
-          pButton = pCreationUI_BtnPressLeft2[uNum];
+          pButton = pCreationUI_BtnPressLeft2[pParam];
           GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
           player->PlaySound(SPEECH_PickMe, 0);
@@ -3371,13 +3370,13 @@
             player->uVoiceID = (player->uVoiceID + 1) % 20;
           }
           while (player->GetSexByVoice() != pSex);
-          pButton = pCreationUI_BtnPressRight2[uNum];
+          pButton = pCreationUI_BtnPressRight2[pParam];
           GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
           player->PlaySound(SPEECH_PickMe, 0);
           break;
         case UIMSG_PlayerCreation_FacePrev:
-          pPlayer = &pParty->pPlayers[uNum];
+          pPlayer = &pParty->pPlayers[pParam];
           if (!pPlayer->uFace)
             pPlayer->uFace = 19;
           else
@@ -3386,25 +3385,25 @@
           pPlayer->SetInitialStats();
           pPlayer->SetSexByVoice();
           pPlayer->RandomizeName();
-          v25 = uNum;
+          v25 = pParam;
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
+                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
           uPlayerCreationUI_SelectedCharacter = v25;
           GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], 1);
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
           pPlayer->PlaySound(SPEECH_PickMe, 0);
           break;
         case UIMSG_PlayerCreation_FaceNext:
-          pPlayer = &pParty->pPlayers[uNum];
+          pPlayer = &pParty->pPlayers[pParam];
           v20 = (char)((int)pPlayer->uFace + 1) % 20;
           pPlayer->uFace = v20;
           pPlayer->uVoiceID = v20;
           pPlayer->SetInitialStats();
           pPlayer->SetSexByVoice();
           pPlayer->RandomizeName();
-          v21 = uNum;
+          v21 = pParam;
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
+                                                    % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
           uPlayerCreationUI_SelectedCharacter = v21;
           GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], 1);
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
@@ -3422,13 +3421,13 @@
           break;
         case UIMSG_PlayerCreationSelectActiveSkill:
           pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter];
-          v6 = pPlayer->GetSkillIdxByOrder(uNum + 4);
+          v6 = pPlayer->GetSkillIdxByOrder(pParam + 4);
           if ( pPlayer->GetSkillIdxByOrder(3) == 37 )
             pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1;
           pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationSelectClass:
-          pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum);
+          pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam);
           pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationClickOK:
@@ -3443,19 +3442,19 @@
           pParty->Reset();
           break;
         case UIMSG_PlayerCreationRemoveUpSkill:
-          uPlayerCreationUI_SelectedCharacter = uNum;
+          uPlayerCreationUI_SelectedCharacter = pParam;
           v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
           //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem;
           v41 = 2;
-          v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
+          v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
           pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
                                          + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
           break;
         case UIMSG_PlayerCreationChangeName:
           pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
-          v3 = (void *)uNum;
-          uPlayerCreationUI_SelectedCharacter = uNum;
+          v3 = (void *)pParam;
+          uPlayerCreationUI_SelectedCharacter = pParam;
           pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
           pGUIWindow_CurrentMenu->ptr_1C = v3;
           break;
@@ -3477,11 +3476,11 @@
             //main menu save/load wnd   clicking on savegame lines
           if (pGUIWindow_CurrentMenu->field_40 == 1)
             pKeyActionMap->_459ED1(0);
-          if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
+          if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition )
           {
             //load clicked line
-              v26 = uNum + pSaveListPosition;
-              if ( dword_6BE138 == uNum + pSaveListPosition )
+              v26 = pParam + pSaveListPosition;
+              if ( dword_6BE138 == pParam + pSaveListPosition )
               {
                 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0);
                 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
@@ -3502,8 +3501,8 @@
           break;
         case UIMSG_DownArrow:
           ++pSaveListPosition;
-          if ( pSaveListPosition >= uNum )
-            pSaveListPosition = uNum - 1;
+          if ( pSaveListPosition >= pParam )
+            pSaveListPosition = pParam - 1;
           if ( pSaveListPosition < 1 )
             pSaveListPosition = 0;
           pWindow = pGUIWindow_CurrentMenu;
@@ -3535,6 +3534,7 @@
           }
           if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) )
             break;
+          v15 = 1;
           pVideoPlayer->bStopBeforeSchedule = 1;
           viewparams->bRedrawGameUI = 1;
           viewparams->field_48 = 1;
@@ -3547,12 +3547,29 @@
               SetCurrentMenuID(MENU_CREATEPARTY);
               break;
             }
+            if (GetCurrentMenuID() == MENU_CREDITSPROC)
+            {
+              SetCurrentMenuID(MENU_CREDITSCLOSE);
+              break;
+            }
             pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0);
             break;
           }
           if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen )
           {
-            SetCurrentMenuID(MENU_CREDITSCLOSE);
+            if ( pCurrentScreen == SCREEN_VIDEO )
+              pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
+            if (GetCurrentMenuID() == MENU_NAMEPANELESC)
+            {
+              SetCurrentMenuID(MENU_CREATEPARTY);
+              break;
+            }
+            if (GetCurrentMenuID() == MENU_CREDITSPROC)
+            {
+              SetCurrentMenuID(MENU_CREDITSCLOSE);
+              break;
+            }
+            pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0);
             break;
           }
           if ( pCurrentScreen == SCREEN_LOADGAME )
@@ -3562,12 +3579,13 @@
             pTexture_PCX.Release();
             pTexture_PCX.Load("title.pcx", 0);
             SetCurrentMenuID(MENU_MAIN);
+            v15 = 1;
             pGUIWindow_CurrentMenu->Release();
             pGUIWindow2->Release();
             pGUIWindow2 = 0;
             pEventTimer->Resume();
             pCurrentScreen = SCREEN_GAME;
-            viewparams->bRedrawGameUI = 1;
+            viewparams->bRedrawGameUI = v15;
             break;
           }
           if ( pCurrentScreen == SCREEN_VIDEO )
@@ -3583,16 +3601,16 @@
               pGUIWindow2 = 0;
               pEventTimer->Resume();
               pCurrentScreen = SCREEN_GAME;
-              viewparams->bRedrawGameUI = 1;
+              viewparams->bRedrawGameUI = v15;
               break;
             }
             //VideoPlayer::dtor();
           }
           break;
         case UIMSG_PlayerCreationRemoveDownSkill:
-          uPlayerCreationUI_SelectedCharacter = uNum;
+          uPlayerCreationUI_SelectedCharacter = pParam;
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
-             + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
+             + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
           pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3)
                                              + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
           break;
@@ -10166,54 +10184,23 @@
 
 
 
-
 //----- (004156F0) --------------------------------------------------------
-void __cdecl GUI_UpdateWindows() //     
+void __cdecl GUI_UpdateWindows() 
 {
   GUIWindow *pWindow; // esi@4
   unsigned int pWindowType; // eax@4
-  int v2; // eax@10
-  int v3; // eax@11
-  int v4; // eax@12
-  int v5; // eax@20
-  int v6; // eax@21
-  int v7; // eax@29
-  int v8; // eax@30
-  int v9; // eax@31
-  void *v10; // eax@41
-  int v11; // ecx@42
-  int v12; // eax@48
-  int v13; // eax@49
-  int v14; // eax@57
-  int v15; // eax@58
-  int v16; // eax@59
-  int v17; // eax@60
-  int v18; // eax@61
-  int v19; // eax@62
-  void *v20; // ebp@66
   char *pHint; // edx@66
   GUIButton *pButtonPtr_1C; // ebp@79
   char *pHint1; // edx@80
-  char v24; // zf@81
-  //unsigned int v25; // eax@91
   int v26; // eax@98
   unsigned int v27; // ebp@106
   GUIWindow *pGUIWindow2; // ecx@109
-  unsigned int v29; // eax@111
   GUIFont *pGUIFont; // ST1C_4@115
   int v31; // eax@115
   GUIButton *pButton; // ebp@118
-  int v33; // eax@119
-  int v34; // eax@120
-  int v35; // eax@121
-  int v36; // eax@122
-  int v37; // eax@123
-  int v38; // eax@124
   int v39; // eax@129
-  //char *v40; // edx@138
   unsigned int pNumMessages; // eax@142
   GUIButton *pGUIButton; // ebp@146
-  //char *v43; // edx@146
   unsigned int pX; // [sp-1Ch] [bp-124h]@17
   unsigned int pY; // [sp-18h] [bp-120h]@17
   Texture *pTexture; // [sp-14h] [bp-11Ch]@17
@@ -10227,12 +10214,11 @@
     sub_41CD4F(34);
   for ( i = 1; i <= uNumVisibleWindows; ++i )
   {
-    //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
     pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
     pWindowType = pWindow->eWindowType;
     switch (pWindow->eWindowType)
     {
-      case WINDOW_OptionsButtons://3
+      case WINDOW_OptionsButtons:
       {
         pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);
         pY = pViewport->uViewportTL_Y;
@@ -10241,52 +10227,52 @@
         viewparams->bRedrawGameUI = 1;
         continue;
       }
-      case WINDOW_CharacterRecord://4
+      case WINDOW_CharacterRecord:
       {
         CharacterUI_CharacterScreen_Draw(uActiveCharacter);
         continue;
       }
-      case WINDOW_Options://6
+      case WINDOW_Options:
       {
         DrawGameOptions();
         continue;
       }
-      case WINDOW_Book://9
+      case WINDOW_Book:
       {
         DrawCurrentBook((unsigned int)pWindow->ptr_1C);
         continue;
       }
-      case WINDOW_Dialogue://10
+      case WINDOW_Dialogue:
       {
         DrawDialogueUI();
         continue;
       }
-      case WINDOW_QuickReference://12
+      case WINDOW_QuickReference:
       {
         QuickRefDraw();
         continue;
       }
-      case WINDOW_Rest://16
+      case WINDOW_Rest:
       {
         RestUI_Draw();
         continue;
       }
-      case WINDOW_ChangeLocation://17
+      case WINDOW_ChangeLocation:
       {
         TravelUI_Draw();
         continue;
       }
-      case WINDOW_SpellBook://18
+      case WINDOW_SpellBook:
       {
         DrawSpellBookContent();
         continue;
       }
-      case WINDOW_GreetingNPC://19
+      case WINDOW_GreetingNPC:
       {
         DrawBranchlessDialogueUI();
         continue;
       }
-      case WINDOW_Chest://20
+      case WINDOW_Chest:
       {
         if ( pCurrentScreen == SCREEN_CHEST )
         {
@@ -10302,29 +10288,28 @@
         }
         continue;
       }
-      case WINDOW_SaveLoadButtons://23
+      case WINDOW_SaveLoadButtons:
       {
         sub_4606FE();
         continue;
       }
-      case WINDOW_MainMenu_Load://24
+      case WINDOW_MainMenu_Load:
       {
         GameUI_MainMenu_DrawLoad();
         continue;
       }
-      case WINDOW_HouseInterior://25
+      case WINDOW_HouseInterior:
       {
         pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager();
         if ( !window_SpeakInHouse )
           continue;
-        v10 = window_SpeakInHouse->ptr_1C;
-        if ( (signed int)v10 >= 53 )
-          continue;
-        if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed )
+        if ( (signed int)window_SpeakInHouse->ptr_1C >= 53 )
+          continue;
+        if ( pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] <=pParty->uTimePlayed )
         {
-          if ( (signed int)v10 < 53 )
-          {
-            pParty->field_3C._shop_ban_times[(signed int)v10] = 0;
+          if ( (signed int)window_SpeakInHouse->ptr_1C < 53 )
+          {
+            pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] = 0;
           }
           continue;
         }
@@ -10332,17 +10317,17 @@
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         continue;
       }
-      case WINDOW_Transition://26
+      case WINDOW_Transition:
       {
         TransitionUI_Draw();
         continue;
       }
-      case WINDOW_Scroll://30
+      case WINDOW_Scroll:
       {
         CreateScrollWindow();
         continue;
       }
-      case WINDOW_CastSpell_InInventory://31
+      case WINDOW_CastSpell_InInventory:
       {
         pRenderer->ClearZBuffer(0, 479);
         draw_leather();
@@ -10352,12 +10337,12 @@
             (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
         continue;
       }
-      case WINDOW_FinalWindow://70
+      case WINDOW_FinalWindow:
       {
         sub_41420D_press_esc();
         continue;
       }
-      case WINDOW_50://80
+      case WINDOW_50:
       {
         v27 = TargetColor(255, 255, 255);
         if ( ptr_507BD0->field_40 == 1 )
@@ -10370,15 +10355,7 @@
         }
         if ( ptr_507BD0->field_40 == 2 )
         {
-          //v29 = pMessageQueue_50CBD0->uNumMessages;
           pWindow->field_40 = 0;
-          /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-          {
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C;
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-            *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-            ++pMessageQueue_50CBD0->uNumMessages;
-          }*/
           pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0);
           pEventTimer->Resume();
           ptr_507BD0->Release();
@@ -10394,7 +10371,7 @@
           continue;
         }
       }
-      case WINDOW_59://89
+      case WINDOW_59:
       {
         pWindow->DrawMessageBox(0);
         pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
@@ -10430,7 +10407,7 @@
         }
         continue;
       }
-      case WINDOW_PressedButton2://90
+      case WINDOW_PressedButton2:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -10443,8 +10420,7 @@
             viewparams->bRedrawGameUI = 1;
             if ( pWindow->Hint )
             {
-              v24 = pWindow->Hint == (char *)1;
-              if ( !v24 )
+              if ( pWindow->Hint != (char *)1 )
                 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
             }
             pWindow->Release();
@@ -10454,14 +10430,13 @@
         viewparams->bRedrawGameUI = 1;
         if ( pWindow->Hint )
         {
-          v24 = pWindow->Hint == (char *)1;
-          if ( !v24 )
+          if ( pWindow->Hint != (char *)1 )
             pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
         }
         pWindow->Release();
         continue;
       }
-      case WINDOW_CharactersPressedButton://91
+      case WINDOW_CharactersPressedButton:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -10470,14 +10445,13 @@
         viewparams->bRedrawGameUI = 1;
         if ( pWindow->Hint )
         {
-          v24 = pWindow->Hint == (char *)1;
-          if ( !v24 )
+          if ( pWindow->Hint != (char *)1 )
             pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
         }
         pWindow->Release();
         continue;
       }
-      case WINDOW_PressedButton://92
+      case WINDOW_PressedButton:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -10486,14 +10460,13 @@
         viewparams->bRedrawGameUI = 1;
         if ( pWindow->Hint )
         {
-          v24 = pWindow->Hint == (char *)1;
-          if ( !v24 )
+          if ( pWindow->Hint != (char *)1 )
             pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
         }
         pWindow->Release();
         continue;
       }
-      case WINDOW_5D://93
+      case WINDOW_5D:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -10503,7 +10476,7 @@
         pWindow->Release();
         continue;
       }
-      case WINDOW_SaveLoadBtn://94
+      case WINDOW_SaveLoadBtn:
       {
         if (pWindow->Hint != (char *)1)
           pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
@@ -10520,7 +10493,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
         continue;
       }
-      case WINDOW_LoadGame_CancelBtn://95
+      case WINDOW_LoadGame_CancelBtn:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -10530,18 +10503,10 @@
         if ( pWindow->Hint && pWindow->Hint != (char *)1 )
           pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
         pWindow->Release();
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-        {
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-          ++pMessageQueue_50CBD0->uNumMessages;
-          continue;
-        }*/
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         continue;
       }
-      case WINDOW_CloseRestWindowBtn://96
+      case WINDOW_CloseRestWindowBtn:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
@@ -10555,7 +10520,7 @@
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         continue;
       }
-      case WINDOW_ExitCharacterWindow://97
+      case WINDOW_ExitCharacterWindow:
       {
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
@@ -10570,7 +10535,7 @@
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         continue;
       }
-      case WINDOW_RestWindow://98
+      case WINDOW_RestWindow:
       {
         memset(&GUIButton2, 0, 0xBCu);
         GUIButton2.uZ = 197;
@@ -10589,7 +10554,7 @@
         pGUIWindow2->Release();
         continue;
       }
-      case WINDOW_BooksWindow://99
+      case WINDOW_BooksWindow:
       {
         pButton = (GUIButton *)pWindow->ptr_1C;
         pY = pWindow->uFrameY;
@@ -10598,7 +10563,7 @@
         viewparams->bRedrawGameUI = 1;
         continue;
       }
-      case WINDOW_CharacterWindow_Inventory://103
+      case WINDOW_CharacterWindow_Inventory:
       {
         pWindow->DrawMessageBox(0);
         pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
@@ -10619,12 +10584,12 @@
         }
         continue;
       }
-      case WINDOW_KeyMappingOptions://105
+      case WINDOW_KeyMappingOptions:
       {
         GameMenuUI_DrawKeyBindings();
         continue;
       }
-      case WINDOW_VideoOptions://106
+      case WINDOW_VideoOptions:
       {
         GameMenuUI_DrawVideoOptions();
         continue;