diff UI/UiGame.cpp @ 2020:b123afb8246b

WritePointedObjectStatusString() clear
author Ritor1
date Mon, 11 Nov 2013 22:03:16 +0600
parents ab7d10b66503
children b60eaf28bf0c
line wrap: on
line diff
--- a/UI/UiGame.cpp	Mon Nov 11 21:01:54 2013 +0600
+++ b/UI/UiGame.cpp	Mon Nov 11 22:03:16 2013 +0600
@@ -1495,68 +1495,122 @@
       }
     }
   }//конец пределов основного экрана------------------------
-  if ( pX > 467 && pX <=639 && pY <= 479 )//пределы нижней области
+  if ( pX > 467 && pX <=639 && pY <= 479 )//пределы правой области
   {
     if ( pCurrentScreen == SCREEN_GAME )
+    {
       pWindow = &pWindowList[0];
-    else
-      pWindow = &pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 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 ( (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 )
       {
-        if ( !pButton )
-          break;
-        switch ( pButton->uButtonType )
+        for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
         {
-          case 1://for dialogue window
-            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 )
-            {
-              pMessageType1 = (UIMessageType)pButton->field_1C;
-              if ( pMessageType1 )
-                pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
-              GameUI_SetFooterString(pButton->pButtonName);
-              uLastPointedObjectID = 1;
-              return;
-            }
+          if ( !pButton )
             break;
-          case 2:
-            if ( pX >= pButton->uX && pX <= pButton->uZ
-              && pY >= pButton->uY && pY <= pButton->uW )
-            {
-              pMessageType1 = (UIMessageType)pButton->field_1C;
-              if ( pMessageType1 )
-                pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
-              GameUI_SetFooterString(pButton->pButtonName);
-              uLastPointedObjectID = 1;
-              return;
-            }
-            break;
-           case 3:// click on skill
-             if ( pX >= pButton->uX && pX <= pButton->uZ
-               && pY >= pButton->uY && pY <= pButton->uW )
-             {
-               v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
-               if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
-                 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
-               else
-                 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
-               GameUI_SetFooterString(Str1);
-               uLastPointedObjectID = 1;
-               return;
-             }
-             break;
+          switch ( pButton->uButtonType )
+          {
+            case 1://for dialogue window
+              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 )
+              {
+                pMessageType1 = (UIMessageType)pButton->field_1C;
+                if ( pMessageType1 )
+                  pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
+                GameUI_SetFooterString(pButton->pButtonName);
+                uLastPointedObjectID = 1;
+                return;
+              }
+              break;
+            case 2:
+              if ( pX >= pButton->uX && pX <= pButton->uZ
+                && pY >= pButton->uY && pY <= pButton->uW )
+              {
+                pMessageType1 = (UIMessageType)pButton->field_1C;
+                if ( pMessageType1 )
+                  pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
+                GameUI_SetFooterString(pButton->pButtonName);
+                uLastPointedObjectID = 1;
+                return;
+              }
+              break;
+            case 3:// click on skill
+              if ( pX >= pButton->uX && pX <= pButton->uZ
+                && pY >= pButton->uY && pY <= pButton->uW )
+              {
+                v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
+                if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
+                  sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
+                else
+                  sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
+                GameUI_SetFooterString(Str1);
+                uLastPointedObjectID = 1;
+                return;
+              }
+              break;
+          }
         }
       }
     }
-  //}
+    else
+    {
+      for ( v1 = uNumVisibleWindows; v1 > 0; --v1 )
+      {
+        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;
+            switch ( pButton->uButtonType )
+            {
+              case 1://for dialogue window
+                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 )
+                {
+                  pMessageType1 = (UIMessageType)pButton->field_1C;
+                  if ( pMessageType1 )
+                    pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
+                  GameUI_SetFooterString(pButton->pButtonName);
+                  uLastPointedObjectID = 1;
+                  return;
+                }
+                break;
+              case 2:
+                if ( pX >= pButton->uX && pX <= pButton->uZ
+                  && pY >= pButton->uY && pY <= pButton->uW )
+                {
+                  pMessageType1 = (UIMessageType)pButton->field_1C;
+                  if ( pMessageType1 )
+                    pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
+                  GameUI_SetFooterString(pButton->pButtonName);
+                  uLastPointedObjectID = 1;
+                  return;
+                }
+                break;
+              case 3:// click on skill
+                if ( pX >= pButton->uX && pX <= pButton->uZ
+                  && pY >= pButton->uY && pY <= pButton->uW )
+                {
+                  v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
+                  if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
+                    sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
+                  else
+                    sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
+                  GameUI_SetFooterString(Str1);
+                  uLastPointedObjectID = 1;
+                  return;
+                }
+                break;
+            }
+          }
+        }
+      }
+    }
   }
   if ( pX <= 467 && pY > 351 && pY <= 479 )//пределы нижней области
   {
-  //for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui
-  //{
     pWindow = &pWindowList[0];
     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 )
@@ -1608,9 +1662,8 @@
         }
       }
     }
-  //}
   }
-  //pMouse->uPointingObjectID = sub_46A99B();
+  //pMouse->uPointingObjectID = sub_46A99B(); //for software
   if ( pMouse->uPointingObjectID == 0 )
   {
     if ( uLastPointedObjectID != 0 )