From 51d56926cc01fecc0ef94e810e82f81d924b9ec8 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 3 Jul 2012 00:26:27 +0000 Subject: [PATCH] - return to previous menu when tutorials / scenarios are empty --- source/glest_game/menu/menu_state_scenario.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/glest_game/menu/menu_state_scenario.cpp b/source/glest_game/menu/menu_state_scenario.cpp index b9b12c4e..dc18fb95 100644 --- a/source/glest_game/menu/menu_state_scenario.cpp +++ b/source/glest_game/menu/menu_state_scenario.cpp @@ -172,17 +172,22 @@ void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) { if(mainMessageBox.getEnabled()){ int button= 0; - if(mainMessageBox.mouseClick(x, y, button)) - { + if(mainMessageBox.mouseClick(x, y, button)) { soundRenderer.playFx(coreData.getClickSoundA()); if(button==0) { mainMessageBox.setEnabled(false); + + if(scenarioFiles.empty() == true && mainMessageBoxState ==1) { + mainMenu->setState(new MenuStateNewGame(program, mainMenu)); + return; + } } } } else if(buttonReturn.mouseClick(x,y)){ soundRenderer.playFx(coreData.getClickSoundA()); mainMenu->setState(new MenuStateNewGame(program, mainMenu)); + return; } else if(buttonPlayNow.mouseClick(x,y)){ soundRenderer.playFx(coreData.getClickSoundC());