[Orxonox-commit 2635] r7340 - code/branches/notifications/data/gui/scripts

dafrick at orxonox.net dafrick at orxonox.net
Fri Sep 3 16:27:16 CEST 2010


Author: dafrick
Date: 2010-09-03 16:27:16 +0200 (Fri, 03 Sep 2010)
New Revision: 7340

Modified:
   code/branches/notifications/data/gui/scripts/SheetManager.lua
Log:
Fixed problems with hud and cursor.
Here a little summary about what has been introduced by the last three commits:
When showing a GUI one can now additionally specify whether the GUI to be shown should be treated as transparent to input (bNoInput). If this is set to true the GUI acts merely as a display layer and doesn't interfere with any kind of input.


Modified: code/branches/notifications/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/SheetManager.lua	2010-09-03 14:00:28 UTC (rev 7339)
+++ code/branches/notifications/data/gui/scripts/SheetManager.lua	2010-09-03 14:27:16 UTC (rev 7340)
@@ -62,13 +62,19 @@
         assert(bHidePrevious ~= nil)
     end
 
+    -- Set bNoInput to false if it hasn't been set.
     if bNoInput == nil then
         bNoInput = false
     end
 
+    -- Count the number of sheets that don't need input till the first that does.
+    local counter = activeMenuSheets.size
+    while counter > 0 and activeMenuSheets[counter].bNoInput do
+        counter = counter - 1
+    end
     -- Pause game control if this is the first menu to be displayed
     -- HUGE HACK?
-    if activeMenuSheets.size == 0 then
+    if bNoInput == false and counter == 0 then
         orxonox.HumanController:pauseControl()
     end
 
@@ -77,7 +83,7 @@
         hideMenuSheet(name)
     end
 
-    if bNoInput == false then
+    if bNoInput == true then
         menuSheet.tShowCursor = TriBool.Dontcare
     end
 
@@ -174,8 +180,13 @@
         hideCursor()
     end
 
-    -- Resume control if the last menu is hidden
-    if activeMenuSheets.size == 0 then
+    -- Count the number of sheets that don't need input till the first that does.
+    local counter = activeMenuSheets.size
+    while counter > 0 and activeMenuSheets[counter].bNoInput do
+        counter = counter - 1
+    end
+    -- Resume control if the last (non-noInput) menu is hidden
+    if counter == 0 then
         orxonox.HumanController:resumeControl()
         hideCursor()
     end




More information about the Orxonox-commit mailing list