From 5110ebc1b252da52ca49fe1d3836ca9ef55ca79a Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 13 Jun 2013 12:31:29 +1000 Subject: [PATCH] Changed the escape key & quit event's function slightly --- client/lobby.cpp | 4 ++-- client/lobby.hpp | 1 - client/option_screen.cpp | 4 ++-- client/option_screen.hpp | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client/lobby.cpp b/client/lobby.cpp index 8e67f43..c90fef5 100644 --- a/client/lobby.cpp +++ b/client/lobby.cpp @@ -91,7 +91,7 @@ void Lobby::MouseButtonUp(SDL_MouseButtonEvent const& button) { //TODO: join a server } else if (backButton.MouseButtonUp(button) == Button::State::HOVER) { - QuitEvent(); + SetNextScene(SceneList::MAINMENU); } else if ( //clicked within bounds TODO: make the damn collision system @@ -113,7 +113,7 @@ void Lobby::MouseButtonUp(SDL_MouseButtonEvent const& button) { void Lobby::KeyDown(SDL_KeyboardEvent const& key) { switch(key.keysym.sym) { case SDLK_ESCAPE: - QuitEvent(); + SetNextScene(SceneList::MAINMENU); break; } } diff --git a/client/lobby.hpp b/client/lobby.hpp index 625b5af..a889592 100644 --- a/client/lobby.hpp +++ b/client/lobby.hpp @@ -32,7 +32,6 @@ protected: void Render(SDL_Surface* const); //Event handlers - void QuitEvent() { SetNextScene(SceneList::MAINMENU); } void MouseMotion(SDL_MouseMotionEvent const&); void MouseButtonDown(SDL_MouseButtonEvent const&); void MouseButtonUp(SDL_MouseButtonEvent const&); diff --git a/client/option_screen.cpp b/client/option_screen.cpp index a375d9a..fc1d025 100644 --- a/client/option_screen.cpp +++ b/client/option_screen.cpp @@ -43,14 +43,14 @@ void OptionScreen::MouseButtonDown(SDL_MouseButtonEvent const& button) { void OptionScreen::MouseButtonUp(SDL_MouseButtonEvent const& button) { if (backButton.MouseButtonUp(button) == Button::State::HOVER) { - QuitEvent(); + SetNextScene(SceneList::MAINMENU); } } void OptionScreen::KeyDown(SDL_KeyboardEvent const& key) { switch(key.keysym.sym) { case SDLK_ESCAPE: - QuitEvent(); + SetNextScene(SceneList::MAINMENU); break; } } diff --git a/client/option_screen.hpp b/client/option_screen.hpp index 35cade9..660004f 100644 --- a/client/option_screen.hpp +++ b/client/option_screen.hpp @@ -18,7 +18,6 @@ protected: void Render(SDL_Surface* const); /* Event handlers */ - void QuitEvent() { SetNextScene(SceneList::MAINMENU); } void MouseMotion(SDL_MouseMotionEvent const&); void MouseButtonDown(SDL_MouseButtonEvent const&); void MouseButtonUp(SDL_MouseButtonEvent const&);