changeset 173:8e6ed320a356

Слияние
author Ritor1
date Tue, 11 Dec 2012 21:54:53 +0600
parents b4c9e1d2eec8 (current diff) 87c503d426e0 (diff)
children 6ce54633e7ba
files
diffstat 8 files changed, 191 insertions(+), 207 deletions(-) [+]
line wrap: on
line diff
--- a/GUIButton.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/GUIButton.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -78,7 +78,7 @@
 struct GUIWindow *ptr_507BC8;
 struct GUIWindow *pGUIWindow_CurrentMenu;
 struct GUIWindow *ptr_507BD0;
-struct GUIWindow *ptr_507BD4;
+struct GUIWindow *pGUIWindow_Settings;
 struct GUIWindow *ptr_507BDC;
 struct GUIWindow *ptr_507BE0;
 struct GUIWindow *pGUIWindow2;
--- a/GUIButton.h	Tue Dec 11 21:54:43 2012 +0600
+++ b/GUIButton.h	Tue Dec 11 21:54:53 2012 +0600
@@ -104,7 +104,7 @@
 extern struct GUIWindow *ptr_507BC8;
 extern struct GUIWindow *pGUIWindow_CurrentMenu;
 extern struct GUIWindow *ptr_507BD0;
-extern struct GUIWindow *ptr_507BD4;
+extern struct GUIWindow *pGUIWindow_Settings;
 extern struct GUIWindow *ptr_507BDC;
 extern struct GUIWindow *ptr_507BE0;
 extern struct GUIWindow *pGUIWindow2;
--- a/mm7_1.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_1.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -5731,10 +5731,10 @@
     v6 = v0->GetItemIDAtInventoryIndex(&a4);
     if ( v6 )
     {
-      *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
-      *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
-      *((int *)ptr_507BD4->ptr_1C + 3) = v6 - 1;
-      *((short *)ptr_507BD4->ptr_1C + 3) = a4;
+      *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
+      *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
+      *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1;
+      *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4;
       ptr_50C9A4 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v6 + 5];
       unk_50C9A0 = 0;
       if ( pMessageQueue_50CBD0->uNumMessages )
--- a/mm7_2.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_2.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -15496,11 +15496,11 @@
     }
     if ( unk_50C9A0 )
     {
-      *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
-      *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
+      *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
+      *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
       v39 = v52;
-      *((int *)ptr_507BD4->ptr_1C + 3) = v36;
-      *((short *)ptr_507BD4->ptr_1C + 3) = v39;
+      *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36;
+      *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39;
       ptr_50C9A4 = v38;
       unk_50C9A0 = 0;
       if ( pMessageQueue_50CBD0->uNumMessages )
--- a/mm7_5.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_5.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -1552,7 +1552,7 @@
                 pIcons_LOD->_4114F2();
               }
 LABEL_322:
-              if ( ptr_507BD4 )
+              if ( pGUIWindow_Settings )
               {
                 if ( pCurrentScreen == 7 )
                 {
@@ -1560,8 +1560,8 @@
                 }
                 else
                 {
-                  ptr_507BD4->Release();
-                  ptr_507BD4 = 0;
+                  pGUIWindow_Settings->Release();
+                  pGUIWindow_Settings = 0;
                   pMouse->SetCursorBitmap("MICON1");
                   GameUI_StatusBar_TimedStringTimeLeft = 0;
                   unk_50C9A0 = 0;
@@ -1580,8 +1580,8 @@
               pIcons_LOD->_4355F7();
               goto _continue;
             }
-            v36 = ptr_507BD4;
-            if ( !ptr_507BD4 )
+            v36 = pGUIWindow_Settings;
+            if ( !pGUIWindow_Settings )
             {
               dword_6BE138 = -1;
               GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)90, (int)ptr_5079F0, v0);
@@ -1946,16 +1946,16 @@
           if ( v48 )
             goto _continue;
 LABEL_415:
-          v51 = ptr_507BD4->ptr_1C;
+          v51 = pGUIWindow_Settings->ptr_1C;
           *((char *)v51 + 8) &= 0xBFu;
 LABEL_416:
           *((short *)v51 + 2) = uMessageParam;
           *((int *)v51 + 3) = v44;
           pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
