Index: code/branches/gamestates2/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/AudioMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/AudioMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- AudioMenu.lua
 
-local P = createSheet("AudioMenu")
+local P = createMenuSheet("AudioMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/BasicGUI.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/BasicGUI.lua	(revision 6704)
+++ 	(revision )
@@ -1,51 +1,0 @@
--- BasicGUI.lua
-
-local P = {}
-_G[_REQUIREDNAME or "BasicGUI"] = P
-
--- useless, even wrong? P is the class, not the object..
-P.overlay = nil
-
--- constructor of the GUI
-function P:new(_name, _gui, _visible)
-    local newElement = {
-        name = _name,
-        gui = _gui,
-        visible = _visible or false
-    } or {}
-    setmetatable(newElement, self) -- connects new element with class
-    self.__index = self
-    return newElement
-end
-
--- Override this function if you need to
-function P:init()
-end
-
--- Override this function if you want to change one of the three input parameters:
--- showCursor = true, useKeyboard = true and blockJoyStick = false
--- But don't forget to stick to the naming convention ("GUI_" .. self.name)
-function P:createInputState()
-    self.inputState = guiMgr:createInputState("GUI_" .. self.name)
-end
-
--- hide function for the GUI
-function P:hide()
-    self.window:hide()
-    self.visible = false
-end
-
--- show function for the GUI
-function P:show()
-    self.window:show()
-    self.visible = true
-end
-
-function P:load()
-    self.window = winMgr:loadWindowLayout(self.name .. ".layout")
-    self:createInputState()
-    self:init()
-    return self
-end
-
-return P
Index: code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- ControlsMenu.lua
 
-local P = createSheet("ControlsMenu")
+local P = createMenuSheet("ControlsMenu")
 
 function P.ControlsMouseControlsButton_clicked(e)
Index: code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- CreditsMenu.lua
 
-local P = createSheet("CreditsMenu")
+local P = createMenuSheet("CreditsMenu")
 
 function P.CreditsBackButton_clicked(e)
Index: code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- DecisionPopup.lua
 
-local P = createSheet("DecisionPopup")
+local P = createMenuSheet("DecisionPopup")
 
 function P.setCallback(functionPtr)
Index: code/branches/gamestates2/data/gui/scripts/GUISheet.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/GUISheet.lua	(revision 6718)
+++ code/branches/gamestates2/data/gui/scripts/GUISheet.lua	(revision 6718)
@@ -0,0 +1,44 @@
+-- GUISheet.lua
+
+local P = {}
+_G[_REQUIREDNAME or "GUISheet"] = P
+P.__index = P
+
+-- Don't use directly --> use HUDSheet.new or MenuSheet.new
+function P.new(_name)
+    local newSheet = { name = _name }
+    setmetatable(newSheet, P)
+    return newSheet
+end
+
+-- Override this function if you need to do work on load
+-- TODO: rename to onLoad
+function P:init()
+end
+
+-- hide function for the GUI
+function P:hide()
+    self.window:hide()
+    self.bVisible = false
+end
+
+-- show function for the GUI
+function P:show()
+    self.window:show()
+    self.bVisible = true
+end
+
+function P:load()
+    -- Load the layout that describes the sheet
+    self.window = winMgr:loadWindowLayout(self.name .. ".layout")
+    if self.window == nil then
+        error("Could not load layout file for GUI sheet '"..self.name.."'")
+    end
+    -- Hide it at first
+    self:hide()
+    -- Allow sheets to do some work upon loading
+    self:init()
+    return self
+end
+
+return P
Index: code/branches/gamestates2/data/gui/scripts/GUITools.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/GUITools.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/GUITools.lua	(revision 6718)
@@ -1,10 +1,14 @@
-function createSheet(sheetName)
-    -- Create object of type BasicGUI and make it global
-    local basicGUI = require("BasicGUI")
-    if basicGUI == nil then
-        error("Loading BasicGUI.lua failed")
-    end
-    local sheet = basicGUI:new(sheetName)
-    _G[sheetName] = sheet
+-- Returns a new menu sheet
+-- See MenuSheet.new for details about the parameters
+function createMenuSheet(name, bHidePrevious, tShowCursor, tUseKeyboard, bBlockJoyStick)
+    local sheet = require("MenuSheet").new(name, bHidePrevious, tShowCursor, tUseKeyboard, bBlockJoyStick)
+    _G[sheet.name] = sheet -- Global access required because of the event handlers
+    return sheet
+end
+
+-- Returns a new HUD sheet
+function createHUDSheet(name)
+    local sheet = require("HUDSheet").new(name)
+    _G[sheet.name] = sheet -- Global access required because of the event handlers
     return sheet
 end
Index: code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- GameplayMenu.lua
 
-local P = createSheet("GameplayMenu")
+local P = createMenuSheet("GameplayMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- GraphicsMenu.lua
 
-local P = createSheet("GraphicsMenu")
+local P = createMenuSheet("GraphicsMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/HUDSheet.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/HUDSheet.lua	(revision 6718)
+++ code/branches/gamestates2/data/gui/scripts/HUDSheet.lua	(revision 6718)
@@ -0,0 +1,15 @@
+-- HUDSheet.lua
+
+local P = {} -- Local alias, always use it in this file
+HUDSheet = P -- Global name
+setmetatable(P, require("GUISheet")) -- Inherit from GUISheet
+P.__index = P -- Provide class character
+
+-- Use this function to construct a new HUDSheet
+function P.new(name)
+    local newSheet = GUISheet.new(name)
+    setmetatable(newSheet, P)
+    return newSheet
+end
+
+return P
Index: code/branches/gamestates2/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/InGameMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/InGameMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- InGameMenu.lua
 
-local P = createSheet("InGameMenu")
+local P = createMenuSheet("InGameMenu")
 
 -- events for ingamemenu
Index: code/branches/gamestates2/data/gui/scripts/InfoPopup.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/InfoPopup.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/InfoPopup.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- InfoPopup.lua
 
-local P = createSheet("InfoPopup")
+local P = createMenuSheet("InfoPopup")
 
 function P.execute(functionPtr, arguments)
Index: code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua	(revision 6718)
@@ -30,6 +30,6 @@
 
 local loadedSheets = {}
-local activeMenuSheets = {size = 0, topSheet = nil}
---activeHUDSheets  = {size = 0, topSheet = nil}
+local activeMenuSheets = {size = 0, topSheetTuple = nil}
+--activeHUDSheets  = {size = 0, topSheetTuple = nil}
 local root = nil
 
@@ -51,11 +51,6 @@
         -- Load the sheet
         sheet = require(name)
-        if sheet == nil then
-            return
-        end
         sheet:load()
         loadedSheets[name] = sheet
-        -- Hide new GUI as we do not want to show it accidentally
-        sheet:hide()
     end
     return sheet
@@ -80,18 +75,22 @@
 
 -- ?
-function showGUI(name, bHidePrevious, bShowCursor, ptr)
-    gui = showGUI(name, bHidePrevious, bShowCursor)
-    gui.overlay = ptr
+function showGUI(name, bHidePrevious, ptr)
+    local sheet = showGUI(name, bHidePrevious)
+    sheet.overlay = ptr
+    return sheet
 end
 
 -- Shows the specified menu sheet and loads it if neccessary
-function showGUI(name, bHidePrevious, bShowCursor)
-    -- Handle default value for bShowCursor
-    if bShowCursor == nil then
-        if activeMenuSheets.size > 0 then
-            bShowCursor = activeMenuSheets.topSheet.bShowCursor
-        else
-            bShowCursor = true
-        end
+function showGUI(name, bHidePrevious)
+    -- Get sheet (or load it)
+    local menuSheet = loadSheet(name)
+    if not menuSheet then
+        return nil
+    end
+
+    -- Use sheet's value if nil was provided
+    if bHidePrevious == nil then
+        bHidePrevious = menuSheet.bHidePrevious
+        assert(bHidePrevious ~= nil)
     end
 
@@ -101,38 +100,8 @@
     end
 
-    if not root then
-        setBackground("")
-    end
-
-    -- Get sheet (or load it)
-    local menuSheet = loadSheet(name)
-    if not menuSheet then
-        return
-    end
-
-    -- Add sheet to the root window
-    root:addChildWindow(menuSheet.window)
-
-    -- Pause game control if this is the first menu to be displayed
-    -- HUGE HACK?
-    if activeMenuSheets.size == 0 then
-        orxonox.HumanController:pauseControl()
-    end
-
-    -- Handle input distribution
-    orxonox.InputManager:getInstance():enterState(menuSheet.inputState)
-
-    if bShowCursor then
-        showCursor()
-    else
-        hideCursor()
-    end
-
     -- Add the sheet in a tuple of additional information
     local sheetTuple =
     {
-        ["menuSheet"]      = menuSheet,
-        ["name"]           = name,
-        ["bShowCursor"]    = bShowCursor,
+        ["sheet"]          = menuSheet,
         ["bHidePrevious"]  = bHidePrevious
     }
@@ -140,14 +109,38 @@
     activeMenuSheets[name] = sheetTuple -- name access
     activeMenuSheets.size = activeMenuSheets.size + 1
-    activeMenuSheets.topSheet = sheetTuple
+    activeMenuSheets.topSheetTuple = sheetTuple
+
+    if not root then
+        setBackground("")
+    end
+
+    -- Add sheet to the root window
+    root:addChildWindow(menuSheet.window)
+
+    -- Pause game control if this is the first menu to be displayed
+    -- HUGE HACK?
+    if activeMenuSheets.size == 0 then
+        orxonox.HumanController:pauseControl()
+    end
+
+    -- Handle input distribution
+    orxonox.InputManager:getInstance():enterState(menuSheet.inputState)
+
+    -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare
+    if menuSheet.tShowCursor == TriBool.True then
+        showCursor()
+    elseif menuSheet.tShowCursor == TriBool.False then
+        hideCursor()
+    end
 
     -- Hide all previous sheets if necessary
     if bHidePrevious then
         for i = 1, activeMenuSheets.size - 1 do
-            activeMenuSheets[i].menuSheet:hide()
+            activeMenuSheets[i].sheet:hide()
         end
     end
 
     menuSheet:show()
+
     return menuSheet
 end
@@ -160,17 +153,17 @@
 
     -- Hide the sheet
-    sheetTuple.menuSheet:hide()
+    sheetTuple.sheet:hide()
 
     -- Show sheets that were hidden by the sheet to be removed
     local i = activeMenuSheets.size
     -- Only do something if all sheets on top of sheetTuple
-    -- have bHidePrevious == false and sheetTuple.bHidePrevious == true
+    -- have bHidePrevious == true and sheetTuple.bHidePrevious == true
     while i > 0 do
-        if activeMenuSheets[i].bHidePrevious == true then
+        if activeMenuSheets[i].bHidePrevious then
             if activeMenuSheets[i] == sheetTuple then
                 i = i - 1
                 while i > 0 do
-                    activeMenuSheets[i].menuSheet:show()
-                    if activeMenuSheets[i].bHidePrevious == true then
+                    activeMenuSheets[i].sheet:show()
+                    if activeMenuSheets[i].bHidePrevious then
                         break
                     end
@@ -184,15 +177,20 @@
 
     -- Remove sheet with its tuple from the table
-    root:removeChildWindow(sheetTuple.menuSheet.window)
+    root:removeChildWindow(sheetTuple.sheet.window)
     table.remove(activeMenuSheets, table.findIndex(activeMenuSheets, sheetTuple))
     activeMenuSheets[name] = nil
     activeMenuSheets.size = activeMenuSheets.size - 1
-    activeMenuSheets.topSheet = activeMenuSheets[activeMenuSheets.size]
+    activeMenuSheets.topSheetTuple = activeMenuSheets[activeMenuSheets.size]
 
     -- Leave the input state
-    orxonox.InputManager:getInstance():leaveState(sheetTuple.menuSheet.inputState)
+    orxonox.InputManager:getInstance():leaveState(sheetTuple.sheet.inputState)
     
-    -- See whether to show or hide cursor
-    if activeMenuSheets.size > 0 and activeMenuSheets.topSheet.bShowCursor then
+    -- CURSOR SHOWING
+    local i = activeMenuSheets.size
+    -- Find top most sheet that doesn't have tShowCusor == TriBool.Dontcare
+    while i > 0 and activeMenuSheets[i].sheet.tShowCursor == TriBool.Dontcare do
+        i = i - 1
+    end
+    if i > 0 and activeMenuSheets[i].sheet.tShowCursor == TriBool.True then
         showCursor()
     else
@@ -210,5 +208,5 @@
 function hideAllGUIs()
     while activeMenuSheets.size ~= 0 do
-        hideGUI(activeMenuSheets.topSheet.name)
+        hideGUI(activeMenuSheets.topSheetTuple.sheet.name)
     end
 end
@@ -216,8 +214,8 @@
 function keyESC()
     -- HUGE, very HUGE hacks!
-    if activeMenuSheets.size == 1 and activeMenuSheets[1].name == "MainMenu" then
+    if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
         orxonox.execute("exit")
     elseif activeMenuSheets.size > 0 then
-        orxonox.execute("hideGUI "..activeMenuSheets.topSheet.name)
+        orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name)
     else
         showGUI("InGameMenu")
Index: code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- KeyBindMenu.lua
 
-local P = createSheet("KeyBindMenu")
+local P = createMenuSheet("KeyBindMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/MainMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MainMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/MainMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- MainMenu.lua
 
-local P = createSheet("MainMenu")
+local P = createMenuSheet("MainMenu")
 
 -- events for MainMenu
Index: code/branches/gamestates2/data/gui/scripts/MenuSheet.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MenuSheet.lua	(revision 6718)
+++ code/branches/gamestates2/data/gui/scripts/MenuSheet.lua	(revision 6718)
@@ -0,0 +1,36 @@
+-- MenuSheet.lua
+-- Base class for all GUI sheets that represent a menu.
+-- Inherits itself from GUISheet
+
+local P = {}  -- Local alias, always use it in this file
+MenuSheet = P -- Global name
+setmetatable(P, require("GUISheet")) -- Inherit from GUISheet
+P.__index = P -- Provide class character
+
+-- Use this function to construct a new MenuSheet.
+-- Parameters:
+-- Except for _name, you can provide nil. Then the default value will be used.
+-- For _tShowCusor and _tUseKeyboard you can specify TriBool.Dontcare if the value doesn't matter at all. Then the value of the underlaying sheet will be used.
+function P.new(_name, _bHidePrevious, _tShowCursor, _tUseKeyboard, _bBlockJoyStick)
+    local newSheet = GUISheet.new(_name)
+    newSheet.bHidePrevious  = handleDefArg(_bHidePrevious,  true)
+    newSheet.tShowCursor    = handleDefArg(_tShowCusor,     TriBool.True)
+    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.True)
+    newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
+
+    setmetatable(newSheet, P)
+    return newSheet
+end
+
+function P:load()
+    -- Create the input state
+    self.inputState = guiMgr:createInputState("GUI_" .. self.name,
+        self.tShowCursor, self.tUseKeyboard, self.bBlockJoyStick)
+
+    -- load() of base 'class'
+    GUISheet.load(self)
+
+    return self
+end
+
+return P
Index: code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- MouseControlsMenu.lua
 
-local P = createSheet("MouseControlsMenu")
+local P = createMenuSheet("MouseControlsMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- MultiplayerMenu.lua
 
-local P = createSheet("MultiplayerMenu")
+local P = createMenuSheet("MultiplayerMenu")
 
 function P.init()
Index: code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- MultiplayerOptionsMenu.lua
 
-local P = createSheet("MultiplayerOptionsMenu")
+local P = createMenuSheet("MultiplayerOptionsMenu")
 
 function P.MultiplayerOptionsBackButton_clicked(e)
Index: code/branches/gamestates2/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/PickupInventory.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/PickupInventory.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- PickupInventory.lua
 
-local P = createSheet("PickupInventory")
+local P = createMenuSheet("PickupInventory")
 
 P.lastEquipmentCount_ = 0
Index: code/branches/gamestates2/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/QuestGUI.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/QuestGUI.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- QuestGUI.lua
 
-local P = createSheet("QuestGUI")
+local P = createMenuSheet("QuestGUI")
 
 function P.show()
Index: code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- SettingsMenu.lua
 
-local P = createSheet("SettingsMenu")
+local P = createMenuSheet("SettingsMenu")
 
 function P.SettingsGameplayButton_clicked(e)
Index: code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua	(revision 6704)
+++ code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua	(revision 6718)
@@ -1,5 +1,5 @@
 -- SingleplayerMenu.lua
 
-local P = createSheet("SingleplayerMenu")
+local P = createMenuSheet("SingleplayerMenu")
 
 function P.init()
