changeset 171:1e09ffc4b458

pControlID(work)
author Ritor1
date Fri, 14 Dec 2012 16:47:46 +0600
parents f089d88b6739
children 15ba5f459761 f87034a41fb8
files mm7_5.cpp
diffstat 1 files changed, 39 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_5.cpp	Thu Dec 13 17:22:39 2012 +0600
+++ b/mm7_5.cpp	Fri Dec 14 16:47:46 2012 +0600
@@ -15863,7 +15863,6 @@
         else
           v10 = pX - 414;
         pWindow.uFrameX = v10;
-        //goto LABEL_42;
 		pWindow.DrawMessageBox(0);
         goto LABEL_132;
       }
@@ -15891,7 +15890,6 @@
 LABEL_119:
           if ( (signed int)pX > 467 && pCurrentScreen != 14 )
           {
-//LABEL_126:
             identify_item();
             goto LABEL_132;
           }
@@ -15908,11 +15906,9 @@
             goto LABEL_132;
           }
           v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory
-//LABEL_125:
           if ( !v11 )
             goto LABEL_132;
-          //goto LABEL_126;
-		  identify_item();
+ 		  identify_item();
           goto LABEL_132;
         }
         if ( !dword_506364
@@ -15928,7 +15924,6 @@
         pWindow.uFrameWidth = LODWORD(v27);
         pWindow.uFrameX = pX + 5;
         pWindow.uFrameY = pY + 5;
-        //goto LABEL_41;
 		pWindow.uFrameHeight = 64;
         pAudioPlayer->StopChannels(-1, -1);
         pWindow.DrawMessageBox(0);
@@ -15986,10 +15981,8 @@
         pWindow.uFrameWidth = 256;
         pWindow.uFrameX = 130;
         pWindow.uFrameY = 140;
-//LABEL_41:
         pWindow.uFrameHeight = 64;
         pAudioPlayer->StopChannels(-1, -1);
-//LABEL_42:
         pWindow.DrawMessageBox(0);
         goto LABEL_132;
       }
@@ -16046,7 +16039,6 @@
   if ( pCurrentScreen != 21 )
   {
     v11 = pCurrentScreen == 23;
-    //goto LABEL_125;
     if ( !v11 )
       goto LABEL_132;
     identify_item();
@@ -16059,86 +16051,69 @@
   v13 = pY;
   //pStr = v29;
   pStr = 0;
-  //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;
-    switch (pControlID)
-	{
-	 case 0:
+    if ( pButton->uButtonType == 1 && 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 )
+    {
+     pControlID = pButton->uControlID;
+     switch (pControlID)
+	 {
+	 case 0: //stats info
       pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7];
       pStr = aAttributeNames[(signed int)pButton->uControlParam % 7];
-      goto LABEL_117;
-	 case 62:
+      break;
+	 case 62: //Plus button info 
       pStr = pGlobalTXT_LocalizationStrings[670];//Добавить
       pStr2 = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков"
 	  pWindow.Hint = pStr2;
-	  goto LABEL_117;
-	 case 63:
+	  break;
+	 case 63: //Minus button info
       pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть
       pStr2 = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков"
 	  pWindow.Hint = pStr2;
-	  goto LABEL_117;
-	 case 64: 
+	  break;
+	 case 64: //Available skill button info
       v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4);
       pStr = pSkillNames[v18];
       pWindow.Hint = pSkillDesc[v18];
       v13 = pY;
-	  goto LABEL_117;
-	 case 65: //ClassInfo
+	  break;
+	 case 65: //Available Class Info
       pWindow.Hint = pClassDescriptions[pButton->uControlParam];
       pStr = pClassNames[pButton->uControlParam];
-	  goto LABEL_117;
-     case 66: //OKInfo
+	  break;
+     case 66: //OK Info
       pStr2 = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры.
       pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК
 	  pWindow.Hint = pStr2;
-      goto LABEL_117;
-	 case 67: //
+      break;
+	 case 67: //Clear info
       pStr2 = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда.
       pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить
 	  pWindow.Hint = pStr2;
-      goto LABEL_117;
+      break;
+	 case 118: // Character info
+      v20 = pButton->uControlParam;
+      pStr = pParty->pPlayers[v20].pName;
+      pStr2 = pClassDescriptions[pParty->pPlayers[v20].uClass];
+      pWindow.Hint = pStr2;
+      break;
      }
-	if ( pControlID >=1 && pControlID <= 61 )
-	{
-	 pWindow.Hint = pStr2;
-	 goto LABEL_117;
-	}
-    if ( pControlID > 68 && pControlID <= 75 )
-    {
+     if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info
+     {
       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 ( (v21 & 0x80000000u) == 0 || (signed int)v21 < 37 )
+      {
+	   v22 = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)v21);
+       strcpy(pTmpBuf2, v22);
+       pWindow.Hint = pTmpBuf2;
+       pStr = pSkillNames[pY];
+	  }
      }
-	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;
-    }
-LABEL_117:;
-    //pButton = pButton->pNext;
-    //if ( !pButton )
-     // goto LABEL_112;
-  }
-LABEL_112:
+	}
+  }
   v23 = pWindow.Hint;
   if ( pWindow.Hint )
   {
@@ -16159,7 +16134,7 @@
     pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
     pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
     v25 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
-    sprintf(pTmpBuf, pStr, v25, format_4E2D80);
+    sprintf(pTmpBuf, pStr, v25, format_4E2D80);//sprintfex должен быть - не работает sprintfex(pTmpBuf, format_4E2D80, v25, pStr)
     pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3);
     pWindow.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v23, 0, 0, 0);
   }