annotate NewUI/MainMenu.cpp @ 2304:e76b56512abd

forgot to commit this one
author Grumpy7
date Sun, 16 Mar 2014 21:04:39 +0100
parents aff7a7b072b7
children f4af3b203f65
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 1980
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 1980
diff changeset
2 #include "MainMenu.h"
1835
Ritor1
parents: 1815
diff changeset
3 #include "..\LOD.h"
1815
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
4
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
5 bool MainMenuWindow::OnMouseLeftClick(int x, int y)
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
6 {
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
7 if (UIControl::OnMouseLeftClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
8 return true;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
9 return false;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
10 }
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
11
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
12 bool MainMenuWindow::OnMouseRightClick(int x, int y)
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
13 {
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
14 if (UIControl::OnMouseRightClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
15 return true;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
16 return false;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
17 }
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
18
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
19 bool MainMenuWindow::OnKey(int key)
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
20 {
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
21 if (UIControl::OnKey(key))
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
22 return true;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
23 return false;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
24 }
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
25
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
26
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
27 void MainMenuWindow::Show() {}
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
28 bool MainMenuWindow::Focused() {return false;}
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
29
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
30 bool MainMenuWindow::Initialize()
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
31 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1847
diff changeset
32 RGBTexture* background_texture = new RGBTexture;
1847
b6252811663d Texture error in MainMenuWindow
Nomad
parents: 1835
diff changeset
33 background_texture->Load("mm6title.pcx", 0);
1815
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
34 return true;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
35 }
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
36
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
37 MainMenuWindow *MainMenuWindow::Create()
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
38 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1847
diff changeset
39 MainMenuWindow* window = new MainMenuWindow;
1815
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
40 if (window)
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
41 if (!window->Initialize())
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
42 {
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
43 delete window;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
44 window = nullptr;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
45 }
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
46 return window;
bd899dfd976c MainMenuWindow
Nomad
parents:
diff changeset
47 }