diff UI/UIGuilds.cpp @ 1524:58d15177edd0

m
author Ritor1
date Thu, 05 Sep 2013 13:12:53 +0600
parents ff2118028c71
children f47eab1a70d8
line wrap: on
line diff
--- a/UI/UIGuilds.cpp	Thu Sep 05 13:12:30 2013 +0600
+++ b/UI/UIGuilds.cpp	Thu Sep 05 13:12:53 2013 +0600
@@ -72,7 +72,7 @@
   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;
 
@@ -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,45 +123,46 @@
     pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
     v6 = 0;
     v62 = 0;
-    v63 = 32;
-    do
+    //pPrice = 32;
+    for ( pPrice = 32; pPrice < 452; pPrice += 70 )
     {
       if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
       {
-        pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
+        pRenderer->DrawTextureTransparent(pPrice, 90, ItemsInShopTexture[v6]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
       }
-      v63 += 70;
+      //pPrice += 70;
       v62 += 280;
       ++v6;
     }
-    while ( v63 < 452 );
+    //while ( pPrice < 452 );
     v62 = 1680;
     v7 = 6;
-    v63 = 32;
-    do
+    //pPrice = 32;
+    for ( pPrice = 32; pPrice < 452; pPrice += 70 )
     {
       if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
       {
-        pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
+        pRenderer->DrawTextureTransparent(pPrice, 250, ItemsInShopTexture[v7]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
       }
-      v63 += 70;
+      //pPrice += 70;
       v62 += 280;
       ++v7;
     }
-    while ( v63 < 452 );
+    //while ( pPrice < 452 );
     if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v8 = 0;
-      v9 = 12;
-      do
+      //v9 = 12;
+      //do
+      for ( v9 = 12; v9; --v9 )
       {
         if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
           ++v8;
-        --v9;
+        //--v9;
       }
-      while ( v9 );
+      //while ( v9 );
       GetAsyncKeyState(17);
       statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
       if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
@@ -183,7 +184,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;
@@ -248,7 +249,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;