Changed the escape key & quit event's function slightly

This commit is contained in:
Kayne Ruse
2013-06-13 12:31:29 +10:00
parent 843053d307
commit 5110ebc1b2
4 changed files with 4 additions and 6 deletions
+2 -2
View File
@@ -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;
}
}
-1
View File
@@ -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&);
+2 -2
View File
@@ -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;
}
}
-1
View File
@@ -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&);