comparison UI/UIGuilds.cpp @ 1524:58d15177edd0

m
author Ritor1
date Thu, 05 Sep 2013 13:12:53 +0600
parents ff2118028c71
children f47eab1a70d8
comparison
equal deleted inserted replaced
1523:53265d238d94 1524:58d15177edd0
70 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31 70 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
71 bool pSkillFlag; // [sp+2DCh] [bp-10h]@35 71 bool pSkillFlag; // [sp+2DCh] [bp-10h]@35
72 int v61; // [sp+2E0h] [bp-Ch]@35 72 int v61; // [sp+2E0h] [bp-Ch]@35
73 int pItemNum; 73 int pItemNum;
74 unsigned int v62; // [sp+2E4h] [bp-8h]@13 74 unsigned int v62; // [sp+2E4h] [bp-8h]@13
75 int v63; // [sp+2E8h] [bp-4h]@1 75 int pPrice; // [sp+2E8h] [bp-4h]@1
76 int pNumActivItem; 76 int pNumActivItem;
77 int all_text_height; 77 int all_text_height;
78 78
79 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow)); 79 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
80 working_window.uFrameX = 483; 80 working_window.uFrameX = 483;
81 working_window.uFrameWidth = 148; 81 working_window.uFrameWidth = 148;
82 working_window.uFrameZ = 334; 82 working_window.uFrameZ = 334;
83 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); 83 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
84 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu); 84 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
85 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0); 85 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0);
86 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; 86 pPrice = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
87 if ( v63 < base_teach_price / 3 ) 87 if ( pPrice < base_teach_price / 3 )
88 v63 = base_teach_price / 3; 88 pPrice = base_teach_price / 3;
89 strcpy(Dest, ""); 89 strcpy(Dest, "");
90 strcpy(v46, ""); 90 strcpy(v46, "");
91 strcpy(v47, ""); 91 strcpy(v47, "");
92 strcpy(v48, ""); 92 strcpy(v48, "");
93 strcpy(v49, ""); 93 strcpy(v49, "");
103 ShowStatusBarString(pTmpBuf.data(), 2); 103 ShowStatusBarString(pTmpBuf.data(), 2);
104 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 104 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
105 } 105 }
106 else 106 else
107 { 107 {
108 if ( pParty->uNumGold < v63 ) 108 if ( pParty->uNumGold < pPrice )
109 { 109 {
110 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold" 110 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); //"You don't have enough gold"
111 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful); 111 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
112 } 112 }
113 else 113 else
114 { 114 {
115 Party::TakeGold(v63); 115 Party::TakeGold(pPrice);
116 pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1; 116 pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
117 } 117 }
118 } 118 }
119 } 119 }
120 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); 120 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
121 return; 121 return;
122 } 122 }
123 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); 123 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
124 v6 = 0; 124 v6 = 0;
125 v62 = 0; 125 v62 = 0;
126 v63 = 32; 126 //pPrice = 32;
127 do 127 for ( pPrice = 32; pPrice < 452; pPrice += 70 )
128 { 128 {
129 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID) 129 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
130 { 130 {
131 pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]); 131 pRenderer->DrawTextureTransparent(pPrice, 90, ItemsInShopTexture[v6]);
132 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1); 132 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
133 } 133 }
134 v63 += 70; 134 //pPrice += 70;
135 v62 += 280; 135 v62 += 280;
136 ++v6; 136 ++v6;
137 } 137 }
138 while ( v63 < 452 ); 138 //while ( pPrice < 452 );
139 v62 = 1680; 139 v62 = 1680;
140 v7 = 6; 140 v7 = 6;
141 v63 = 32; 141 //pPrice = 32;
142 do 142 for ( pPrice = 32; pPrice < 452; pPrice += 70 )
143 { 143 {
144 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID) 144 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
145 { 145 {
146 pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]); 146 pRenderer->DrawTextureTransparent(pPrice, 250, ItemsInShopTexture[v7]);
147 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1); 147 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
148 } 148 }
149 v63 += 70; 149 //pPrice += 70;
150 v62 += 280; 150 v62 += 280;
151 ++v7; 151 ++v7;
152 } 152 }
153 while ( v63 < 452 ); 153 //while ( pPrice < 452 );
154 if ( HouseUI_CheckIfPlayerCanInteract() ) 154 if ( HouseUI_CheckIfPlayerCanInteract() )
155 { 155 {
156 v8 = 0; 156 v8 = 0;
157 v9 = 12; 157 //v9 = 12;
158 do 158 //do
159 for ( v9 = 12; v9; --v9 )
159 { 160 {
160 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID ) 161 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
161 ++v8; 162 ++v8;
162 --v9; 163 //--v9;
163 } 164 }
164 while ( v9 ); 165 //while ( v9 );
165 GetAsyncKeyState(17); 166 GetAsyncKeyState(17);
166 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" 167 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
167 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 168 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
168 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" 169 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
169 DrawTextAtStatusBar(statusbar_string, 0); 170 DrawTextAtStatusBar(statusbar_string, 0);
181 v14 = window_SpeakInHouse->ptr_1C; 182 v14 = window_SpeakInHouse->ptr_1C;
182 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14)); 183 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
183 v16 = (int)window_SpeakInHouse->ptr_1C; 184 v16 = (int)window_SpeakInHouse->ptr_1C;
184 uPlayerID = uActiveCharacter - 1; 185 uPlayerID = uActiveCharacter - 1;
185 v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, BuildingType_MagicShop, v16, 2); 186 v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, BuildingType_MagicShop, v16, 2);
186 v18 = BuildDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0); 187 v18 = BuildDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
187 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0); 188 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
188 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorWhite, v18, 3); 189 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorWhite, v18, 3);
189 return; 190 return;
190 } 191 }
191 } 192 }
246 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3); 247 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
247 return; 248 return;
248 } 249 }
249 if ( pSkillFlag ) 250 if ( pSkillFlag )
250 { 251 {
251 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu" 252 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPrice); //"Skill Cost: %lu"
252 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3); 253 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
253 } 254 }
254 v58 = (149 - all_text_height) / v61; 255 v58 = (149 - all_text_height) / v61;
255 if ( v58 > 32 ) 256 if ( v58 > 32 )
256 v58 = 32; 257 v58 = 32;