From c027f1b9cd6c9deb60931a7f9f75bb4ee130291b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 18 Oct 2009 15:24:07 -0400 Subject: Added local highscore list You can now view and add to a local highscore list. A change to State was necessary due to how the user's name would be entered into the highscore list and thus all states have been modified. Refs #104 --- chlstate.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'chlstate.cpp') diff --git a/chlstate.cpp b/chlstate.cpp index 24dd674..3f3000d 100644 --- a/chlstate.cpp +++ b/chlstate.cpp @@ -10,19 +10,21 @@ ChooseHighscoreListState::ChooseHighscoreListState() SDL_WM_SetCaption("Maze Of Life - Choose Highscore List", NULL); } -void ChooseHighscoreListState::input(SDLKey key) +void ChooseHighscoreListState::input(SDL_keysym key) { - if ((key == SDLK_UP) && (selection != 0)) + if ((key.sym == SDLK_UP) && (selection != 0)) { selection--; - } else if ((key == SDLK_DOWN) && (selection != 2)) + } else if ((key.sym == SDLK_DOWN) && (selection != 2)) { selection++; - } else if (key == SDLK_RETURN) + } else if (key.sym == SDLK_RETURN) { switch (selection) { - case 0: // Go to local highscore list + case 0: + changeState(new LocalHighscoreListState(false)); + break; case 1: // Go to global highscore list break; -- cgit 1.4.1