annotate GUI/UI/UIQuickReference.cpp @ 2575:a76d408c5132 tip

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