changeset 8:13da46a8d45d

15.01.13(CharacterScreen run)
author Ritor1
date Tue, 15 Jan 2013 21:37:04 +0600
parents bf019a7475f3
children 40f6ac8fbe39 144f4815e63a
files GUIButton.h MM7.sdf mm7_1.cpp mm7_4.cpp
diffstat 4 files changed, 458 insertions(+), 163 deletions(-) [+]
line wrap: on
line diff
--- a/GUIButton.h	Tue Jan 15 18:42:42 2013 +0600
+++ b/GUIButton.h	Tue Jan 15 21:37:04 2013 +0600
@@ -17,7 +17,7 @@
   unsigned int uZ;
   unsigned int uW;
   int uButtonType;
-  int field_1C;
+  int field_1C;//may be pMessageType
   unsigned int uControlID;
   unsigned int uControlParam;
   int field_28;
Binary file MM7.sdf has changed
--- a/mm7_1.cpp	Tue Jan 15 18:42:42 2013 +0600
+++ b/mm7_1.cpp	Tue Jan 15 21:37:04 2013 +0600
@@ -4976,20 +4976,20 @@
 void __cdecl GameUI_WritePointedObjectStatusString()
 {
   int v1; // ebx@6
-  GUIWindow *v2; // edi@7
-  GUIButton *i; // ecx@11
-  Player *v4; // eax@19
+  GUIWindow *pWindow; // edi@7
+  GUIButton *pButton; // ecx@11
+  Player *pPlayer; // eax@19
   char v5; // cl@19
   unsigned int v6; // eax@19
   int v7; // ecx@19
   __int16 v8; // fps@23
   unsigned __int8 v9; // c0@23
   unsigned __int8 v10; // c3@23
-  enum UIMessageType v11; // esi@24
+  enum UIMessageType pMessageType1; // esi@24
   int v12; // edx@25
   char *v13; // ecx@28
   int v14; // eax@41
-  ItemGen *v15; // ecx@44
+  ItemGen *pItemGen; // ecx@44
   int v16; // ecx@46
   const char *v17; // eax@49
   signed int v18; // eax@55
@@ -5009,9 +5009,9 @@
   __int16 v32; // fps@109
   unsigned __int8 v33; // c0@109
   unsigned __int8 v34; // c3@109
-  enum UIMessageType v35; // esi@110
+  enum UIMessageType pMessageType2; // esi@110
   int v36; // edx@111
-  enum UIMessageType v37; // edx@117
+  enum UIMessageType pMessageType3; // edx@117
   int v38; // ecx@118
   const char *v39; // [sp-8h] [bp-E8h]@20
   char *v40; // [sp-8h] [bp-E8h]@83
@@ -5025,7 +5025,7 @@
 
   pMouse->uPointingObjectID = 0;
   pMouse->GetClickPos(&pX, &pY);
-  if ( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 )
+  if ( pX || (signed int)pX > 639 || pY || (signed int)pY > 479 )
     return;
   if ( !pCurrentScreen )
   {
@@ -5040,7 +5040,20 @@
         || (signed int)pY > (signed int)pViewport->uScreenW )
         v18 = -1;
       if ( v18 == -1 )
-        goto LABEL_61;
+        //goto LABEL_61;
+      {
+        pMouse->uPointingObjectID = 0;
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
+      }
     }
     else
     {
@@ -5052,13 +5065,39 @@
     {
       v30 = v19;
       if ( pObjectList->pObjects[pLayingItems[v30].uObjectDescID].uFlags & 0x10 )
-        goto LABEL_73;
+        //goto LABEL_73;
+      {
+        pMouse->uPointingObjectID = 0;
+        //goto LABEL_50;
+        uLastPointedObjectID = 1;
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
+      }
       if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID )
       {
         v22 = pLayingItems[v30].stru_24.GetDisplayName();
-LABEL_93:
+//LABEL_93:
         v26 = v22;
-        goto LABEL_87;
+        //goto LABEL_87;
+        sub_41C0B8_set_status_string(v26);
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
       }
       v31 = pLayingItems[v30].stru_24.GetDisplayName();
       v28 = pTmpBuf;
@@ -5079,12 +5118,48 @@
               v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic;
             else
               v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20;
-            goto LABEL_87;
+            //goto LABEL_87;
+            sub_41C0B8_set_status_string(v26);
+            if ( pMouse->uPointingObjectID == 0 )
+            {
+              if ( uLastPointedObjectID != 0 )
+              {
+                pStatusBarString[0] = 0;
+                bForceDrawStatusBar = 1;
+              }
+            }
+            uLastPointedObjectID = pMouse->uPointingObjectID;
+            return;
           }
           v22 = _444732_GetEventHintString(v25);
           if ( !v22 )
