comparison UiGame.cpp @ 1026:6afa77761a00

Слияние
author Ritor1
date Tue, 21 May 2013 12:43:08 +0600
parents 9ac94d00012e
children c94d6a37d298
comparison
equal deleted inserted replaced
1025:8b492d4722d4 1026:6afa77761a00
1 #include <assert.h> 1 #include <assert.h>
2 2
3 #include "MM7.h" 3 #include "MM7.h"
4 4
5 #include "BSPModel.h"
6 #include "LightmapBuilder.h"
7 #include "DecalBuilder.h"
8 #include "ParticleEngine.h"
9 #include "Mouse.h"
10 #include "Keyboard.h"
11 #include "IndoorCameraD3D.h"
12 #include "CShow.h"
13 #include "GammaControl.h"
14 #include "stru6.h"
15 #include "stru9.h"
16 #include "stru10.h"
17 #include "stru11.h"
18 #include "stru12.h"
19
20 #include "Vis.h"
5 #include "MapInfo.h" 21 #include "MapInfo.h"
6 #include "Game.h" 22 #include "Game.h"
7 #include "GUIWindow.h" 23 #include "GUIWindow.h"
8 #include "GUIFont.h" 24 #include "GUIFont.h"
9 #include "GUIProgressBar.h" 25 #include "GUIProgressBar.h"
47 63
48 64
49 65
50 66
51 int uTextureID_GameUI_CharSelectionFrame; // 50C98C 67 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
68
69
70 //----- (0041D3B7) --------------------------------------------------------
71 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
72 {
73 //Player *pPlayer; // esi@1
74 int v6; // eax@5
75 int v7; // ebx@5
76 //unsigned int v8; // ecx@5
77 int v9; // ebx@5
78 //unsigned int v10; // eax@5
79 //int v11; // eax@5
80 //unsigned int v12; // ecx@5
81 Texture *v13; // eax@6
82 unsigned int v14; // eax@12
83 PlayerFrame *v15; // eax@12
84 //unsigned int v16; // eax@15
85 unsigned int v20; // eax@15
86 unsigned int v24; // eax@15
87 unsigned int v25; // eax@15
88 unsigned __int8 v28; // al@15
89 char *v29; // eax@16
90 __int64 v35; // ST38_8@22
91 int v36; // esi@22
92 unsigned int v38; // eax@22
93 char *v39; // eax@24
94 signed int uFramesetID; // [sp+20h] [bp-8h]@9
95 int uFramesetIDa; // [sp+20h] [bp-8h]@18
96
97 uint numActivePlayerBuffs = 0;
98 for (uint i = 0; i < 24; ++i)
99 if (player->pPlayerBuffs[i].uExpireTime > 0)
100 ++numActivePlayerBuffs;
101
102 v6 = pFontArrus->uFontHeight + 162;
103 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
104 v9 = v6 + v7;
105 window->uFrameHeight = v9;
106 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1;
107 window->uFrameW = v9 + window->uFrameY - 1;
108 window->DrawMessageBox(0);
109
110 if (player->Eradicated())
111 v13 = pTexture_PlayerFaceEradicated;
112 else if (player->Dead())
113 v13 = pTexture_PlayerFaceDead;
114 else
115 {
116 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression);
117 if ( !uFramesetID )
118 uFramesetID = 1;
119 if ( player->expression == CHARACTER_EXPRESSION_21)
120 {
121 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed);
122 }
123 else
124 {
125 v14 = pMiscTimer->Time();
126 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
127 }
128 player->field_1AA2 = v15->uTextureID - 1;
129 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
130 }
131
132 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
133
134 sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color);
135 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
136 strcat(pTmpBuf, pTmpBuf2);
137 strcat(pTmpBuf, "\f00000\n");
138
139 v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
140 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
141 pGlobalTXT_LocalizationStrings[108], // "Hit Points"
142 v20, player->sHealth, player->GetMaxHealth());
143 strcat(pTmpBuf, pTmpBuf2);
144
145 v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
146 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
147 pGlobalTXT_LocalizationStrings[212], // "Spell Points"
148 v24, player->sMana, player->GetMaxMana());
149 strcat(pTmpBuf, pTmpBuf2);
150
151 v25 = player->GetMajorConditionIdx();
152 sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n",
153 pGlobalTXT_LocalizationStrings[47], // "Condition
154 GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
155 strcat(pTmpBuf, pTmpBuf2);
156
157 v28 = player->uQuickSpell;
158 if ( v28 )
159 v29 = pSpellStats->pInfos[v28].pShortName;
160 else
161 v29 = pGlobalTXT_LocalizationStrings[153];
162 sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
163 strcat(pTmpBuf, pTmpBuf2);
164
165 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
166
167 uFramesetIDa = 0;
168 for (uint i = 0; i < 24; ++i)
169 {
170 auto buff = player->pPlayerBuffs + i;
171 if (buff->uExpireTime > 0)
172 {
173 v35 = buff->uExpireTime - pParty->uTimePlayed;
174 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
175 v38 = ui_game_character_record_playerbuff_colors[i];
176 window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
177 sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic);
178 }
179 }
180
181 v39 = "";
182 if ( uFramesetIDa == 0 )
183 v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
184 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
185 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
186 }
187
52 188
53 189
54 //----- (0041A57E) -------------------------------------------------------- 190 //----- (0041A57E) --------------------------------------------------------
55 void GameUI_QuickRef_Draw() 191 void GameUI_QuickRef_Draw()
56 { 192 {