changeset 170:f089d88b6739

PopupWindow(work)
author Ritor1
date Thu, 13 Dec 2012 17:22:39 +0600
parents bf2956650e92
children 1e09ffc4b458
files mm7_5.cpp
diffstat 1 files changed, 72 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_5.cpp	Wed Dec 12 17:07:27 2012 +0600
+++ b/mm7_5.cpp	Thu Dec 13 17:22:39 2012 +0600
@@ -16059,100 +16059,85 @@
   v13 = pY;
   //pStr = v29;
   pStr = 0;
-  while ( 1 )
+  //while ( 1 )
+  for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext)
   {
     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;
     pControlID = pButton->uControlID;
-    if ( pControlID <= 65 )
-    {
-      if ( pControlID == 65 )
-      {
-        pWindow.Hint = pClassDescriptions[pButton->uControlParam];
-        pStr = pClassNames[pButton->uControlParam];
-      }
-      else
-      {
-        if ( pControlID )
-        {
-          v16 = pControlID - 62;
-          if ( v16 )
-          {
-            v17 = v16 - 1;
-            if ( v17 )
-            {
-              if ( v17 == 1 )
-              {
-                v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4);
-                pStr = pSkillNames[v18];
-                pWindow.Hint = pSkillDesc[v18];
-                v13 = pY;
-              }
-              goto LABEL_117;
-            }
-            pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть
-            pStr2 = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков"
-          }
-          else
-          {
-            pStr = pGlobalTXT_LocalizationStrings[670];//Добавить
-            pStr2 = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков"
-          }
-          //goto LABEL_116;
-		  pWindow.Hint = pStr2;
-		  goto LABEL_117;
-        }
-        pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7];
-        pStr = aAttributeNames[(signed int)pButton->uControlParam % 7];
+    switch (pControlID)
+	{
+	 case 0:
+      pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7];
+      pStr = aAttributeNames[(signed int)pButton->uControlParam % 7];
+      goto LABEL_117;
+	 case 62:
+      pStr = pGlobalTXT_LocalizationStrings[670];//Добавить
+      pStr2 = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков"
+	  pWindow.Hint = pStr2;
+	  goto LABEL_117;
+	 case 63:
+      pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть
+      pStr2 = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков"
+	  pWindow.Hint = pStr2;
+	  goto LABEL_117;
+	 case 64: 
+      v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4);
+      pStr = pSkillNames[v18];
+      pWindow.Hint = pSkillDesc[v18];
+      v13 = pY;
+	  goto LABEL_117;
+	 case 65: //ClassInfo
+      pWindow.Hint = pClassDescriptions[pButton->uControlParam];
+      pStr = pClassNames[pButton->uControlParam];
+	  goto LABEL_117;
+     case 66: //OKInfo
+      pStr2 = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры.
+      pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК
+	  pWindow.Hint = pStr2;
+      goto LABEL_117;
+	 case 67: //
+      pStr2 = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда.
+      pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить
+	  pWindow.Hint = pStr2;
+      goto LABEL_117;
+     }
+	if ( pControlID >=1 && pControlID <= 61 )
+	{
+	 pWindow.Hint = pStr2;
+	 goto LABEL_117;
+	}
+    if ( pControlID > 68 && pControlID <= 75 )
+    {
+      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(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)v21);
+      strcpy(pTmpBuf2, v22);
+      pWindow.Hint = pTmpBuf2;
+      pStr = pSkillNames[pY];
+      goto LABEL_117;
+     }
+	if ( pControlID > 75 )
+    {
+      if ( pControlID == 118 )
+      {
+        v20 = pButton->uControlParam;
+        pStr = pParty->pPlayers[v20].pName;
+        pStr2 = pClassDescriptions[pParty->pPlayers[v20].uClass];
+        pWindow.Hint = pStr2;
+        goto LABEL_117;
       }
       goto LABEL_117;
     }
-    if ( pControlID == 66 )
-    {
-      pStr2 = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры.
-      pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК
-      //goto LABEL_116;
-	  pWindow.Hint = pStr2;
-      goto LABEL_117;
-    }
-    if ( pControlID == 67 )
-    {
-      pStr2 = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда.
-      pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить
-      //goto LABEL_116;
-	  pWindow.Hint = pStr2;
-      goto LABEL_117;
-    }
-    if ( pControlID > 71 )
-      break;
-LABEL_117:
-    pButton = pButton->pNext;
-    if ( !pButton )
-      goto LABEL_112;
-  }
-  if ( pControlID > 75 )
-  {
-    if ( pControlID == 118 )
-    {
-      v20 = pButton->uControlParam;
-      pStr = pParty->pPlayers[v20].pName;
-      pStr2 = pClassDescriptions[pParty->pPlayers[v20].uClass];
-//LABEL_116:
-      pWindow.Hint = pStr2;
-      goto LABEL_117;
-    }
-    goto LABEL_117;
-  }
-  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(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)v21);
-  strcpy(pTmpBuf2, v22);
-  pWindow.Hint = pTmpBuf2;
-  pStr = pSkillNames[pY];
+LABEL_117:;
+    //pButton = pButton->pNext;
+    //if ( !pButton )
+     // goto LABEL_112;
+  }
 LABEL_112:
   v23 = pWindow.Hint;
   if ( pWindow.Hint )
@@ -16174,7 +16159,7 @@
     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);
+    sprintf(pTmpBuf, pStr, v25, format_4E2D80);
     pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3);
     pWindow.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v23, 0, 0, 0);
   }