-            goto _return;
-          goto LABEL_93;
+            //goto _return;
+          {
+            if ( pMouse->uPointingObjectID == 0 )
+            {
+              if ( uLastPointedObjectID != 0 )
+              {
+                pStatusBarString[0] = 0;
+                bForceDrawStatusBar = 1;
+              }
+            }
+            uLastPointedObjectID = pMouse->uPointingObjectID;
+            return;
+          }
+          //goto LABEL_93;
+          v26 = v22;
+          //goto LABEL_87;
+          sub_41C0B8_set_status_string(v26);
+          if ( pMouse->uPointingObjectID == 0 )
+          {
+            if ( uLastPointedObjectID != 0 )
+            {
+              pStatusBarString[0] = 0;
+              bForceDrawStatusBar = 1;
+            }
+          }
+          uLastPointedObjectID = pMouse->uPointingObjectID;
+          return;
         }
         if ( (v18 & 7) == 6 )                   // bmodel
         {
@@ -5093,28 +5168,121 @@
             if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
             {
               v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID;
-              goto LABEL_71;
+              //goto LABEL_71;
+              if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 )
+                //goto LABEL_73;
+              {
+                pMouse->uPointingObjectID = 0;
+                //goto LABEL_50;
+                uLastPointedObjectID = 1;
+                if ( pMouse->uPointingObjectID == 0 )
+                {
+                  if ( uLastPointedObjectID != 0 )
+                  {
+                    pStatusBarString[0] = 0;
+                    bForceDrawStatusBar = 1;
+                  }
+                }
+                uLastPointedObjectID = pMouse->uPointingObjectID;
+                return;
+              }
+              //goto LABEL_93;
+              v26 = v22;
+              //goto LABEL_87;
+              sub_41C0B8_set_status_string(v26);
+              if ( pMouse->uPointingObjectID == 0 )
+              {
+                if ( uLastPointedObjectID != 0 )
+                {
+                  pStatusBarString[0] = 0;
+                  bForceDrawStatusBar = 1;
+                }
+              }
+              uLastPointedObjectID = pMouse->uPointingObjectID;
+              return;
             }
             pFace = &pIndoor->pFaces[v19];
             if ( BYTE3(pFace->uAttributes) & 6 )
             {
               v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
-LABEL_71:
+//LABEL_71:
               if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 )
-                goto LABEL_73;
-              goto LABEL_93;
+                //goto LABEL_73;
+              {
+                pMouse->uPointingObjectID = 0;
+                //goto LABEL_50;
+                uLastPointedObjectID = 1;
+                if ( pMouse->uPointingObjectID == 0 )
+                {
+                  if ( uLastPointedObjectID != 0 )
+                  {
+                    pStatusBarString[0] = 0;
+                    bForceDrawStatusBar = 1;
+                  }
+                }
+                uLastPointedObjectID = pMouse->uPointingObjectID;
+                return;
+              }
+              //goto LABEL_93;
+              v26 = v22;
+              //goto LABEL_87;
+              sub_41C0B8_set_status_string(v26);
+              if ( pMouse->uPointingObjectID == 0 )
+              {
+                if ( uLastPointedObjectID != 0 )
+                {
+                  pStatusBarString[0] = 0;
+                  bForceDrawStatusBar = 1;
+                }
+              }
+              uLastPointedObjectID = pMouse->uPointingObjectID;
+              return;
             }
           }