-          v36 = ptr_507BD4;
+          v36 = pGUIWindow_Settings;
 LABEL_333:
           v36->Release();
-          ptr_507BD4 = 0;
+          pGUIWindow_Settings = 0;
           pMouse->SetCursorBitmap("MICON1");
           GameUI_StatusBar_TimedStringTimeLeft = 0;
           unk_50C9A0 = 0;
@@ -1976,9 +1976,9 @@
           }
           else
           {
-            if ( ptr_507BD4 )
-            {
-              v52 = ptr_507BD4->ptr_1C;
+            if ( pGUIWindow_Settings )
+            {
+              v52 = pGUIWindow_Settings->ptr_1C;
               switch ( uMessage )
               {
                 case 69:
@@ -1993,8 +1993,8 @@
               }
               *((short *)v52 + 2) = uMessageParam;
               pParty->pPlayers[*((short *)v52 + 1)].SetRecoveryTime(300);
-              ptr_507BD4->Release();
-              ptr_507BD4 = 0;
+              pGUIWindow_Settings->Release();
+              pGUIWindow_Settings = 0;
               pEventTimer->Resume();
               pMouse->SetCursorBitmap("MICON1");
               GameUI_StatusBar_TimedStringTimeLeft = 0;
@@ -2452,7 +2452,7 @@
           v84 = v83 >> 16;
           if ( (v44 & 7) != 3 || v84 >= 5120 )
             goto LABEL_90;
-          v51 = ptr_507BD4->ptr_1C;
+          v51 = pGUIWindow_Settings->ptr_1C;
           if ( uMessage == 70 )
           {
             *((char *)v51 + 8) &= 0xF7u;
@@ -3365,7 +3365,7 @@
   if ( ptr_507BC4 )
     free_book_subwindow();
   if ( !pCurrentScreen
-    && !ptr_507BD4 )
+    && !pGUIWindow_Settings )
     pEventTimer->Resume();
   viewparams->bRedrawGameUI = 1;
 }
@@ -15775,7 +15775,7 @@
 //----- (00416D62) --------------------------------------------------------
 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this)
 {
-  signed int v1; // eax@12
+  signed int pPlayerNum; // eax@12
   char *v2; // eax@32
   void *v3; // ecx@52
   unsigned int v4; // eax@59
@@ -15786,21 +15786,21 @@
   unsigned int v9; // eax@72
   unsigned int v10; // eax@76
   char v11; // zf@83
-  GUIButton *v12; // esi@84
+  GUIButton *pButton; // esi@84
   unsigned int v13; // ecx@85
-  char *v14; // edi@85
-  signed int v15; // eax@92
+  char *pStr; // edi@85
+  signed int pControlID; // eax@92
   int v16; // eax@95
   int v17; // eax@96
   enum PLAYER_SKILL_TYPE v18; // eax@98
-  char *v19; // eax@99
+  char *pStr2; // eax@99
   unsigned int v20; // eax@108
   unsigned int v21; // eax@109
   const char *v22; // eax@111
   char *v23; // ebx@112
   char *v24; // edx@113
   unsigned int v25; // eax@113
-  GUIWindow a1; // [sp+4h] [bp-74h]@32
+  GUIWindow pWindow; // [sp+4h] [bp-74h]@32
   double v27; // [sp+58h] [bp-20h]@33
   struct tagPOINT Point; // [sp+60h] [bp-18h]@6
   char *v29; // [sp+68h] [bp-10h]@33
@@ -15808,7 +15808,7 @@
   unsigned int pX; // [sp+70h] [bp-8h]@3
   unsigned int pY; // [sp+74h] [bp-4h]@3
 
-  if ( pCurrentScreen == 16 )
+  if ( pCurrentScreen == 16 )//   
     return;
   if ( _this )
   {
@@ -15831,55 +15831,46 @@
   }
   if ( pParty->pPickedItem.uItemID )
   {
-    v1 = 0;
-    do
-    {
-      if ( (signed int)pX > word_4E2930[v1]
-        && (signed int)pX < word_4E2938[v1]
-        && (signed int)pY > 375
-        && (signed int)pY < 466 )
-      {
-        pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(v1 + 1, 1);
+    //v1 = 0;
+    //do
+	for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum)
+    {
+      if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum]
+        && (signed int)pY > 375 && (signed int)pY < 466 )
+      {
+        pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1);
         return;
       }
-      ++v1;
-    }
-    while ( v1 < 4 );
+      //++v1;
+    }
+    //while ( v1 < 4 );
   }
   pEventTimer->Pause();
   if ( pCurrentScreen <= 10 )
   {
-    if ( pCurrentScreen == 10 )
+    if ( pCurrentScreen == 10 )// 
     {
       __debugbreak();
       if ( !pPlayers[uActiveCharacter]->CanAct() )
       {
-        sprintf(
-          pTmpBuf,
-          pGlobalTXT_LocalizationStrings[427],
-          pPlayers[uActiveCharacter]->pName,
-          pGlobalTXT_LocalizationStrings[541]);
-        a1.Hint = pTmpBuf;
-        a1.uFrameWidth = 384;
-        a1.uFrameHeight = 180;
-        a1.uFrameY = 40;
+        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s    %s
+          pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);// 
+        pWindow.Hint = pTmpBuf;
+        pWindow.uFrameWidth = 384;
+        pWindow.uFrameHeight = 180;
+        pWindow.uFrameY = 40;
         if ( (signed int)pX <= 320 )
           v10 = pX + 30;
         else
           v10 = pX - 414;
-        a1.uFrameX = v10;
+        pWindow.uFrameX = v10;
         goto LABEL_42;
       }
       v9 = pX + pSRZBufferLineOffsets[pY];
       if ( !(pRenderer->pActiveZBuffer[v9] & 0xFFFF) )
         goto LABEL_132;
-      v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4
-                     + 2662 * (unsigned int)ptr_507BB8->ptr_1C
-                     + 18
-                     * *((short *)&pChests[0].mm7__vector_pItems[139].uExpireTime
-                       + (pRenderer->pActiveZBuffer[v9] & 0xFFFF)
-                       + 2662 * (unsigned int)ptr_507BB8->ptr_1C
-                       + 3));
+      v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)ptr_507BB8->ptr_1C + 18* *((short *)&pChests[0].mm7__vector_pItems[139].uExpireTime
+                       + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)ptr_507BB8->ptr_1C + 3));
     }
     else
     {
@@ -15889,7 +15880,7 @@
         {
           if ( pCurrentScreen != 7 )
           {
-            if ( pCurrentScreen == 8 )
+            if ( pCurrentScreen == 8 )//  
             {
               if ( dword_507B00_spell_info_to_draw_in_popup )
                 DrawSpellDescriptionPopup((void *)(dword_507B00_spell_info_to_draw_in_popup - 1));
@@ -15897,8 +15888,7 @@
             goto LABEL_132;
           }
 LABEL_119:
-          if ( (signed int)pX > 467
-            && pCurrentScreen != 14 )
+          if ( (signed int)pX > 467 && pCurrentScreen != 14 )
           {
 LABEL_126:
             identify_item();
@@ -15927,14 +15917,14 @@
           || (signed int)pX > (signed int)pViewport->uViewportZ
           || (signed int)pY < (signed int)pViewport->uViewportY
           || (signed int)pY > (signed int)pViewport->uViewportW
-          || (v2 = (char *)sub_444564(), (a1.Hint = v2) == 0) )
+          || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) )
           goto LABEL_132;
         v30 = (double)(pFontArrus->GetLineWidth(v2) + 32);
         v27 = v30 + 6.7553994e15;
         v29 = (char *)LODWORD(v27);
-        a1.uFrameWidth = LODWORD(v27);
-        a1.uFrameX = pX + 5;
-        a1.uFrameY = pY + 5;
+        pWindow.uFrameWidth = LODWORD(v27);
+        pWindow.uFrameX = pX + 5;
+        pWindow.uFrameY = pY + 5;
         goto LABEL_41;
       }
       if (GetCurrentMenuID() > 0)
