Mercurial > mm7
annotate GUI/UI/UISaveLoad.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 |
---|---|
2501 | 1 #define _CRTDBG_MAP_ALLOC |
2547 | 2 #define _CRT_SECURE_NO_WARNINGS |
2501 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 #include <io.h> | |
6 | |
2541 | 7 #include "Engine/Engine.h" |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
8 #include "Engine/AssetsManager.h" |
2547 | 9 #include "Engine/MapInfo.h" |
10 #include "Engine/Graphics/Render.h" | |
11 #include "Engine/LOD.h" | |
12 #include "Engine/SaveLoad.h" | |
13 #include "Engine/texts.h" | |
2501 | 14 |
2547 | 15 #include "IO/Keyboard.h" |
16 | |
17 #include "GUI/GUIFont.h" | |
18 #include "GUI/UI/UISaveLoad.h" | |
2501 | 19 |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
20 #include "Game/MainMenu.h" |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
21 |
2547 | 22 void UI_DrawSaveLoad(bool save); |
23 | |
24 | |
2574 | 25 Image *saveload_ui_save_up = nullptr; |
26 Image *saveload_ui_load_up = nullptr; | |
27 Image *saveload_ui_loadsave = nullptr; | |
28 Image *saveload_ui_saveu = nullptr; | |
29 Image *saveload_ui_loadu = nullptr; | |
30 Image *saveload_ui_x_u = nullptr; | |
31 Image *saveload_ui_ls_saved = nullptr; | |
32 Image *saveload_ui_x_d = nullptr; | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
33 |
2547 | 34 GUIWindow_Save::GUIWindow_Save() : |
35 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | |
36 { | |
37 // ------------------------------------------------ | |
38 // 0045E93E SaveUI_Load(enum CURRENT_SCREEN screen) | |
39 char *v3; // eax@7 | |
40 LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 | |
41 | |
42 ++pIcons_LOD->uTexturePacksCount; | |
43 if (!pIcons_LOD->uNumPrevLoadedFiles) | |
44 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
45 memset(&pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots)); | |
46 memset(&pSavegameThumbnails, 0, sizeof(pSavegameThumbnails)); | |
2574 | 47 saveload_ui_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); |
48 saveload_ui_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); | |
49 saveload_ui_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); | |
50 saveload_ui_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); | |
51 saveload_ui_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); | |
52 saveload_ui_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
53 |
2574 | 54 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); |
2547 | 55 |
56 //if (screen == SCREEN_SAVEGAME) | |
57 { | |
2574 | 58 pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, saveload_ui_saveu); |
59 pRenderer->DrawTextureAlphaNew(351/640.0f, 302/480.0f, saveload_ui_x_u); | |
60 pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, saveload_ui_save_up); | |
2547 | 61 } |
62 /*else | |
63 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
64 pRenderer->DrawTextureTransparentColorKey(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU)); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
65 pRenderer->DrawTextureTransparentColorKey(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
66 pRenderer->DrawTextureTransparentColorKey(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); |
2547 | 67 }*/ |
68 | |
69 //pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);//Read...(Чтение...) | |
70 pRenderer->Present(); | |
71 pSavegameList->Initialize(1); | |
72 pLODFile.AllocSubIndicesAndIO(300, 0); | |
73 for (uint i = 0; i < 40; ++i) | |
74 { | |
75 v3 = pSavegameList->pFileList[i].pSaveFileName; | |
76 if (!*pSavegameList->pFileList[i].pSaveFileName) | |
77 v3 = "1.mm7"; | |
78 sprintf(pTmpBuf.data(), "saves\\%s", v3); | |
79 if (_access(pTmpBuf.data(), 0) || _access(pTmpBuf.data(), 6)) | |
80 { | |
81 pSavegameUsedSlots[i] = 0; | |
82 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[LOCSTR_EMPTY]); | |
83 } | |
84 else | |
85 { | |
86 pLODFile.LoadFile(pTmpBuf.data(), 1); | |
87 fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", 1)); | |
88 if (pLODFile.FindContainer("image.pcx", 1)) | |
89 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
90 //pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", 1), 0, 1); |
2547 | 91 pLODFile.CloseWriteFile(); |
92 pSavegameUsedSlots[i] = 1; | |
93 } | |
94 else | |
95 pSavegameUsedSlots[i] = 0; | |
96 } | |
97 } | |
98 pLODFile.FreeSubIndexAndIO(); | |
2574 | 99 |
100 if (!saveload_ui_x_d) | |
101 saveload_ui_x_d = assets->GetImage_16BitAlpha("x_d"); | |
102 if (!saveload_ui_ls_saved) | |
103 saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_saveD"); | |
104 if (!ui_ar_up_dn) | |
105 ui_ar_up_dn = assets->GetImage_16BitAlpha("ar_up_dn"); | |
106 if (!ui_ar_dn_dn) | |
107 ui_ar_dn_dn = assets->GetImage_16BitAlpha("ar_dn_dn"); | |
108 | |
2547 | 109 |
110 // ----------------------------- | |
111 // GUIWindow_Save c-tor --- part | |
112 CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); | |
113 CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); | |
114 CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); | |
115 CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); | |
116 CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); | |
117 CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); | |
118 CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); | |
2574 | 119 |
120 pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", saveload_ui_ls_saved, 0); | |
121 pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", saveload_ui_x_d, 0); | |
122 pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", ui_ar_up_dn, 0); | |
123 pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", ui_ar_dn_dn, 0); | |
2547 | 124 } |
125 | |
126 | |
127 void GUIWindow_Save::Update() | |
128 { | |
129 // ----------------------------------- | |
130 // 004156F0 GUI_UpdateWindows --- part | |
131 // { | |
132 // SaveUI_Draw(); | |
133 // } | |
134 | |
135 // ----- (004606FE) -------------------------------------------------------- | |
136 // void SaveUI_Draw() | |
137 // { | |
138 UI_DrawSaveLoad(true); | |
139 } | |
140 | |
141 | |
142 | |
143 | |
144 GUIWindow_Load::GUIWindow_Load(bool ingame) : | |
145 GUIWindow(0, 0, 0, 0, 0, nullptr) | |
146 { | |
147 // ----- (0045E361) -------------------------------------------------------- | |
148 // void LoadUI_Load(unsigned int uDialogueType) | |
149 // { | |
150 current_screen_type = SCREEN_LOADGAME; | |
151 | |
152 LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 | |
153 | |
154 dword_6BE138 = -1; | |
155 pIcons_LOD->_inlined_sub2(); | |
156 | |
157 memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
158 memset(pSavegameThumbnails.data(), 0, 45 * sizeof(Image *)); |
2574 | 159 saveload_ui_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); |
160 saveload_ui_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); | |
161 saveload_ui_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); | |
162 saveload_ui_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); | |
163 saveload_ui_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); | |
164 saveload_ui_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
165 |
2547 | 166 if (ingame) |
167 { | |
2574 | 168 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); |
2547 | 169 if (current_screen_type == SCREEN_SAVEGAME) |
170 { | |
2574 | 171 pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, saveload_ui_saveu); |
172 pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, saveload_ui_save_up); | |
2547 | 173 } |
174 else | |
175 { | |
2574 | 176 pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_loadu); |
177 pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, saveload_ui_load_up); | |
2547 | 178 } |
2574 | 179 pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u); |
2547 | 180 } |
181 else | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
182 pRenderer->DrawTextureNew(0, 0, main_menu_background); |
2547 | 183 |
184 | |
185 /*pGUIWindow_CurrentMenu = new GUIWindow_Load( | |
186 saveload_dlg_xs[uDialogueType], | |
187 saveload_dlg_ys[uDialogueType], | |
188 saveload_dlg_zs[uDialogueType], | |
189 saveload_dlg_ws[uDialogueType], 0, 0);*/ | |
190 | |
191 // GUIWindow::GUIWindow | |
192 this->uFrameX = saveload_dlg_xs[ingame ? 1 : 0]; | |
193 this->uFrameY = saveload_dlg_ys[ingame ? 1 : 0]; | |
194 this->uFrameWidth = saveload_dlg_zs[ingame ? 1 : 0]; | |
195 this->uFrameHeight = saveload_dlg_ws[ingame ? 1 : 0]; | |
196 this->uFrameZ = uFrameX + uFrameWidth - 1; | |
197 this->uFrameW = uFrameY + uFrameHeight - 1; | |
198 | |
199 | |
200 | |
201 DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." | |
202 pRenderer->Present(); | |
203 pSavegameList->Initialize(0); | |
204 if (pSaveListPosition > (signed int)uNumSavegameFiles) | |
205 { | |
206 pSaveListPosition = 0; | |
207 uLoadGameUI_SelectedSlot = 0; | |
208 } | |
209 pLODFile.AllocSubIndicesAndIO(300, 0); | |
210 Assert(sizeof(SavegameHeader) == 100); | |
211 for (uint i = 0; i < uNumSavegameFiles; ++i) | |
212 { | |
213 sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[i].pSaveFileName); | |
214 if (_access(pTmpBuf.data(), 6)) | |
215 { | |
216 pSavegameUsedSlots[i] = 0; | |
217 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" | |
218 continue; | |
219 } | |
220 pLODFile.LoadFile(pTmpBuf.data(), 1); | |
221 if (pLODFile.FindContainer("header.bin", true)) | |
222 fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", true)); | |
223 if (!_stricmp(pSavegameList->pFileList[i].pSaveFileName, pGlobalTXT_LocalizationStrings[613]))// "AutoSave.MM7" | |
224 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[16]);// "Autosave" | |
225 if (!pLODFile.FindContainer("image.pcx", true)) | |
226 { | |
227 pSavegameUsedSlots[i] = 0; | |
228 strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); | |
229 } | |
230 else | |
231 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
232 //pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", true), 0, true); |
2547 | 233 pLODFile.CloseWriteFile(); |
234 pSavegameUsedSlots[i] = 1; | |
235 } | |
236 } | |
237 | |
238 pLODFile.FreeSubIndexAndIO(); | |
2574 | 239 |
240 saveload_ui_x_d = assets->GetImage_16BitAlpha("x_d"); | |
241 | |
242 if (saveload_ui_ls_saved) | |
2547 | 243 { |
2574 | 244 saveload_ui_ls_saved->Release(); |
245 saveload_ui_ls_saved = nullptr; | |
2547 | 246 } |
2574 | 247 if (current_screen_type == SCREEN_SAVEGAME) |
248 saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_saveD"); | |
2547 | 249 else |
2574 | 250 saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_loadD"); |
251 | |
252 if (!ui_ar_up_dn) | |
253 ui_ar_up_dn = assets->GetImage_16BitAlpha("AR_UP_DN"); | |
254 if (!ui_ar_dn_dn) | |
255 ui_ar_dn_dn = assets->GetImage_16BitAlpha("AR_DN_DN"); | |
256 | |
2547 | 257 CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); |
258 CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); | |
259 CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); | |
260 CreateButton(21, 261, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); | |
261 CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); | |
262 CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); | |
263 CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); | |
2574 | 264 |
265 pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", saveload_ui_ls_saved, 0); | |
266 pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", saveload_ui_x_d, 0); | |
267 pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", ui_ar_up_dn, 0); | |
268 pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", ui_ar_dn_dn, 0); | |
2547 | 269 } |
270 | |
271 | |
272 void GUIWindow_Load::Update() | |
273 { | |
274 // ----------------------------------- | |
275 // 004156F0 GUI_UpdateWindows --- part | |
276 // { | |
277 // LoadUI_Draw(); | |
278 // } | |
279 | |
280 // ----- (004606F7) -------------------------------------------------------- | |
281 // void LoadUI_Draw() | |
282 // { | |
283 UI_DrawSaveLoad(false); | |
284 } | |
285 | |
2501 | 286 |
287 //----- (004601B7) -------------------------------------------------------- | |
288 static void UI_DrawSaveLoad(bool save) | |
289 { | |
290 // const char *pSlotName; // edi@36 | |
291 GUIWindow save_load_window; // [sp+Ch] [bp-78h]@8 | |
292 unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10 | |
293 unsigned __int64 full_hours; | |
294 unsigned __int64 full_days; | |
295 int full_weeks; | |
296 int full_month; | |
297 int current_year; | |
298 int current_month; | |
299 int current_day; | |
300 int current_hour; | |
301 int current_minutes; | |
302 | |
303 pRenderer->BeginScene(); | |
304 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LoadingProcInMainMenu ) | |
305 { | |
2574 | 306 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); |
2501 | 307 if (save) |
308 { | |
2574 | 309 pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_saveu); |
310 pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, saveload_ui_save_up); | |
2501 | 311 } |
312 else | |
313 { | |
2574 | 314 pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_loadu); |
315 pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, saveload_ui_load_up); | |
2501 | 316 } |
2574 | 317 pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u); |
2501 | 318 } |
319 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) | |
320 { | |
321 memset(&save_load_window, 0, 0x54); | |
322 save_load_window.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240; | |
323 save_load_window.uFrameWidth = 220; | |
324 save_load_window.uFrameY = (pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight) + 157; | |
325 save_load_window.uFrameZ = save_load_window.uFrameX + 219; | |
326 save_load_window.uFrameHeight = pFontSmallnum->uFontHeight; | |
327 save_load_window.uFrameW = pFontSmallnum->uFontHeight + save_load_window.uFrameY - 1; | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
328 if ( pSavegameThumbnails[uLoadGameUI_SelectedSlot] ) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2547
diff
changeset
|
329 pRenderer->DrawTextureNew((pGUIWindow_CurrentMenu->uFrameX + 276)/640.0f, (pGUIWindow_CurrentMenu->uFrameY + 171)/480.0f, pSavegameThumbnails[uLoadGameUI_SelectedSlot]); |
2501 | 330 //Draw map name |
331 save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pSavegameHeader[uLoadGameUI_SelectedSlot].pLocationName)].pName, 3); | |
332 //Draw date | |
333 full_hours = ((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) / 60i64; | |
334 full_days = (unsigned int)full_hours / 24; | |
335 full_weeks = (unsigned int)(full_days / 7); | |
336 full_month = (unsigned int)full_weeks / 4; | |
337 current_year = (full_month / 12) + game_starting_year; | |
338 current_month = full_month % 12; | |
339 current_day = full_days % 28; | |
340 current_hour = full_hours % 24; | |
341 current_minutes = (((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) % 60i64); | |
342 | |
343 save_load_window.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261; | |
344 int am; | |
345 if ( (signed int)current_hour >= 12 ) | |
346 { | |
347 current_hour -= 12; | |
348 if ( !current_hour ) | |
349 current_hour = 12; | |
350 am = 1; | |
351 } | |
352 else | |
353 am = 0; | |
354 const char* day = aDayNames[full_days % 7]; | |
355 const char* ampm = aAMPMNames[am]; | |
356 const char* month = aMonthNames[current_month]; | |
357 | |
358 sprintfex(pTmpBuf.data(), "%s %d:%02d %s\n%d %s %d", day, current_hour, current_minutes, aAMPMNames[am], current_day + 1, month, current_year); | |
359 save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf.data(), 3); | |
360 } | |
361 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
362 { | |
363 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
364 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, pKeyActionMap->pPressedKeysBuffer); | |
365 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveGame, 0, 0); | |
366 } | |
367 else | |
368 { | |
369 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
370 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
371 } | |
372 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) | |
373 { | |
374 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[135]) + 25, | |
375 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0);//Загрузка | |
376 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, pFontSmallnum->AlignText_Center(186, | |
377 pSavegameHeader[uLoadGameUI_SelectedSlot].pName) + 25, 0x106, 0, pSavegameHeader[uLoadGameUI_SelectedSlot].pName, 185, 0); | |
378 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[165]) + 25, | |
379 304, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0);//"Пожалуйста, пожождите" | |
380 } | |
381 else | |
382 { | |
383 if ( save ) | |
384 pSaveFiles = 40; | |
385 else | |
386 pSaveFiles = uNumSavegameFiles; | |
387 | |
388 int slot_Y = 199; | |
389 for ( uint i = pSaveListPosition; i < pSaveFiles; ++i ) | |
390 { | |
391 if ( slot_Y >= 346 ) | |
392 break; | |
393 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS || i != uLoadGameUI_SelectedSlot ) | |
394 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 27, slot_Y, i == uLoadGameUI_SelectedSlot ? Color16(0xFF, 0xFF, 0x64) : 0, pSavegameHeader[i].pName, 185, 0); | |
395 else | |
396 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 27, slot_Y, i == uLoadGameUI_SelectedSlot ? Color16(0xFF, 0xFF, 0x64) : 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 175, 1) + 27, | |
397 slot_Y, pFontSmallnum); | |
398 slot_Y += 21; | |
399 } | |
400 } | |
401 pRenderer->EndScene(); | |
402 } |