[Orxonox-commit 551] r3094 - trunk/src/orxonox/gamestates
rgrieder at orxonox.net
rgrieder at orxonox.net
Wed May 27 21:42:14 CEST 2009
Author: rgrieder
Date: 2009-05-27 21:42:13 +0200 (Wed, 27 May 2009)
New Revision: 3094
Modified:
trunk/src/orxonox/gamestates/GSMainMenu.cc
trunk/src/orxonox/gamestates/GSMainMenu.h
Log:
Adding functionality to the server, client and dedicated buttons (rather hacky though..)
Modified: trunk/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- trunk/src/orxonox/gamestates/GSMainMenu.cc 2009-05-27 19:39:38 UTC (rev 3093)
+++ trunk/src/orxonox/gamestates/GSMainMenu.cc 2009-05-27 19:42:13 UTC (rev 3094)
@@ -72,11 +72,29 @@
GraphicsManager::getInstance().setCamera(this->camera_);
{
- FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startGame);
+ FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startStandalone);
functor->setObject(this);
- this->ccStartGame_ = createConsoleCommand(functor, "startGame");
- CommandExecutor::addConsoleCommandShortcut(this->ccStartGame_);
+ this->ccStartStandalone_ = createConsoleCommand(functor, "startGame");
+ CommandExecutor::addConsoleCommandShortcut(this->ccStartStandalone_);
}
+ {
+ FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startServer);
+ functor->setObject(this);
+ this->ccStartServer_ = createConsoleCommand(functor, "startServer");
+ CommandExecutor::addConsoleCommandShortcut(this->ccStartServer_);
+ }
+ {
+ FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startClient);
+ functor->setObject(this);
+ this->ccStartClient_ = createConsoleCommand(functor, "startClient");
+ CommandExecutor::addConsoleCommandShortcut(this->ccStartClient_);
+ }
+ {
+ FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startDedicated);
+ functor->setObject(this);
+ this->ccStartDedicated_ = createConsoleCommand(functor, "startDedicated");
+ CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
+ }
InputManager::getInstance().requestEnterState("mainMenu");
@@ -109,10 +127,32 @@
{
}
- void GSMainMenu::startGame()
+ void GSMainMenu::startStandalone()
{
// HACK - HACK
Game::getInstance().popState();
Game::getInstance().requestStates("standalone, level");
}
+
+ void GSMainMenu::startServer()
+ {
+ // HACK - HACK
+ Game::getInstance().popState();
+ Game::getInstance().requestStates("server, level");
+ }
+
+ void GSMainMenu::startClient()
+ {
+ // HACK - HACK
+ Game::getInstance().popState();
+ Game::getInstance().requestStates("client, level");
+ }
+
+ void GSMainMenu::startDedicated()
+ {
+ // HACK - HACK
+ Game::getInstance().popState();
+ Game::getInstance().popState();
+ Game::getInstance().requestStates("dedicated, level");
+ }
}
Modified: trunk/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- trunk/src/orxonox/gamestates/GSMainMenu.h 2009-05-27 19:39:38 UTC (rev 3093)
+++ trunk/src/orxonox/gamestates/GSMainMenu.h 2009-05-27 19:42:13 UTC (rev 3094)
@@ -45,7 +45,10 @@
void deactivate();
void update(const Clock& time);
- void startGame();
+ void startStandalone();
+ void startServer();
+ void startClient();
+ void startDedicated();
private:
SimpleInputState* inputState_;
@@ -53,7 +56,10 @@
Ogre::Camera* camera_;
// console commands
- ConsoleCommand* ccStartGame_;
+ ConsoleCommand* ccStartStandalone_;
+ ConsoleCommand* ccStartServer_;
+ ConsoleCommand* ccStartClient_;
+ ConsoleCommand* ccStartDedicated_;
// ambient sound for the main menu
SoundMainMenu* ambient_;
More information about the Orxonox-commit
mailing list