@@ -15942,16 +15932,16 @@
 
       if ( (signed int)pY > (signed int)pViewport->uViewportW )
       {
-        a1.ptr_1C = (void *)((signed int)pX / 118);
+        pWindow.ptr_1C = (void *)((signed int)pX / 118);
         if ( (signed int)pX / 118 < 4 )
         {
-          a1.Hint = 0;
-          a1.uFrameWidth = 400;
-          a1.uFrameHeight = 200;
-          a1.uFrameX = 38;
-          a1.uFrameY = 60;
+          pWindow.Hint = 0;
+          pWindow.uFrameWidth = 400;
+          pWindow.uFrameHeight = 200;
+          pWindow.uFrameX = 38;
+          pWindow.uFrameY = 60;
           pAudioPlayer->StopChannels(-1, -1);
-          a1.DrawQuickCharRecord();
+          pWindow.DrawQuickCharRecord();
         }
         goto LABEL_132;
       }
@@ -15961,13 +15951,13 @@
         {
           if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )
           {
-            a1.Hint = 0;
-            a1.uFrameWidth = 400;
-            a1.uFrameHeight = 200;
-            a1.uFrameX = 38;
-            a1.uFrameY = 60;
+            pWindow.Hint = 0;
+            pWindow.uFrameWidth = 400;
+            pWindow.uFrameHeight = 200;
+            pWindow.uFrameX = 38;
+            pWindow.uFrameY = 60;
             pAudioPlayer->StopChannels(-1, -1);
-            a1._41D73D_draw_buff_tooltip();
+            pWindow._41D73D_draw_buff_tooltip();
             goto LABEL_132;
           }
           if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )
