Added the notion of a 'cancel' button, and unified all the 'cancel' menu IDs to be kCancelMenuID (ie -1). I've slaved the Menu button (ie Esc on win, 'Start' button on PSP) to this - the idea being, if you hit the Menu button to bring up a menu, hitting it again will dismiss it without doing anything, which is pretty standard behavior for most console/computer games.
This commit is contained in:
@@ -48,7 +48,7 @@ void GameStateStory::loadStoriesMenu(const char * root){
|
||||
for (size_t i = 0; i < stories.size(); ++i){
|
||||
menu->Add(i, stories[i].c_str());
|
||||
}
|
||||
menu->Add(-1,"Cancel");
|
||||
menu->Add(kCancelMenuID, "Cancel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void GameStateStory::Update(float dt) {
|
||||
if (!menu && mEngine->GetButtonClick(JGE_BTN_MENU)){
|
||||
menu = NEW SimpleMenu(100, this, Fonts::MENU_FONT, SCREEN_WIDTH/2-100, 25);
|
||||
menu->Add(0,"Back to main menu");
|
||||
menu->Add(-1, "Cancel");
|
||||
menu->Add(kCancelMenuID, "Cancel");
|
||||
}
|
||||
if (menu) {
|
||||
menu->Update(dt);
|
||||
|
||||
Reference in New Issue
Block a user