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