[Orxonox-commit 1096] r5817 - code/branches/core5/src/modules/gamestates
scheusso at orxonox.net
scheusso at orxonox.net
Sun Sep 27 22:17:54 CEST 2009
Author: scheusso
Date: 2009-09-27 22:17:54 +0200 (Sun, 27 Sep 2009)
New Revision: 5817
Modified:
code/branches/core5/src/modules/gamestates/GSMainMenu.cc
code/branches/core5/src/modules/gamestates/GSMainMenu.h
Log:
console commands for switching back to MainMenu from Game mode
Modified: code/branches/core5/src/modules/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/core5/src/modules/gamestates/GSMainMenu.cc 2009-09-27 20:17:06 UTC (rev 5816)
+++ code/branches/core5/src/modules/gamestates/GSMainMenu.cc 2009-09-27 20:17:54 UTC (rev 5817)
@@ -98,6 +98,12 @@
this->ccStartDedicated_ = createConsoleCommand(functor, "startDedicated");
CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
}
+ {
+ FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startMainMenu);
+ functor->setObject(this);
+ this->ccStartMainMenu_ = createConsoleCommand(functor, "startMainMenu");
+ CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
+ }
InputManager::getInstance().enterState("mainMenu");
@@ -155,4 +161,11 @@
Game::getInstance().popState();
Game::getInstance().requestStates("dedicated, level");
}
+ void GSMainMenu::startMainMenu()
+ {
+ // HACK - HACK
+ Game::getInstance().popState();
+ Game::getInstance().popState();
+ Game::getInstance().requestStates("mainmenu");
+ }
}
Modified: code/branches/core5/src/modules/gamestates/GSMainMenu.h
===================================================================
--- code/branches/core5/src/modules/gamestates/GSMainMenu.h 2009-09-27 20:17:06 UTC (rev 5816)
+++ code/branches/core5/src/modules/gamestates/GSMainMenu.h 2009-09-27 20:17:54 UTC (rev 5817)
@@ -50,6 +50,7 @@
void startServer();
void startClient();
void startDedicated();
+ void startMainMenu();
private:
InputState* inputState_;
@@ -61,6 +62,7 @@
ConsoleCommand* ccStartServer_;
ConsoleCommand* ccStartClient_;
ConsoleCommand* ccStartDedicated_;
+ ConsoleCommand* ccStartMainMenu_;
// ambient sound for the main menu
SoundMainMenu* ambient_;
More information about the Orxonox-commit
mailing list