@@ -15985,25 +15975,25 @@
           sub_416B01(v3);
           goto LABEL_132;
         }
-        a1.Hint = _4443D5_GetMinimapRightClickText();
-        a1.uFrameWidth = 256;
-        a1.uFrameX = 130;
-        a1.uFrameY = 140;
+        pWindow.Hint = _4443D5_GetMinimapRightClickText();
+        pWindow.uFrameWidth = 256;
+        pWindow.uFrameX = 130;
+        pWindow.uFrameY = 140;
 LABEL_41:
-        a1.uFrameHeight = 64;
+        pWindow.uFrameHeight = 64;
         pAudioPlayer->StopChannels(-1, -1);
 LABEL_42:
-        a1.DrawMessageBox(0);
+        pWindow.DrawMessageBox(0);
         goto LABEL_132;
       }
-      a1.Hint = 0;
-      a1.uFrameWidth = 320;
-      a1.uFrameHeight = 320;
+      pWindow.Hint = 0;
+      pWindow.uFrameWidth = 320;
+      pWindow.uFrameHeight = 320;
       v4 = pX - 350;
       if ( (signed int)pX <= 320 )
         v4 = pX + 30;
-      a1.uFrameX = v4;
-      a1.uFrameY = 40;
+      pWindow.uFrameX = v4;
+      pWindow.uFrameY = 40;
       if ( pRenderer->pRenderD3D )
         LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val();
       else
@@ -16015,14 +16005,14 @@
         {
           if ( pRenderer->uNumSceneBegins )
           {
-            a1.DrawMessageBox(1);
-            MonsterPopup_Draw(v6 >> 3, &a1);
+            pWindow.DrawMessageBox(1);
+            MonsterPopup_Draw(v6 >> 3, &pWindow);
           }
           else
           {
             pRenderer->BeginScene();
-            a1.DrawMessageBox(1);
-            MonsterPopup_Draw(v6 >> 3, &a1);
+            pWindow.DrawMessageBox(1);
+            MonsterPopup_Draw(v6 >> 3, &pWindow);
             pRenderer->EndScene();
           }
         }
@@ -16036,7 +16026,7 @@
     GameUI_DrawItemInfo(v8);
     goto LABEL_132;
   }
-  if ( pCurrentScreen == 13 )
+  if ( pCurrentScreen == 13 )// 
   {
     if ( (signed int)pY < 345 && (signed int)pX < 469 )
       sub_4B1A2D();
@@ -16051,33 +16041,30 @@
     v11 = pCurrentScreen == 23;
     goto LABEL_125;
   }
-  a1.Hint = 0;
-  v12 = pGUIWindow_CurrentMenu->pControlsHead;
-  if ( !v12 )
+  pWindow.Hint = 0;
+  pButton = pGUIWindow_CurrentMenu->pControlsHead;
+  if ( !pButton )
     goto LABEL_132;
   v13 = pY;