-LABEL_73:
+//LABEL_73:
           pMouse->uPointingObjectID = 0;
-          goto LABEL_50;
+          //goto LABEL_50;
+          uLastPointedObjectID = 1;
+          if ( pMouse->uPointingObjectID == 0 )
+          {
+            if ( uLastPointedObjectID != 0 )
+            {
+              pStatusBarString[0] = 0;
+              bForceDrawStatusBar = 1;
+            }
+          }
+          uLastPointedObjectID = pMouse->uPointingObjectID;
+          return;
         }
-LABEL_61:
+//LABEL_61:
         pMouse->uPointingObjectID = 0;
-        goto _return;
+        //goto _return;
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
       }
       if ( v18 >= 335544320 )
-        goto LABEL_61;
+        //goto LABEL_61;
+      {
+        pMouse->uPointingObjectID = 0;
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
+      }
       pActor = &pActors[v19];
       v28 = pTmpBuf;
       v29 = pActor->dword_000334_unique_name;
@@ -5125,9 +5293,19 @@
       strncpy(pTmpBuf, v40, 0x7D0u);
     }
     v26 = v28;
-LABEL_87:
+//LABEL_87:
     sub_41C0B8_set_status_string(v26);
-    goto _return;
+    //goto _return;
+    if ( pMouse->uPointingObjectID == 0 )
+    {
+      if ( uLastPointedObjectID != 0 )
+      {
+        pStatusBarString[0] = 0;
+        bForceDrawStatusBar = 1;
+      }
+    }
+    uLastPointedObjectID = pMouse->uPointingObjectID;
+    return;
   }
   v1 = uNumVisibleWindows;
   if ( uNumVisibleWindows <= 0 )
@@ -5136,21 +5314,43 @@
     if ( pCurrentScreen == 10 )
     {
       sub_42038D();
-      goto _return;
+      //goto _return;
+      if ( pMouse->uPointingObjectID == 0 )
+      {
+        if ( uLastPointedObjectID != 0 )
+        {
+          pStatusBarString[0] = 0;
+          bForceDrawStatusBar = 1;
+        }
+      }
+      uLastPointedObjectID = pMouse->uPointingObjectID;
+      return;
     }
     if ( pCurrentScreen == 13 )
     {
       if ( dword_F8B19C != 2
         || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
         || v16 == -65536 )
-        goto _return;
-      v15 = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
-LABEL_49:
-      v17 = v15->GetDisplayName();
+        //goto _return;
+      {
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
+       }
+      pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
+//LABEL_49:
+      v17 = pItemGen->GetDisplayName();
       sub_41C0B8_set_status_string(v17);
-LABEL_50:
+//LABEL_50:
       uLastPointedObjectID = 1;
-_return:
+//_return:
       if ( pMouse->uPointingObjectID == 0 )
       {
         if ( uLastPointedObjectID != 0 )
@@ -5166,9 +5366,34 @@
     {
       v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
       if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 )
-        goto _return;
-      v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5];
-      goto LABEL_49;
+        //goto _return;
+      {
+        if ( pMouse->uPointingObjectID == 0 )
+        {
+          if ( uLastPointedObjectID != 0 )
+          {
+            pStatusBarString[0] = 0;
+            bForceDrawStatusBar = 1;
+          }
+        }
+        uLastPointedObjectID = pMouse->uPointingObjectID;
+        return;
+      }
+      pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5];
+      //goto LABEL_49;
+      v17 = pItemGen->GetDisplayName();
+      sub_41C0B8_set_status_string(v17);
+      uLastPointedObjectID = 1;
+      if ( pMouse->uPointingObjectID == 0 )
+      {
+        if ( uLastPointedObjectID != 0 )
+        {
+          pStatusBarString[0] = 0;
+          bForceDrawStatusBar = 1;
+        }
+      }
+      uLastPointedObjectID = pMouse->uPointingObjectID;
+      return;
     }
 _click_on_game_ui:
     if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX
