diff UI/UIGuilds.cpp @ 1526:f47eab1a70d8

UIHouses.cpp cleaning(continue)
author Ritor1
date Thu, 05 Sep 2013 18:05:50 +0600
parents 58d15177edd0
children 61458df2cb4f
line wrap: on
line diff
--- a/UI/UIGuilds.cpp	Thu Sep 05 13:31:15 2013 +0600
+++ b/UI/UIGuilds.cpp	Thu Sep 05 18:05:50 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
@@ -75,6 +74,7 @@
   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;
@@ -123,46 +123,36 @@
     pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
     v6 = 0;
     v62 = 0;
-    //pPrice = 32;
-    for ( pPrice = 32; pPrice < 452; pPrice += 70 )
+    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(pPrice, 90, ItemsInShopTexture[v6]);
+        pRenderer->DrawTextureTransparent(pX, 90, ItemsInShopTexture[v6]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
       }
-      //pPrice += 70;
       v62 += 280;
       ++v6;
     }
-    //while ( pPrice < 452 );
     v62 = 1680;
     v7 = 6;
-    //pPrice = 32;
-    for ( pPrice = 32; pPrice < 452; pPrice += 70 )
+    for ( pX = 32; pX < 452; pX += 70 )//расположение в нижнем ряду
     {
       if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
       {
-        pRenderer->DrawTextureTransparent(pPrice, 250, ItemsInShopTexture[v7]);
+        pRenderer->DrawTextureTransparent(pX, 250, ItemsInShopTexture[v7]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
       }
-      //pPrice += 70;
       v62 += 280;
       ++v7;
     }
-    //while ( pPrice < 452 );
     if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v8 = 0;
-      //v9 = 12;
-      //do
       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;
-        //--v9;
       }
-      //while ( v9 );
       GetAsyncKeyState(17);
       statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
       if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
@@ -170,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.field_50[window_SpeakInHouse->par1C] - pParty->uTimePlayed);//"Приходите через 14 дней"
         return;
       }
       v12 = pMouse->GetCursorPos(&v51);
@@ -196,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;
   }
@@ -266,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;
@@ -277,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
       {