-  v14 = v29;
+  pStr = v29;
   while ( 1 )
   {
-    if ( v12->uButtonType != 1 && v12->uButtonType != 3
-      || (signed int)pX < (signed int)v12->uX
-      || (signed int)pX > (signed int)v12->uZ
-      || (signed int)v13 < (signed int)v12->uY
-      || (signed int)v13 > (signed int)v12->uW )
+    if ( pButton->uButtonType != 1 && pButton->uButtonType != 3 || (signed int)pX < (signed int)pButton->uX || (signed int)pX > (signed int)pButton->uZ
+      || (signed int)v13 < (signed int)pButton->uY || (signed int)v13 > (signed int)pButton->uW )
       goto LABEL_117;
-    v15 = v12->uControlID;
-    if ( v15 <= 65 )
-    {
-      if ( v15 == 65 )
-      {
-        a1.Hint = pClassDescriptions[v12->uControlParam];
-        v14 = pClassNames[v12->uControlParam];
+    pControlID = pButton->uControlID;
+    if ( pControlID <= 65 )
+    {
+      if ( pControlID == 65 )
+      {
+        pWindow.Hint = pClassDescriptions[pButton->uControlParam];
+        pStr = pClassNames[pButton->uControlParam];
       }
       else
       {
-        if ( v15 )
-        {
-          v16 = v15 - 62;
+        if ( pControlID )
+        {
+          v16 = pControlID - 62;
           if ( v16 )
           {
             v17 = v16 - 1;
@@ -16085,96 +16072,93 @@
             {
               if ( v17 == 1 )
               {
-                v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(
-                        v12->uControlParam + 4);
-                v14 = pSkillNames[v18];
-                a1.Hint = pSkillDesc[v18];
+                v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4);
+                pStr = pSkillNames[v18];
+                pWindow.Hint = pSkillDesc[v18];
                 v13 = pY;
               }
               goto LABEL_117;
             }
-            v14 = pGlobalTXT_LocalizationStrings[668];
-            v19 = pGlobalTXT_LocalizationStrings[669];
+            pStr = pGlobalTXT_LocalizationStrings[668];//
+            pStr2 = pGlobalTXT_LocalizationStrings[669];//"    ,     "
           }
           else
           {
-            v14 = pGlobalTXT_LocalizationStrings[670];
-            v19 = pGlobalTXT_LocalizationStrings[671];
+            pStr = pGlobalTXT_LocalizationStrings[670];//
+            pStr2 = pGlobalTXT_LocalizationStrings[671];//"    ,     "
           }
           goto LABEL_116;
         }
-        a1.Hint = pAttributeDescriptions[(signed int)v12->uControlParam % 7];
-        v14 = aAttributeNames[(signed int)v12->uControlParam % 7];
+        pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7];
+        pStr = aAttributeNames[(signed int)pButton->uControlParam % 7];
       }
       goto LABEL_117;
     }
-    if ( v15 == 66 )
-    {
-      v19 = pGlobalTXT_LocalizationStrings[664];
-      v14 = pGlobalTXT_LocalizationStrings[665];
+    if ( pControlID == 66 )
+    {
+      pStr2 = pGlobalTXT_LocalizationStrings[664];//        .
+      pStr = pGlobalTXT_LocalizationStrings[665];// 
       goto LABEL_116;
     }
-    if ( v15 == 67 )
-    {
-      v19 = pGlobalTXT_LocalizationStrings[666];
-      v14 = pGlobalTXT_LocalizationStrings[667];
+    if ( pControlID == 67 )
+    {
+      pStr2 = pGlobalTXT_LocalizationStrings[666];//     .
+      pStr = pGlobalTXT_LocalizationStrings[667];// 
       goto LABEL_116;
     }
-    if ( v15 > 71 )
+    if ( pControlID > 71 )
       break;
 LABEL_117:
-    v12 = v12->pNext;
-    if ( !v12 )
+    pButton = pButton->pNext;
+    if ( !pButton )
       goto LABEL_112;
   }
-  if ( v15 > 75 )
-  {
-    if ( v15 == 118 )
-    {
-      v20 = v12->uControlParam;
-      v14 = pParty->pPlayers[v20].pName;
-      v19 = pClassDescriptions[pParty->pPlayers[v20].uClass];
+  if ( pControlID > 75 )
+  {
+    if ( pControlID == 118 )
+    {
+      v20 = pButton->uControlParam;
+      pStr = pParty->pPlayers[v20].pName;
+      pStr2 = pClassDescriptions[pParty->pPlayers[v20].uClass];
 LABEL_116:
-      a1.Hint = v19;
+      pWindow.Hint = pStr2;
       goto LABEL_117;
     }
     goto LABEL_117;
   }
-  v21 = pParty->pPlayers[v12->uControlParam].GetSkillIdxByOrder(v15 - 72);
+  v21 = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72);
   v13 = v21;
   pY = v21;
   if ( (v21 & 0x80000000u) != 0 || (signed int)v21 >= 37 )
     goto LABEL_117;
-  v22 = CharacterUI_GetSkillDescText(v12->uControlParam, (enum PLAYER_SKILL_TYPE)v21);
+  v22 = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)v21);
   strcpy(pTmpBuf2, v22);
-  a1.Hint = pTmpBuf2;
-  v14 = pSkillNames[pY];
+  pWindow.Hint = pTmpBuf2;
+  pStr = pSkillNames[pY];
 LABEL_112:
-  v23 = a1.Hint;
-  if ( a1.Hint )
-  {
-    v24 = a1.Hint;
-    a1.Hint = 0;
-    a1.uFrameWidth = 384;
-    a1.uFrameHeight = 256;
-    a1.uFrameX = 128;
-    a1.uFrameY = 40;
-    a1.uFrameHeight = pFontSmallnum->CalcTextHeight(v24, &a1, 24, 0)
-                    + 2 * LOBYTE(pFontLucida->uFontHeight)
-                    + 24;
-    a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
-    a1.uFrameW = a1.uFrameY + a1.uFrameHeight - 1;
-    a1.DrawMessageBox(0);
-    a1.uFrameX += 12;
-    a1.uFrameWidth -= 24;
-    a1.uFrameY += 12;
-    a1.uFrameHeight -= 12;
-    a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
-    a1.uFrameW = a1.uFrameY + a1.uFrameHeight - 1;
-    v25 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
-    sprintf(pTmpBuf, format_4E2D80, v25, v14);
-    a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
-    a1.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v23, 0, 0, 0);
+  v23 = pWindow.Hint;
+  if ( pWindow.Hint )
+  {
+    v24 = pWindow.Hint;
+    pWindow.Hint = 0;
+    pWindow.uFrameWidth = 384;
+    pWindow.uFrameHeight = 256;
+    pWindow.uFrameX = 128;
+    pWindow.uFrameY = 40;
+    pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(v24, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
+    pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
+    pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
+    pWindow.DrawMessageBox(0);
+    pWindow.uFrameX += 12;
+    pWindow.uFrameWidth -= 24;
+    pWindow.uFrameY += 12;
+    pWindow.uFrameHeight -= 12;
+    pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
+    pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
+    v25 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
+    sprintf(pTmpBuf, format_4E2D80, v25, pStr);
+    pWindow.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3);
+    pWindow.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v23, 0, 0, 0);
   }
 LABEL_132:
   dword_507BF0_is_there_popup_onscreen = 1;
--- a/mm7_6.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_6.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -2324,8 +2324,8 @@
         v15->spellnum = 0;
         if ( !v8 )
         {
-          ptr_507BD4->Release();
-          ptr_507BD4 = 0;
+          pGUIWindow_Settings->Release();
+          pGUIWindow_Settings = 0;
           pMouse->SetCursorBitmap("MICON1");
           GameUI_StatusBar_TimedStringTimeLeft = 0;
           unk_50C9A0 = 0;
@@ -2340,18 +2340,18 @@
     {
       if ( v6 & 2 )
       {
-        if ( ptr_507BD4 )
+        if ( pGUIWindow_Settings )
           return result;
-        ptr_507BD4 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0);
-        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0);
-        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0);
-        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0);
+        pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
+        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0);
+        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0);
         return sub_421B2C_PlaceInInventory_or_DropPickedItem();
       }
       if ( v6 & 8 )
       {
-        if ( ptr_507BD4 )
+        if ( pGUIWindow_Settings )
           return result;
         v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
         v29 = 0;
@@ -2366,7 +2366,7 @@
         v21 = 460;
         v20 = 8;
         v19 = 8;
-        ptr_507BD4 = v17;
+        pGUIWindow_Settings = v17;
         v18 = v17;
 LABEL_56:
         v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29);