@@ -5176,147 +5401,91 @@
       && (signed int)pY >= (signed int)pWindowList[0].uFrameY
       && (signed int)pY <= (signed int)pWindowList[0].uFrameW )
     {
-      for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)0; i = i->pNext )
-      {
-        if ( i->uButtonType == 1 )
+      for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext )
+      {
+        if ( pButton->uButtonType == 1 )
         {
-          if ( (signed int)pX >= (signed int)i->uX
-            && (signed int)pX <= (signed int)i->uZ
-            && (signed int)pY >= (signed int)i->uY
-            && (signed int)pY <= (signed int)i->uW )
+          if ( (signed int)pX >= (signed int)pButton->uX
+            && (signed int)pX <= (signed int)pButton->uZ
+            && (signed int)pY >= (signed int)pButton->uY
+            && (signed int)pY <= (signed int)pButton->uW )
           {
-            v37 = (UIMessageType)i->field_1C;
-            if ( v37 == 0 )
-              goto LABEL_28;
-            v38 = i->uControlParam;
+            pMessageType3 = (UIMessageType)pButton->field_1C;
+            if ( pMessageType3 == 0 )
+              //goto LABEL_28;
+            {
+              v13 = pButton->pButtonName;
+              sub_41C0B8_set_status_string(v13);
+              uLastPointedObjectID = 1;
+              return;
+            }
+            v38 = pButton->uControlParam;
             if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
-              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v37;
+              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38;
               *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
             }
-            goto LABEL_131;
-          }
-        }
-        else
-        {
-          if ( i->uButtonType == 2 )
-          {
-            v45 = pX - i->uX;
-            v45 = pY - i->uY;
-
-            if (pX >= i->uX && pX <= i->uZ &&
-                pY >= i->uY && pY <= i->uW)
-            //if ( (double)(signed int)i->uWidth != 0.0 )
-            //{
-            //  if ( (double)(signed int)i->uHeight != 0.0 )
-            //  {
-                 //UNDEF(v32);
-                //if ( v33 | v34 )
-                {
-                  v35 = (UIMessageType)i->field_1C;
-                  if ( v35 != 0 )
-                  {
-                    v36 = i->uControlParam;
-                    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-                    {
-                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v35;
-                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
-                      *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-                      goto LABEL_27;
-                    }
-                  }
-                  goto LABEL_28;
-                //}
-              //}
-            }
-          }
-          else
-          {
-            if ( i->uButtonType == 3
-              && (signed int)pX >= (signed int)i->uX
-              && (signed int)pX <= (signed int)i->uZ
-              && (signed int)pY >= (signed int)i->uY
-              && (signed int)pY <= (signed int)i->uW )
-              goto LABEL_19;
-          }
-        }
-      }
-    }
-    pMouse->uPointingObjectID = sub_46A99B();
-    goto _return;
-  }
-  while ( 1 )                                   // some other fullscreen ui
-  {
-    v2 = &pWindowList[pVisibleWindowsIdxs[v1] - 1];
-    if ( (signed int)pX >= (signed int)v2->uFrameX
-      && (signed int)pX <= (signed int)v2->uFrameZ
-      && (signed int)pY >= (signed int)v2->uFrameY
-      && (signed int)pY <= (signed int)v2->uFrameW )
-    {
-      for ( i = v2->pControlsHead; ; i = i->pNext )
-      {
-        if ( !i )
-          break;
-        if ( i->uButtonType == 1 )
-        {
-          if ( (signed int)pX >= (signed int)i->uX
-            && (signed int)pX <= (signed int)i->uZ
-            && (signed int)pY >= (signed int)i->uY
-            && (signed int)pY <= (signed int)i->uW )
-          {
-LABEL_24:
-            v11 = (UIMessageType)i->field_1C;
-            if ( v11 )
-            {
-              v12 = i->uControlParam;
-              if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-              {
-                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v11;
-                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
-                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-LABEL_27:
-                ++pMessageQueue_50CBD0->uNumMessages;
-              }
-            }
-LABEL_28:
-            v13 = i->pButtonName;
-_set_status_and_ret:
-            sub_41C0B8_set_status_string(v13);
-LABEL_131:
+            //goto LABEL_131;
             uLastPointedObjectID = 1;
             return;
           }
         }
         else
         {
-          if ( i->uButtonType == 2 )
+          if ( pButton->uButtonType == 2 )
           {
-            v45 = pX - i->uX;
-            v45 = pY - i->uY;
-            if ( (double)(signed int)i->uWidth != 0.0 )
+            v45 = pX - pButton->uX;
+            v45 = pY - pButton->uY;
+
+            if (pX >= pButton->uX && pX <= pButton->uZ &&
+                pY >= pButton->uY && pY <= pButton->uW)
+            if ( (double)(signed int)pButton->uWidth != 0.0 )
             {
-              if ( (double)(signed int)i->uHeight != 0.0 )
+              if ( (double)(signed int)pButton->uHeight != 0.0 )
               {
-                //UNDEF(v8);
-                if ( v9 | v10 )
-                  goto LABEL_24;
+                 //UNDEF(v32);
+                if ( v33 | v34 )
+                {
+                  pMessageType2 = (UIMessageType)pButton->field_1C;
+                  if ( pMessageType2 != 0 )
+                  {
+                    v36 = pButton->uControlParam;
+                    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+                    {
+                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2;
+                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
+                      *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                      //goto LABEL_27;
+                      ++pMessageQueue_50CBD0->uNumMessages;
+                      v13 = pButton->pButtonName;
+                      sub_41C0B8_set_status_string(v13);
+                      uLastPointedObjectID = 1;
+                      return;
+                    }
+                  }
+                  //goto LABEL_28;
+                  v13 = pButton->pButtonName;
+                  sub_41C0B8_set_status_string(v13);
+                  uLastPointedObjectID = 1;
+                  return;
+                }
               }
             }
           }
-          else                                  // click on skill
+          else
           {
-            if ( i->uButtonType == 3
-              && (signed int)pX >= (signed int)i->uX
-              && (signed int)pX <= (signed int)i->uZ
-              && (signed int)pY >= (signed int)i->uY
-              && (signed int)pY <= (signed int)i->uW )
+            if ( pButton->uButtonType == 3
+              && (signed int)pX >= (signed int)pButton->uX
+              && (signed int)pX <= (signed int)pButton->uZ
+              && (signed int)pY >= (signed int)pButton->uY
+              && (signed int)pY <= (signed int)pButton->uW )
+              //goto LABEL_19;
             {
-LABEL_19:
-              v4 = pPlayers[uActiveCharacter];
-              v5 = LOBYTE(v4->pActiveSkills[i->uControlParam]);
-              v6 = v4->uSkillPoints;
+              pPlayer = pPlayers[uActiveCharacter];
+              v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]);
+              v6 = pPlayer->uSkillPoints;
               v7 = (v5 & 0x3F) + 1;
               if ( v6 < v7 )
               {
@@ -5330,13 +5499,139 @@
               }
               sprintf(Str1, v39, v41);
               v13 = Str1;
-              goto _set_status_and_ret;
+              //goto _set_status_and_ret;
+              sub_41C0B8_set_status_string(v13);
+              uLastPointedObjectID = 1;
+              return;
             }
           }
         }
       }
     }
