2547
|
1 #include "Engine/Engine.h"
|
2574
|
2 #include "Engine/AssetsManager.h"
|
2547
|
3 #include "Engine/Timer.h"
|
|
4 #include "Engine/LOD.h"
|
|
5 #include "Engine/texts.h"
|
|
6 #include "Engine/Party.h"
|
|
7 #include "Engine/Graphics/IRender.h"
|
|
8
|
|
9 #include "GUI/GUIFont.h"
|
|
10 #include "GUI/UI/UIQuickReference.h"
|
2574
|
11 #include "GUI/UI/UICharacter.h"
|
2547
|
12
|
|
13 #include "Media/Audio/AudioPlayer.h"
|
|
14
|
2575
|
15
|
|
16 Image *ui_game_quickref_background = nullptr;
|
|
17
|
2547
|
18 GUIWindow_QuickReference::GUIWindow_QuickReference() :
|
|
19 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 5, 0)
|
|
20 {
|
|
21 // 004304E7 Game_EventLoop --- part
|
|
22 pEventTimer->Pause();
|
|
23 pAudioPlayer->StopChannels(-1, -1);
|
|
24 current_screen_type = SCREEN_QUICK_REFERENCE;
|
2574
|
25
|
|
26 //paperdoll_dbrds[2] = assets->GetImage_16BitAlpha(L"BUTTEXI1");
|
|
27
|
2575
|
28 if (!ui_game_quickref_background)
|
|
29 ui_game_quickref_background = assets->GetImage_16BitColorKey("quikref", 0x7FF);
|
|
30
|
2547
|
31 pBtn_ExitCancel = CreateButton(
|
|
32 0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
|
|
33 pGlobalTXT_LocalizationStrings[79],// "Exit"
|
2574
|
34 ui_buttdesc2,
|
2547
|
35 0
|
|
36 ); //, v179);
|
|
37 }
|
|
38
|
|
39 void GUIWindow_QuickReference::Update()
|
|
40 {
|
|
41 // -----------------------------------
|
|
42 // 004156F0 GUI_UpdateWindows --- part
|
|
43 // {
|
|
44 // GameUI_QuickRef_Draw();
|
|
45 // }
|
|
46
|
|
47 //----- (0041A57E) --------------------------------------------------------
|
|
48 //void GameUI_QuickRef_Draw()
|
|
49
|
|
50 unsigned int pTextColor; // eax@7
|
|
51 unsigned int pX; // [sp+14h] [bp-18h]@2
|
|
52 unsigned int pY; // edi@9
|
|
53 int pSkillsCount; // ecx@27
|
|
54 const char *pText; // eax@38
|
|
55 int pFontHeight; // [sp+18h] [bp-14h]@1
|
|
56
|
2575
|
57 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_game_quickref_background);
|
|
58
|
2547
|
59 pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1;
|
|
60 for (uint i = 0; i < 4; ++i)
|
|
61 {
|
|
62 Player* player = &pParty->pPlayers[i];
|
|
63 pX = 94 * i + 89;
|
|
64 if (i == 0)
|
|
65 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 18, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name
|
|
66 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * i + 89, 18, ui_character_header_text_color, player->pName, 84, 0);
|
|
67 if (i == 0)
|
|
68 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 47, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Уров.
|
|
69 sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel());
|
|
70 if (player->GetActualLevel() <= player->GetBaseLevel())
|
|
71 pTextColor = player->GetExperienceDisplayColor();
|
|
72 else
|
|
73 pTextColor = ui_character_bonus_text_color;
|
|
74 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, 47, pTextColor, pTmpBuf.data(), 84, 0);
|
|
75 pY = pFontHeight + 47;
|
|
76 if (i == 0)
|
|
77 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pFontHeight + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Класс
|
|
78 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0);
|
|
79 pY = pFontHeight + pY;
|
|
80 if (i == 0)
|
|
81 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Здор.
|
|
82 sprintf(pTmpBuf.data(), "%d", player->sHealth);
|
|
83 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth());
|
|
84 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
|
|
85 pY = pFontHeight + pY;
|
|
86 if (i == 0)
|
|
87 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Мана
|
|
88 sprintf(pTmpBuf.data(), "%d", player->sMana);
|
|
89 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana());
|
|
90 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
|
|
91 pY = pFontHeight + pY;
|
|
92 if (i == 0)
|
|
93 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Класс брони
|
|
94 sprintf(pTmpBuf.data(), "%d", player->GetActualAC());
|
|
95 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC());
|
|
96 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
|
|
97 pY = pFontHeight + pY;
|
|
98 if (!i)
|
|
99 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Атака
|
|
100 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(false));
|
|
101 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
|
|
102 pY = pFontHeight + pY;
|
|
103 if (!i)
|
|
104 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
|
|
105 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetMeleeDamageString(), 84, 0);
|
|
106 pY = pFontHeight + pY;
|
|
107 if (!i)
|
|
108 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Стрелять
|
|
109 sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack());
|
|
110 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
|
|
111 pY = pFontHeight + pY;
|
|
112 if (!i)
|
|
113 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
|
|
114 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetRangedDamageString(), 84, 0);
|
|
115 pY = pFontHeight + pY;
|
|
116 if (!i)
|
|
117 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Навыки
|
|
118 pSkillsCount = 0;
|
|
119 for (uint j = 0; j <= 36; ++j)
|
|
120 {
|
|
121 if (player->pActiveSkills[j])
|
|
122 ++pSkillsCount;
|
|
123 }
|
|
124 sprintf(pTmpBuf.data(), "%lu", pSkillsCount);
|
|
125 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
|
|
126 pY = pFontHeight + pY;
|
|
127 if (!i)
|
|
128 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Очки
|
|
129 sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints);
|
|
130 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0);
|
|
131 pY = pFontHeight + pY;
|
|
132 if (!i)
|
|
133 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Сост.
|
|
134 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, aCharacterConditionNames[player->GetMajorConditionIdx()], 84, 0);
|
|
135 pY = pFontHeight + pY;
|
|
136 if (!i)
|
|
137 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Б.Прим.
|
|
138 if (player->uQuickSpell)
|
|
139 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName;
|
|
140 else
|
|
141 pText = pGlobalTXT_LocalizationStrings[153];//Нет
|
|
142 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pText, 84, 0);
|
|
143 }
|
|
144
|
|
145 if (pParty->GetPartyReputation() >= 0)
|
|
146 {
|
|
147 if (pParty->GetPartyReputation() <= 5)
|
|
148 pTextColor = ui_character_default_text_color;
|
|
149 else
|
|
150 pTextColor = ui_character_bonus_text_color_neg;
|
|
151 }
|
|
152 else
|
|
153 pTextColor = ui_character_bonus_text_color;
|
|
154
|
|
155 sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], pTextColor, GetReputationString(pParty->GetPartyReputation()));//Reputation
|
|
156 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0);
|
|
157 sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Слава
|
|
158 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0);
|
|
159 } |