@@ -2374,7 +2374,7 @@
       }
       if ( v6 & 0x40 )
       {
-        if ( ptr_507BD4 )
+        if ( pGUIWindow_Settings )
           return result;
         v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
         v29 = 0;
@@ -2386,25 +2386,25 @@
       }
       if ( (char)v6 < 0 )
       {
-        if ( ptr_507BD4 )
+        if ( pGUIWindow_Settings )
           return result;
         ++pIcons_LOD->uTexturePacksCount;
         if ( !pIcons_LOD->uNumPrevLoadedFiles )
           pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-        ptr_507BD4 = pStru277[result].sub_4219BE();
+        pGUIWindow_Settings = pStru277[result].sub_4219BE();
         unk_50C9A0 = 1;
         some_active_character = uActiveCharacter;
         return sub_421B2C_PlaceInInventory_or_DropPickedItem();
       }
       if ( HIBYTE(v6) & 1 )
       {
-        if ( ptr_507BD4 )
+        if ( pGUIWindow_Settings )
           return result;
-        ptr_507BD4 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0);
-        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0);
-        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0);
-        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0);
-        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0);
+        pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0);
+        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0);
+        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0);
         v29 = 0;
         v28 = "";
         v27 = 0;
@@ -2416,13 +2416,13 @@
         v21 = 460;
         v20 = 8;
         v19 = 8;