-    if ( v2->uFrameHeight == 480 )
+    pMouse->uPointingObjectID = sub_46A99B();
+    //goto _return;
+    if ( pMouse->uPointingObjectID == 0 )
+    {
+      if ( uLastPointedObjectID != 0 )
+      {
+        pStatusBarString[0] = 0;
+        bForceDrawStatusBar = 1;
+      }
+    }
+    uLastPointedObjectID = pMouse->uPointingObjectID;
+    return;
+  }
+  while ( 1 )                                   // some other fullscreen ui
+  {
+    pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1];
+    if ( (signed int)pX >= (signed int)pWindow->uFrameX
+      && (signed int)pX <= (signed int)pWindow->uFrameZ
+      && (signed int)pY >= (signed int)pWindow->uFrameY
+      && (signed int)pY <= (signed int)pWindow->uFrameW )
+    {
+      for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
+      {
+        if ( !pButton )
+          break;
+        if ( pButton->uButtonType == 1 )
+        {
+          if ( (signed int)pX >= (signed int)pButton->uX
+            && (signed int)pX <= (signed int)pButton->uZ
+            && (signed int)pY >= (signed int)pButton->uY
+            && (signed int)pY <= (signed int)pButton->uW )
+          {
+//LABEL_24:
+            pMessageType1 = (UIMessageType)pButton->field_1C;
+            if ( pMessageType1 )
+            {
+              v12 = pButton->uControlParam;
+              if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+              {
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
+                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+//LABEL_27:
+                ++pMessageQueue_50CBD0->uNumMessages;
+              }
+            }
+//LABEL_28:
+            v13 = pButton->pButtonName;
+//_set_status_and_ret:
+            sub_41C0B8_set_status_string(v13);
+//LABEL_131:
+            uLastPointedObjectID = 1;
+            return;
+          }
+        }
+        else
+        {
+          if ( pButton->uButtonType == 2 )
+          {
+            v45 = pX - pButton->uX;
+            v45 = pY - pButton->uY;
+            if ( (double)(signed int)pButton->uWidth != 0.0 )
+            {
+              if ( (double)(signed int)pButton->uHeight != 0.0 )
+              {
+                //UNDEF(v8);
+                if ( v9 | v10 )
+                  //goto LABEL_24;
+                {
+                  pMessageType1 = (UIMessageType)pButton->field_1C;
+                  if ( pMessageType1 )
+                  {
+                    v12 = pButton->uControlParam;
+                    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+                    {
+                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
+                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
+                      *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                      ++pMessageQueue_50CBD0->uNumMessages;
+                    }
+                  }
+                  v13 = pButton->pButtonName;
+                  sub_41C0B8_set_status_string(v13);
+                  uLastPointedObjectID = 1;
+                  return;
+                }
+              }
+            }
+          }
+          else                                  // click on skill
+          {
+            if ( pButton->uButtonType == 3
+              && (signed int)pX >= (signed int)pButton->uX
+              && (signed int)pX <= (signed int)pButton->uZ
+              && (signed int)pY >= (signed int)pButton->uY
+              && (signed int)pY <= (signed int)pButton->uW )
+            {
+//LABEL_19:
+              pPlayer = pPlayers[uActiveCharacter];
+              v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]);
+              v6 = pPlayer->uSkillPoints;
+              v7 = (v5 & 0x3F) + 1;
+              if ( v6 < v7 )
+              {
+                v41 = v7 - v6;
+                v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here"
+              }
+              else
+              {
+                v41 = v7;
+                v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points"
+              }
+              sprintf(Str1, v39, v41);
+              v13 = Str1;
+              //goto _set_status_and_ret;
+              sub_41C0B8_set_status_string(v13);
+              uLastPointedObjectID = 1;
+              return;
+            }
+          }
+        }
+      }
+    }
+    if ( pWindow->uFrameHeight == 480 )
       break;
     --v1;
     if ( v1 <= 0 )
--- a/mm7_4.cpp	Tue Jan 15 18:42:42 2013 +0600
+++ b/mm7_4.cpp	Tue Jan 15 21:37:04 2013 +0600
@@ -5640,12 +5640,12 @@
 	  }
 	  else
 	  {
-		//while ( pText[v104] != 32 )
-		for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104)
+		while ( pText[v104] != 32 )
+		//for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104)
 		{
-		  //++v104;
-		  //if ( v104 >= (signed int)v103 )
-		   //break;
+		  ++v104;
+		  if ( v104 >= (signed int)pLenText )
+		   break;
 		}
 	  }
     }