[Orxonox-commit 2026] r6743 - in code/branches/gamestates2: data/gui/scripts src/orxonox/gamestates
rgrieder at orxonox.net
rgrieder at orxonox.net
Fri Apr 16 13:07:57 CEST 2010
Author: rgrieder
Date: 2010-04-16 13:07:57 +0200 (Fri, 16 Apr 2010)
New Revision: 6743
Modified:
code/branches/gamestates2/data/gui/scripts/MenuSheet.lua
code/branches/gamestates2/data/gui/scripts/SheetManager.lua
code/branches/gamestates2/src/orxonox/gamestates/GSMainMenu.cc
Log:
- Bugfix in keyESC.
- Default behaviour for GUI sheet InputStates is now not to handle keyboard input --> KeyBinder is used.
- Added some temporary hackery to GSMainMenu to enable the use of Keys in the MainMenu.
Modified: code/branches/gamestates2/data/gui/scripts/MenuSheet.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MenuSheet.lua 2010-04-16 10:53:16 UTC (rev 6742)
+++ code/branches/gamestates2/data/gui/scripts/MenuSheet.lua 2010-04-16 11:07:57 UTC (rev 6743)
@@ -15,7 +15,7 @@
local newSheet = GUISheet.new(_name)
newSheet.bHidePrevious = handleDefArg(_bHidePrevious, true)
newSheet.tShowCursor = handleDefArg(_tShowCusor, TriBool.True)
- newSheet.tUseKeyboard = handleDefArg(_tUseKeyboard, TriBool.True)
+ newSheet.tUseKeyboard = handleDefArg(_tUseKeyboard, TriBool.Dontcare)
newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
setmetatable(newSheet, P)
Modified: code/branches/gamestates2/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/SheetManager.lua 2010-04-16 10:53:16 UTC (rev 6742)
+++ code/branches/gamestates2/data/gui/scripts/SheetManager.lua 2010-04-16 11:07:57 UTC (rev 6743)
@@ -180,7 +180,7 @@
if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
orxonox.execute("exit")
elseif activeMenuSheets.size > 0 then
- orxonox.execute("hideMenuSheet "..activeMenuSheets.topSheetTuple.sheet.name)
+ orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name)
else
showMenuSheet("InGameMenu")
end
Modified: code/branches/gamestates2/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/gamestates2/src/orxonox/gamestates/GSMainMenu.cc 2010-04-16 10:53:16 UTC (rev 6742)
+++ code/branches/gamestates2/src/orxonox/gamestates/GSMainMenu.cc 2010-04-16 11:07:57 UTC (rev 6743)
@@ -39,6 +39,9 @@
#include "core/GUIManager.h"
#include "Scene.h"
#include "sound/AmbientSound.h"
+// HACK
+#include "core/input/InputManager.h"
+#include "core/input/InputState.h"
namespace orxonox
{
@@ -49,6 +52,8 @@
{
RegisterRootObject(GSMainMenu);
+ InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
+
// create an empty Scene
this->scene_ = new Scene(NULL);
this->scene_->setSyncMode( 0x0 );
@@ -67,6 +72,8 @@
if (GameMode::playsSound())
this->ambient_->destroy();
+ InputManager::getInstance().destroyState("MainMenuHackery");
+
this->scene_->getSceneManager()->destroyCamera(this->camera_);
this->scene_->destroy();
}
@@ -79,6 +86,8 @@
GUIManager::getInstance().setBackgroundImage("MainMenuBackground", "Background");
GraphicsManager::getInstance().setCamera(this->camera_);
+ InputManager::getInstance().enterState("MainMenuHackery");
+
CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startStandalone), "startGame"));
CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startServer), "startServer"));
CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient), "startClient"));
@@ -106,6 +115,8 @@
this->ambient_->stop();
}
+ InputManager::getInstance().leaveState("MainMenuHackery");
+
GUIManager::getInstance().setCamera(0);
GUIManager::getInstance().setBackgroundImage("");
GUIManager::hideGUI("MainMenu");
More information about the Orxonox-commit
mailing list