Mercurial > mm7
comparison GUI/UI/UISaveLoad.cpp @ 2544:c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
author | a.parshin |
---|---|
date | Mon, 11 May 2015 09:51:04 +0200 |
parents | a902abdfc7f2 |
children | fed97f15d1e1 |
comparison
equal
deleted
inserted
replaced
2543:b6140dfeac27 | 2544:c674d547cc7c |
---|---|
14 #include "..\../GUI/GUIFont.h" | 14 #include "..\../GUI/GUIFont.h" |
15 #include "..\../Engine/Graphics/Render.h" | 15 #include "..\../Engine/Graphics/Render.h" |
16 #include "..\../Engine/LOD.h" | 16 #include "..\../Engine/LOD.h" |
17 #include "..\../Engine/SaveLoad.h" | 17 #include "..\../Engine/SaveLoad.h" |
18 #include "..\../Engine/texts.h" | 18 #include "..\../Engine/texts.h" |
19 | |
20 #include "Game/MainMenu.h" | |
19 | 21 |
20 | 22 |
21 //----- (004601B7) -------------------------------------------------------- | 23 //----- (004601B7) -------------------------------------------------------- |
22 static void UI_DrawSaveLoad(bool save) | 24 static void UI_DrawSaveLoad(bool save) |
23 { | 25 { |
178 pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); | 180 pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); |
179 } | 181 } |
180 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); | 182 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); |
181 } | 183 } |
182 else | 184 else |
183 pRenderer->DrawTextureNew(0, 0, &pTexture_PCX); | 185 pRenderer->DrawTextureNew(0, 0, &main_menu_background); |
184 pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType], saveload_dlg_ys[uDialogueType], saveload_dlg_zs[uDialogueType], | 186 pGUIWindow_CurrentMenu = new GUIWindow_Load(saveload_dlg_xs[uDialogueType], saveload_dlg_ys[uDialogueType], saveload_dlg_zs[uDialogueType], |
185 saveload_dlg_ws[uDialogueType], WINDOW_MainMenu_Load, 0, 0); | 187 saveload_dlg_ws[uDialogueType], 0, 0); |
186 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." | 188 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." |
187 pRenderer->Present(); | 189 pRenderer->Present(); |
188 pSavegameList->Initialize(0); | 190 pSavegameList->Initialize(0); |
189 if ( pSaveListPosition > (signed int)uNumSavegameFiles ) | 191 if ( pSaveListPosition > (signed int)uNumSavegameFiles ) |
190 { | 192 { |
310 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); | 312 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); |
311 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); | 313 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); |
312 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); | 314 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); |
313 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); | 315 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); |
314 | 316 |
315 auto wnd = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SaveLoadButtons, 0, 0); | 317 auto wnd = new GUIWindow_Save(0, 0, window->GetWidth(), window->GetHeight(), 0, 0); |
316 wnd->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); | 318 wnd->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); |
317 wnd->CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); | 319 wnd->CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); |
318 wnd->CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); | 320 wnd->CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); |
319 wnd->CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); | 321 wnd->CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); |
320 wnd->CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); | 322 wnd->CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); |