diff GUI/UI/UIMainMenu.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 87e5590d034b
line wrap: on
line diff
--- a/GUI/UI/UIMainMenu.cpp	Sun May 10 03:21:14 2015 +0200
+++ b/GUI/UI/UIMainMenu.cpp	Mon May 11 09:51:04 2015 +0200
@@ -50,7 +50,7 @@
   pFontComic = LoadFont("comic.fnt", "FONTPAL", nullptr);
 
   for (uint i = 0; i < 20; ++i)
-    pWindowList[i].eWindowType = WINDOW_null;
+      pWindowList[i] = nullptr;
 
   uNumVisibleWindows = -1;
   memset(pVisibleWindowsIdxs.data(), 0, sizeof(pVisibleWindowsIdxs));
@@ -108,7 +108,7 @@
   uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE);
   uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE);
 
-  pPrimaryWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
+  pPrimaryWindow = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
   pPrimaryWindow->CreateButton(7, 8, 460, 343, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0);
 
   pPrimaryWindow->CreateButton(61, 424, 31, 80, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);//buttons for portraits
@@ -298,7 +298,7 @@
     cred_texture.uHeight, Color16(0x70u, 0x8Fu, 0xFEu), Color16(0xECu, 0xE6u, 0x9Cu), pString, cred_texture.pPixels, cred_texture.uWidth);
   free(pString);
 
-  pWindow_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, cred_texturet);
+  pWindow_MainMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, cred_texturet);
   pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 27, "", 0);
   current_screen_type = SCREEN_CREATORS;
   SetCurrentMenuID(MENU_CREDITSPROC);