comparison UiGame.cpp @ 1004:eac5af72b614

UI cleans
author Nomad
date Thu, 16 May 2013 15:14:58 +0200
parents 5876a9cafa3e
children 9ac94d00012e
comparison
equal deleted inserted replaced
1003:9318dd3f3711 1004:eac5af72b614
47 47
48 48
49 49
50 50
51 int uTextureID_GameUI_CharSelectionFrame; // 50C98C 51 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
52
53
54 //----- (0041D3B7) --------------------------------------------------------
55 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
56 {
57 //Player *pPlayer; // esi@1
58 int v6; // eax@5
59 int v7; // ebx@5
60 //unsigned int v8; // ecx@5
61 int v9; // ebx@5
62 //unsigned int v10; // eax@5
63 //int v11; // eax@5
64 //unsigned int v12; // ecx@5
65 Texture *v13; // eax@6
66 unsigned int v14; // eax@12
67 PlayerFrame *v15; // eax@12
68 //unsigned int v16; // eax@15
69 unsigned int v20; // eax@15
70 unsigned int v24; // eax@15
71 unsigned int v25; // eax@15
72 unsigned __int8 v28; // al@15
73 char *v29; // eax@16
74 __int64 v35; // ST38_8@22
75 int v36; // esi@22
76 unsigned int v38; // eax@22
77 char *v39; // eax@24
78 signed int uFramesetID; // [sp+20h] [bp-8h]@9
79 int uFramesetIDa; // [sp+20h] [bp-8h]@18
80
81 uint numActivePlayerBuffs = 0;
82 for (uint i = 0; i < 24; ++i)
83 if (player->pPlayerBuffs[i].uExpireTime > 0)
84 ++numActivePlayerBuffs;
85
86 v6 = pFontArrus->uFontHeight + 162;
87 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
88 v9 = v6 + v7;
89 window->uFrameHeight = v9;
90 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1;
91 window->uFrameW = v9 + window->uFrameY - 1;
92 window->DrawMessageBox(0);
93
94 if (player->Eradicated())
95 v13 = pTexture_PlayerFaceEradicated;
96 else if (player->Dead())
97 v13 = pTexture_PlayerFaceDead;
98 else
99 {
100 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression);
101 if ( !uFramesetID )
102 uFramesetID = 1;
103 if ( player->expression == CHARACTER_EXPRESSION_21)
104 {
105 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed);
106 }
107 else
108 {
109 v14 = pMiscTimer->Time();
110 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
111 }
112 player->field_1AA2 = v15->uTextureID - 1;
113 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
114 }
115
116 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
117
118 sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color);
119 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
120 strcat(pTmpBuf, pTmpBuf2);
121 strcat(pTmpBuf, "\f00000\n");
122
123 v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
124 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
125 pGlobalTXT_LocalizationStrings[108], // "Hit Points"
126 v20, player->sHealth, player->GetMaxHealth());
127 strcat(pTmpBuf, pTmpBuf2);
128
129 v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
130 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
131 pGlobalTXT_LocalizationStrings[212], // "Spell Points"
132 v24, player->sMana, player->GetMaxMana());
133 strcat(pTmpBuf, pTmpBuf2);
134
135 v25 = player->GetMajorConditionIdx();
136 sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n",
137 pGlobalTXT_LocalizationStrings[47], // "Condition
138 GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
139 strcat(pTmpBuf, pTmpBuf2);
140
141 v28 = player->uQuickSpell;
142 if ( v28 )
143 v29 = pSpellStats->pInfos[v28].pShortName;
144 else
145 v29 = pGlobalTXT_LocalizationStrings[153];
146 sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
147 strcat(pTmpBuf, pTmpBuf2);
148
149 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
150
151 uFramesetIDa = 0;
152 for (uint i = 0; i < 24; ++i)
153 {
154 auto buff = player->pPlayerBuffs + i;
155 if (buff->uExpireTime > 0)
156 {
157 v35 = buff->uExpireTime - pParty->uTimePlayed;
158 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
159 v38 = ui_game_character_record_playerbuff_colors[i];
160 window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
161 sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic);
162 }
163 }
164
165 v39 = "";
166 if ( uFramesetIDa == 0 )
167 v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
168 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
169 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
170 }
171
52 172
53 173
54 //----- (0041A57E) -------------------------------------------------------- 174 //----- (0041A57E) --------------------------------------------------------
55 void GameUI_QuickRef_Draw() 175 void GameUI_QuickRef_Draw()
56 { 176 {