Mercurial > might-and-magic-trilogy
comparison GUIWindow.cpp @ 82:f9a33f75bae3
Qick Record
author | Nomad |
---|---|
date | Mon, 29 Oct 2012 00:41:51 +0200 |
parents | 30ec77bbd018 |
children | 2d5d13376e91 |
comparison
equal
deleted
inserted
replaced
77:8b0c4d626477 | 82:f9a33f75bae3 |
---|---|
143 return v9; | 143 return v9; |
144 } | 144 } |
145 | 145 |
146 | 146 |
147 //----- (0041D3B7) -------------------------------------------------------- | 147 //----- (0041D3B7) -------------------------------------------------------- |
148 char GUIWindow::_41D3B7() | 148 char GUIWindow::DrawQuickCharRecord() |
149 { | 149 { |
150 GUIWindow *v1; // edi@1 | |
151 Player *pPlayer; // esi@1 | 150 Player *pPlayer; // esi@1 |
152 int v3; // ecx@1 | |
153 SpellBuff *v4; // eax@1 | |
154 signed int v5; // ebx@1 | |
155 int v6; // eax@5 | 151 int v6; // eax@5 |
156 int v7; // ebx@5 | 152 int v7; // ebx@5 |
157 unsigned int v8; // ecx@5 | 153 unsigned int v8; // ecx@5 |
158 int v9; // ebx@5 | 154 int v9; // ebx@5 |
159 unsigned int v10; // eax@5 | 155 unsigned int v10; // eax@5 |
161 unsigned int v12; // ecx@5 | 157 unsigned int v12; // ecx@5 |
162 Texture *v13; // eax@6 | 158 Texture *v13; // eax@6 |
163 unsigned int v14; // eax@12 | 159 unsigned int v14; // eax@12 |
164 PlayerFrame *v15; // eax@12 | 160 PlayerFrame *v15; // eax@12 |
165 unsigned int v16; // eax@15 | 161 unsigned int v16; // eax@15 |
166 signed int v17; // ST28_4@15 | |
167 int v18; // ST24_4@15 | |
168 signed int v19; // eax@15 | |
169 unsigned int v20; // eax@15 | 162 unsigned int v20; // eax@15 |
170 int v21; // ST28_4@15 | |
171 int v22; // ST24_4@15 | |
172 int v23; // eax@15 | |
173 unsigned int v24; // eax@15 | 163 unsigned int v24; // eax@15 |
174 unsigned int v25; // eax@15 | 164 unsigned int v25; // eax@15 |
175 char *v26; // ST28_4@15 | |
176 signed int v27; // eax@15 | |
177 unsigned __int8 v28; // al@15 | 165 unsigned __int8 v28; // al@15 |
178 char *v29; // eax@16 | 166 char *v29; // eax@16 |
179 unsigned int v30; // esi@18 | |
180 SpellBuff *v31; // edx@18 | |
181 char *v32; // edi@18 | |
182 signed int v33; // ecx@19 | |
183 unsigned int v34; // eax@19 | |
184 __int64 v35; // ST38_8@22 | 167 __int64 v35; // ST38_8@22 |
185 int v36; // esi@22 | 168 int v36; // esi@22 |
186 const char *v37; // ST1C_4@22 | |
187 unsigned int v38; // eax@22 | 169 unsigned int v38; // eax@22 |
188 char *v39; // eax@24 | 170 char *v39; // eax@24 |
189 SpellBuff *v41; // [sp+14h] [bp-14h]@1 | |
190 GUIFont *a2; // [sp+18h] [bp-10h]@1 | |
191 GUIWindow *a1; // [sp+1Ch] [bp-Ch]@1 | |
192 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | 171 signed int uFramesetID; // [sp+20h] [bp-8h]@9 |
193 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | 172 int uFramesetIDa; // [sp+20h] [bp-8h]@18 |
194 const char **v46; // [sp+24h] [bp-4h]@18 | 173 |
195 | 174 pPlayer = &pParty->pPlayers[(unsigned int)ptr_1C]; |
196 v1 = this; | 175 |
197 a2 = pFontComic; | 176 uint numActivePlayerBuffs = 0; |
198 pPlayer = &pParty->pPlayers[(unsigned int)this->ptr_1C]; | 177 |
199 a1 = this; | 178 for (uint i = 0; i < 24; ++i) |
200 v3 = 0; | 179 if (pPlayer->pPlayerBuffs[i].uExpireTime > 0) |
201 v4 = pPlayer->pPlayerBuffs; | 180 ++numActivePlayerBuffs; |
202 v5 = 24; | 181 |
203 v41 = pPlayer->pPlayerBuffs; | 182 v6 = pFontArrus->uFontHeight + 162; |
204 do | 183 uFrameHeight = v6; |
205 { | 184 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; |
206 if ( (signed __int64)v4->uExpireTime > 0 ) | 185 v8 = uFrameX; |
207 ++v3; | |
208 ++v4; | |
209 --v5; | |
210 } | |
211 while ( v5 ); | |
212 v6 = LOBYTE(pFontArrus->uFontHeight) + 162; | |
213 v1->uFrameHeight = v6; | |
214 v7 = (v3 - 1) * LOBYTE(pFontArrus->uFontHeight); | |
215 v8 = v1->uFrameX; | |
216 v9 = v6 + v7; | 186 v9 = v6 + v7; |
217 v10 = v1->uFrameWidth; | 187 v10 = uFrameWidth; |
218 v1->uFrameHeight = v9; | 188 uFrameHeight = v9; |
219 v11 = v10 + v8 - 1; | 189 v11 = v10 + v8 - 1; |
220 v12 = v1->uFrameY; | 190 v12 = uFrameY; |
221 v1->uFrameZ = v11; | 191 uFrameZ = v11; |
222 v1->uFrameW = v9 + v12 - 1; | 192 uFrameW = v9 + v12 - 1; |
223 v1->DrawMessageBox(0); | 193 DrawMessageBox(0); |
224 if ( pPlayer->pConditions[16] ) | 194 if (pPlayer->Eradicated()) |
225 { | |
226 v13 = pTexture_PlayerFaceEradicated; | 195 v13 = pTexture_PlayerFaceEradicated; |
227 } | 196 else if (pPlayer->Dead()) |
197 v13 = pTexture_PlayerFaceDead; | |
228 else | 198 else |
229 { | 199 { |
230 if ( pPlayer->pConditions[14] ) | |
231 { | |
232 v13 = pTexture_PlayerFaceDead; | |
233 } | |
234 else | |
235 { | |
236 uFramesetID = pPlayerFrameTable->GetFrameIdBy_field0(pPlayer->uExpressionID); | 200 uFramesetID = pPlayerFrameTable->GetFrameIdBy_field0(pPlayer->uExpressionID); |
237 if ( !uFramesetID ) | 201 if ( !uFramesetID ) |
238 uFramesetID = 1; | 202 uFramesetID = 1; |
239 if ( pPlayer->uExpressionID == 21 ) | 203 if ( pPlayer->uExpressionID == 21 ) |
240 { | 204 { |
247 { | 211 { |
248 v14 = pMiscTimer->Time(); | 212 v14 = pMiscTimer->Time(); |
249 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); | 213 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); |
250 } | 214 } |
251 pPlayer->field_1AA2 = v15->uTextureID - 1; | 215 pPlayer->field_1AA2 = v15->uTextureID - 1; |
252 v13 = (Texture *)A74CEC_player_faces_minus1_indexing[v15->uTextureID + 56 * (unsigned int)v1->ptr_1C]; | 216 v13 = pTextures_PlayerFaces[(unsigned int)ptr_1C][v15->uTextureID]; |
253 } | 217 } |
254 } | 218 |
255 pRenderer->DrawTextureTransparent(v1->uFrameX + 24, v1->uFrameY + 24, v13); | 219 pRenderer->DrawTextureTransparent(uFrameX + 24, uFrameY + 24, v13); |
256 v16 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 220 v16 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
257 sprintfex(pTmpBuf, "\xC" "00000\n", v16); | 221 sprintf(pTmpBuf, "\xC%05d", v16); |
258 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->uClass]); | 222 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->uClass]); |
259 strcat(pTmpBuf, pTmpBuf2); | 223 strcat(pTmpBuf, pTmpBuf2); |
260 strcat(pTmpBuf, "\xC" "00000\n"); | 224 strcat(pTmpBuf, "\xC" "00000\n"); |
261 v17 = pPlayer->GetMaxHealth(); | 225 v20 = UI_GetHealthManaStringColor(pPlayer->sHealth, pPlayer->GetMaxHealth()); |
262 v18 = pPlayer->sHealth; | 226 sprintf(pTmpBuf2, "%s : \x0C" "%05u%d\x0C" "00000 / %d\n", pGlobalTXT_LocalizationStrings[108], |
263 v19 = pPlayer->GetMaxHealth(); | 227 v20, pPlayer->sHealth, pPlayer->GetMaxHealth()); |
264 v20 = sub_4178FE(pPlayer->sHealth, v19); | |
265 sprintfex(pTmpBuf2, "%s : ", pGlobalTXT_LocalizationStrings[108], v20, v18, v17); | |
266 strcat(pTmpBuf, pTmpBuf2); | 228 strcat(pTmpBuf, pTmpBuf2); |
267 v21 = pPlayer->GetMaxMana(); | 229 v24 = UI_GetHealthManaStringColor(pPlayer->sMana, pPlayer->GetMaxMana()); |
268 v22 = pPlayer->sMana; | 230 sprintf(pTmpBuf2, "%s : \x0C" "%05u%d\x0C" "00000 / %d\n", pGlobalTXT_LocalizationStrings[212], |
269 v23 = pPlayer->GetMaxMana(); | 231 v24, pPlayer->sMana, pPlayer->GetMaxMana()); |
270 v24 = sub_4178FE(pPlayer->sMana, v23); | |
271 sprintfex(pTmpBuf2, "%s : ", pGlobalTXT_LocalizationStrings[212], v24, v22, v21); | |
272 strcat(pTmpBuf, pTmpBuf2); | 232 strcat(pTmpBuf, pTmpBuf2); |
273 v25 = pPlayer->GetMajorConditionIdx(); | 233 v25 = pPlayer->GetMajorConditionIdx(); |
274 v26 = aCharacterConditionNames[v25]; | 234 sprintf(pTmpBuf2, "%s: \x0C" "%05d%s\x0C" "00000\n", pGlobalTXT_LocalizationStrings[47], |
275 v27 = GetConditionDrawColor(v25); | 235 GetConditionDrawColor(v25), aCharacterConditionNames[v25]); |
276 sprintfex(pTmpBuf2, "%s: ", pGlobalTXT_LocalizationStrings[47], v27, v26); | |
277 strcat(pTmpBuf, pTmpBuf2); | 236 strcat(pTmpBuf, pTmpBuf2); |
278 v28 = pPlayer->uQuickSpell; | 237 v28 = pPlayer->uQuickSpell; |
279 if ( v28 ) | 238 if ( v28 ) |
280 v29 = pSpellStats->pInfos[v28].pShortName; | 239 v29 = pSpellStats->pInfos[v28].pShortName; |
281 else | 240 else |
282 v29 = pGlobalTXT_LocalizationStrings[153]; | 241 v29 = pGlobalTXT_LocalizationStrings[153]; |
283 sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); | 242 sprintf(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); |
284 strcat(pTmpBuf, pTmpBuf2); | 243 strcat(pTmpBuf, pTmpBuf2); |
285 v30 = 0; | 244 DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); |
286 a1->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); | 245 |
287 v31 = v41; | |
288 uFramesetIDa = 0; | 246 uFramesetIDa = 0; |
289 v32 = &_4E2AD8_ui_colors[1]; | 247 for (uint i = 0; i < 24; ++i) |
290 v46 = (const char **)&aSpellNames[20]; | 248 { |
291 do | 249 auto buff = pPlayer->pPlayerBuffs + i; |
292 { | 250 if (buff->uExpireTime > 0) |
293 v33 = HIDWORD(v31->uExpireTime); | 251 { |
294 v34 = LODWORD(v31->uExpireTime); | 252 v35 = buff->uExpireTime - pParty->uTimePlayed; |
295 if ( v33 >= (signed int)v30 && (v33 > (signed int)v30 || v34 > v30) ) | 253 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; |
296 { | |
297 v35 = __PAIR__(v33, v34) - pParty->uTimePlayed; | |
298 v36 = uFramesetIDa++ * LOBYTE(a2->uFontHeight) + 134; | |
299 v37 = *v46; | |
300 v38 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( | 254 v38 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( |
301 (unsigned __int8)*(v32 - 1), | 255 _4E2AD8_ui_colors[i * 3], |
302 (unsigned __int8)*v32, | 256 _4E2AD8_ui_colors[i * 3 + 1], |
303 (unsigned __int8)v32[1]); | 257 _4E2AD8_ui_colors[i * 3 + 2]); |
304 a1->DrawText(a2, 52, v36, v38, v37, 0, 0, 0); | 258 DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); |
305 sub_41D20D_buff_remaining_time_string(v36, a1, v35, a2); | 259 sub_41D20D_buff_remaining_time_string(v36, this, v35, pFontComic); |
306 v31 = v41; | 260 } |
307 v30 = 0; | 261 } |
308 } | 262 |
309 ++v46; | |
310 ++v31; | |
311 v32 += 3; | |
312 v41 = v31; | |
313 } | |
314 while ( (signed int)v46 < (signed int)&dword_506978 ); | |
315 v39 = ""; | 263 v39 = ""; |
316 if ( uFramesetIDa == v30 ) | 264 if ( uFramesetIDa == 0 ) |
317 v39 = pGlobalTXT_LocalizationStrings[153]; | 265 v39 = pGlobalTXT_LocalizationStrings[153]; |
318 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); | 266 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); |
319 return a1->DrawText(pFontArrus, 14, 114, v30, pTmpBuf, v30, v30, v30); | 267 return DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0); |
320 } | 268 } |
321 | 269 |
322 //----- (0041D08F) -------------------------------------------------------- | 270 //----- (0041D08F) -------------------------------------------------------- |
323 void GUIWindow::_41D08F(int a2, int a3, int a4, int a5) | 271 void GUIWindow::_41D08F(int a2, int a3, int a4, int a5) |
324 { | 272 { |