Implemented server selection interface

This commit is contained in:
Kayne Ruse
2013-05-20 18:54:10 +10:00
parent d76cbe13da
commit bf73b542f1
4 changed files with 50 additions and 23 deletions
+3 -8
View File
@@ -15,9 +15,9 @@ MainMenu::MainMenu(ConfigUtility* cUtil, SurfaceManager* sMgr) {
configUtil = cUtil;
surfaceMgr = sMgr;
buttonMap["start"] = new Button(50, 50, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "start");
buttonMap["options"] = new Button(50, 100, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "options");
buttonMap["quit"] = new Button(50, 150, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "quit");
buttonMap["start"] = new Button(50, 50, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Start");
buttonMap["options"] = new Button(50, 100, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Options");
buttonMap["quit"] = new Button(50, 150, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Quit");
}
MainMenu::~MainMenu() {
@@ -69,18 +69,13 @@ void MainMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) {
void MainMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
if (buttonMap["start"]->MouseButtonUp(button) == Button::State::HOVER) {
//TODO
SetNextScene(SceneList::LOBBY);
cout << "start" << endl;
}
if (buttonMap["options"]->MouseButtonUp(button) == Button::State::HOVER) {
//TODO
cout << "options" << endl;
}
if (buttonMap["quit"]->MouseButtonUp(button) == Button::State::HOVER) {
//TODO
QuitEvent();
cout << "quit" << endl;
}
}