annotate GUI/NewUI/MainMenu.cpp @ 2563:65c97624c047

Saving & loading works from both main menu and game
author a.parshin
date Tue, 19 May 2015 22:00:56 +0200
parents 0ff6a9e9bf7f
children
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
6 #include "MainMenu.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
7 #include "..\..\Engine/LOD.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
8
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
9 bool MainMenuWindow::OnMouseLeftClick(int x, int y)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
10 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
11 if (UIControl::OnMouseLeftClick(x, y))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
12 return true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
13 return false;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
14 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
15
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
16 bool MainMenuWindow::OnMouseRightClick(int x, int y)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
17 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
18 if (UIControl::OnMouseRightClick(x, y))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
19 return true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
20 return false;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
21 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
22
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
23 bool MainMenuWindow::OnKey(int key)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
24 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
25 if (UIControl::OnKey(key))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
26 return true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
27 return false;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
28 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
29
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
31 void MainMenuWindow::Show() {}
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
32 bool MainMenuWindow::Focused() {return false;}
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
33
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
34 bool MainMenuWindow::Initialize()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
35 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
36 RGBTexture* background_texture = new RGBTexture;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
37 background_texture->Load("mm6title.pcx", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
38 return true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
39 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
40
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
41 MainMenuWindow *MainMenuWindow::Create()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
42 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
43 MainMenuWindow* window = new MainMenuWindow;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
44 if (window)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
45 if (!window->Initialize())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
46 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
47 delete window;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
48 window = nullptr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
49 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
50 return window;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
51 }