-        v18 = ptr_507BD4;
+        v18 = pGUIWindow_Settings;
         goto LABEL_56;
       }
-      if ( HIBYTE(v6) & 2 && !ptr_507BD4 )
+      if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings )
       {
-        ptr_507BD4 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0);
-        ptr_5079EC = ptr_507BD4->CreateButton(
+        pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0);
+        ptr_5079EC = pGUIWindow_Settings->CreateButton(
                        0x1D5u,
                        0xB2u,
                        (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureWidth : 24),
@@ -2435,7 +2435,7 @@
                        "",
                        (Texture *)(uTextureID_507990 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507990] : 0),
                        0);
-        ptr_5079E8 = ptr_507BD4->CreateButton(
+        ptr_5079E8 = pGUIWindow_Settings->CreateButton(
                        0x272u,
                        0xB2u,
                        (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureWidth : 24),
@@ -2448,8 +2448,8 @@
                        "",
                        (Texture *)(uTextureID_50798C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50798C] : 0),
                        0);
-        ptr_507BD4->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0);
-        result = (bool)ptr_507BD4->CreateButton(
+        pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0);
+        result = (bool)pGUIWindow_Settings->CreateButton(
                          0x231u,
                          0x95u,
                          0x40u,
@@ -2484,8 +2484,8 @@
       if ( v2->field_8 & 0x3CA )
       {
         v2->spellnum = 0;
-        ptr_507BD4->Release();
-        ptr_507BD4 = 0;
+        pGUIWindow_Settings->Release();
+        pGUIWindow_Settings = 0;
         pMouse->SetCursorBitmap("MICON1");
         GameUI_StatusBar_TimedStringTimeLeft = 0;
         unk_50C9A0 = 0;
--- a/mm7_data.cpp	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_data.cpp	Tue Dec 11 21:54:53 2012 +0600
@@ -475,8 +475,8 @@
 char byte_4E28FC; // weak
 unsigned int uGammaPos;
 int dword_4E2910[777]; // weak
-__int16 word_4E2930[4];
-__int16 word_4E2938[4];
+__int16 RightClickPortraitXmin[4];
+__int16 RightClickPortraitXmax[4];
 void *off_4E2A12; // weak
 int dword_4E2A18[5];
 int dword_4E2A2C[9];
--- a/mm7_data.h	Tue Dec 11 21:54:43 2012 +0600
+++ b/mm7_data.h	Tue Dec 11 21:54:53 2012 +0600
@@ -461,8 +461,8 @@
 extern char byte_4E28FC; // weak
 extern unsigned int uGammaPos;
 extern int dword_4E2910[]; // weak
-extern __int16 word_4E2930[4];
-extern __int16 word_4E2938[4];
+extern __int16 RightClickPortraitXmin[4];
+extern __int16 RightClickPortraitXmax[4];
 extern void *off_4E2A12; // weak
 extern int dword_4E2A18[5];
 extern int dword_4E2A2C[9];