diff UI/UIGuilds.cpp @ 1572:19f1735fca80

Слияние
author Ritor1
date Sun, 08 Sep 2013 17:07:58 +0600
parents 5cc08e71a308 9f8b3e904e14
children e1d1fe32c194
line wrap: on
line diff
--- a/UI/UIGuilds.cpp	Sun Sep 08 17:07:47 2013 +0600
+++ b/UI/UIGuilds.cpp	Sun Sep 08 17:07:58 2013 +0600
@@ -40,7 +40,6 @@
   int v26; // ecx@47
   GUIButton *pButton; // eax@49
   unsigned int v29; // eax@49
-  char *pText; // eax@52
   int pTextHeight; // eax@55
   unsigned int v32; // ecx@55
   int v33; // eax@55
@@ -72,9 +71,10 @@
   int v61; // [sp+2E0h] [bp-Ch]@35
   int pItemNum;
   unsigned int v62; // [sp+2E4h] [bp-8h]@13
-  int v63; // [sp+2E8h] [bp-4h]@1
+  int pPrice; // [sp+2E8h] [bp-4h]@1
   int pNumActivItem;
   int all_text_height;
+  int pX;
 
   memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
   working_window.uFrameX = 483;
@@ -83,9 +83,9 @@
   pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
   pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
   base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0);
-  v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
-  if ( v63 < base_teach_price / 3 )
-    v63 = base_teach_price / 3;
+  pPrice = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
+  if ( pPrice < base_teach_price / 3 )
+    pPrice = base_teach_price / 3;
   strcpy(Dest, "");
   strcpy(v46, "");
   strcpy(v47, "");
@@ -105,14 +105,14 @@
         }
         else
         {
-          if ( pParty->uNumGold < v63 )
+          if ( pParty->uNumGold < pPrice )
           {
-            ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold"
+            ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); //"You don't have enough gold"
             PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
           }
           else
           {
-            Party::TakeGold(v63);
+            Party::TakeGold(pPrice);
             pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
           }
         }
@@ -123,40 +123,34 @@
     pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
     v6 = 0;
     v62 = 0;
-    v63 = 32;
-    do
+    for ( pX = 32; pX < 452; pX += 70 )//   
     {
-      if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
+      if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID )
       {
-        pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
+        pRenderer->DrawTextureTransparent(pX, 90, ItemsInShopTexture[v6]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
       }
-      v63 += 70;
       v62 += 280;
       ++v6;
     }
-    while ( v63 < 452 );
     v62 = 1680;
     v7 = 6;
-    v63 = 32;
-    do
+    for ( pX = 32; pX < 452; pX += 70 )//   
     {
       if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
       {
-        pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
+        pRenderer->DrawTextureTransparent(pX, 250, ItemsInShopTexture[v7]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
       }
-      v63 += 70;
       v62 += 280;
       ++v7;
     }
-    while ( v63 < 452 );
     if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v8 = 0;
       for ( v9 = 12; v9; --v9 )
       {
-        if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
+        if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID > 0 )
           ++v8;
       }
       GetAsyncKeyState(17);
@@ -166,8 +160,7 @@
       DrawTextAtStatusBar(statusbar_string, 0);
       if ( !v8 )
       {
-        working_window.DrawCurrentTime(__PAIR__( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
-                       *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed);
+        working_window.DrawCurrentTime(pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C] - pParty->uTimePlayed);//"  14 "
         return;
       }
       v12 = pMouse->GetCursorPos(&v51);
@@ -180,7 +173,7 @@
         v16 = (int)window_SpeakInHouse->ptr_1C;
         uPlayerID = uActiveCharacter - 1;
         v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, BuildingType_MagicShop, v16,  2);
-        v18 = BuildDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);     
+        v18 = BuildDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
         v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
         working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138,  pColorWhite, v18, 3);
         return;
@@ -192,7 +185,7 @@
             guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
   { //you must me member
     v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
-    working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3u);
+    working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3);
     pDialogueWindow->pNumPresenceButton = 0;
     return;
   }
@@ -245,7 +238,7 @@
   }
   if ( pSkillFlag )
   {
-    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPrice); //"Skill Cost: %lu"
     working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
   }
   v58 = (149 - all_text_height) / v61;
@@ -262,9 +255,8 @@
       v29 = pButton->msg_param;
       if ( v29 == 18 )
       {
-        pText = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
         pButton->uY = v58 + v26;
-        pTextHeight = pFontArrus->CalcTextHeight(pText, &working_window, 0, 0);
+        pTextHeight = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0);
         v32 = pButton->uY;
         pButton->uHeight = pTextHeight;
         v33 = v32 + pTextHeight - 1;
@@ -273,7 +265,7 @@
         pTextColor = pColorYellow;
         if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
           pTextColor = pColorWhite;
-        working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pText, 3);
+        working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pGlobalTXT_LocalizationStrings[400], 3);//"Buy Spells"
       }
       else
       {
@@ -337,7 +329,7 @@
     ItemGen * item_spellbook = &pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i];
     item_spellbook->Reset();
     pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].uItemID = pItemNum;
-    pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].Identified();
+    pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].IsIdentified();
     ItemsInShopTexture[i] = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[pItemNum].pIconName, TEXTURE_16BIT_PALETTE);
   }
   return;