[Orxonox-commit 3806] r8484 - in code/trunk: data/gui/scripts src/orxonox/overlays
dafrick at orxonox.net
dafrick at orxonox.net
Sat May 14 17:30:26 CEST 2011
Author: dafrick
Date: 2011-05-14 17:30:26 +0200 (Sat, 14 May 2011)
New Revision: 8484
Modified:
code/trunk/data/gui/scripts/SheetManager.lua
code/trunk/src/orxonox/overlays/InGameConsole.cc
Log:
Turns out my pervious fix actually induced a bug, this fix should take care of both problems.
Modified: code/trunk/data/gui/scripts/SheetManager.lua
===================================================================
--- code/trunk/data/gui/scripts/SheetManager.lua 2011-05-14 11:06:57 UTC (rev 8483)
+++ code/trunk/data/gui/scripts/SheetManager.lua 2011-05-14 15:30:26 UTC (rev 8484)
@@ -4,6 +4,7 @@
local loadedSheets = {}
local activeMenuSheets = {size = 0, topSheetTuple = nil}
local menuSheetsRoot = guiMgr:getMenuRootWindow()
+local bInGameConsoleClosed = false
local mainMenuLoaded = false
orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized")
@@ -217,6 +218,14 @@
-- Count the number of sheets that don't need input till the first that does.
local counter = noInputSheetIndex()
+
+ -- If the InGameConsole is active, ignore the ESC command.
+ if bInGameConsoleClosed == true then
+ bInGameConsoleClosed = false
+ if counter > 0 then
+ return
+ end
+ end
-- If the first sheet that needs input is the MainMenu.
if noInputSheetCounter() == 1 and activeMenuSheets[counter].sheet.name == "MainMenu" then
@@ -287,6 +296,10 @@
return counter
end
+function inGameConsoleClosed()
+ bInGameConsoleClosed = not bInGameConsoleClosed;
+end
+
function getGUIFirstActive(name, bHidePrevious, bNoInput)
local sheet = activeMenuSheets.topSheetTuple
-- If the topmost gui sheet has the input name
Modified: code/trunk/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.cc 2011-05-14 11:06:57 UTC (rev 8483)
+++ code/trunk/src/orxonox/overlays/InGameConsole.cc 2011-05-14 15:30:26 UTC (rev 8484)
@@ -533,6 +533,7 @@
if (this->bActive_)
{
this->bActive_ = false;
+ GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed.
InputManager::getInstance().leaveState("console");
this->shell_->unregisterListener(this);
More information about the Orxonox-commit
mailing list