Index: code/trunk/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/AudioMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/AudioMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- AudioMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    AudioMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("AudioMenu")
 
-P.filename = "AudioMenu"
-P.layoutString = "AudioMenu.layout"
-
-function P:init()
+function P.onLoad()
     soundMgr = orxonox.SoundManager:getInstance()
     block = false
@@ -43,5 +34,5 @@
     for k,v in pairs(themeList) do
         item = CEGUI.createListboxTextItem(v)
-        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
         CEGUI.toListbox(listboxwindow):addItem(item)
     end
@@ -178,5 +169,5 @@
 
 function P.AudioBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/BasicGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/BasicGUI.lua	(revision 6711)
+++ 	(revision )
@@ -1,42 +1,0 @@
--- gui.lua
-
-local P = {}
-if _REQUIREDNAME == nil then
-    BasicGUI = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.overlay = nil
-
--- constructor of the GUI
-function P:new (gui, fname)
-    local newElement = { window = gui, filename = fname, visible = false } or {}
-    setmetatable(newElement, self) -- connects new element with class
-    self.__index = self
-    return newElement
-end
-
-function P:init()
--- this function is empty and intended for inheriting GUIs to use
-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.layoutString)
-    self:init()
-    return self
-end
-
-return P
Index: code/trunk/data/gui/scripts/ControlsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/ControlsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/ControlsMenu.lua	(revision 6746)
@@ -1,25 +1,16 @@
 -- ControlsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    ControlsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "ControlsMenu"
-P.layoutString = "ControlsMenu.layout"
+local P = createMenuSheet("ControlsMenu")
 
 function P.ControlsMouseControlsButton_clicked(e)
-    showGUI("MouseControlsMenu", true)
+    showMenuSheet("MouseControlsMenu", true)
 end
 
 function P.ControlsKeyboardControlsButton_clicked(e)
-    showGUI("KeyBindMenu", true)
+    showMenuSheet("KeyBindMenu", true)
 end
 
 function P.ControlsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/CreditsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/CreditsMenu.lua	(revision 6746)
@@ -1,17 +1,8 @@
 -- CreditsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    CreditsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "CreditsMenu"
-P.layoutString = "CreditsMenu.layout"
+local P = createMenuSheet("CreditsMenu")
 
 function P.CreditsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/DecisionPopup.lua
===================================================================
--- code/trunk/data/gui/scripts/DecisionPopup.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/DecisionPopup.lua	(revision 6746)
@@ -1,17 +1,5 @@
 -- DecisionPopup.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    DecisionPopup = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "DecisionPopup"
-P.layoutString = "DecisionPopup.layout"
-
-function P:init()
-end
+local P = createMenuSheet("DecisionPopup")
 
 function P.setCallback(functionPtr)
@@ -28,5 +16,5 @@
         P.functionPtr(true)
     end
-    hideGUI("DecisionPopup")
+    hideMenuSheet("DecisionPopup")
 end
 
@@ -35,5 +23,5 @@
         P.functionPtr(false)
     end
-    hideGUI("DecisionPopup")
+    hideMenuSheet("DecisionPopup")
 end
 
Index: code/trunk/data/gui/scripts/GUISheet.lua
===================================================================
--- code/trunk/data/gui/scripts/GUISheet.lua	(revision 6746)
+++ code/trunk/data/gui/scripts/GUISheet.lua	(revision 6746)
@@ -0,0 +1,43 @@
+-- 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
+function P:onLoad()
+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:onLoad()
+    return self
+end
+
+return P
Index: code/trunk/data/gui/scripts/GUITools.lua
===================================================================
--- code/trunk/data/gui/scripts/GUITools.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/GUITools.lua	(revision 6746)
@@ -1,4 +1,19 @@
+-- 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
+
 function openDecisionPopup( text, callbackPtr )
-    showGUI("DecisionPopup", false, true)
+    showMenuSheet("DecisionPopup", false, true)
     DecisionPopup.setCallback(callbackPtr)
     DecisionPopup.setText(text)
@@ -6,5 +21,5 @@
 
 function openInfoPopup(text, functionPtr, closeButton, arguments)
-    showGUI("InfoPopup", false, true)
+    showMenuSheet("InfoPopup", false, true)
     InfoPopup.execute(functionPtr, arguments)
     InfoPopup.setText(text)
Index: code/trunk/data/gui/scripts/GameplayMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/GameplayMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/GameplayMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- GameplayMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    GameplayMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("GameplayMenu")
 
-P.filename = "GameplayMenu"
-P.layoutString = "GameplayMenu.layout"
-
-function P:init()
+function P.onLoad()
     dropdown = winMgr:getWindow("orxonox/ThemeCombobox")
     local themeList = {}
@@ -20,5 +11,5 @@
     for k,v in pairs(themeList) do
         item = CEGUI.createListboxTextItem(v)
-        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
         CEGUI.toCombobox(dropdown):addItem(item)
     end
@@ -27,24 +18,24 @@
 function P.GameplayThemeCombobox_changed(e)
     -- theme
-    debug("event: theme")
+    logMessage(0, "event: theme")
 end
 
 function P.GameplayDifficultyEasyButton_clicked(e)
     -- difficulty easy
-    debug("event: easy")
+    logMessage(0, "event: easy")
 end
 
 function P.GameplayDifficultyNormalButton_clicked(e)
     -- difficulty normal
-    debug("event: normal")
+    logMessage(0, "event: normal")
 end
 
 function P.GameplayDifficultyHardButton_clicked(e)
     -- difficulty hard
-    debug("event: hard")
+    logMessage(0, "event: hard")
 end
 
 function P.GameplayBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/GraphicsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/GraphicsMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- GraphicsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    GraphicsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("GraphicsMenu")
 
-P.filename = "GraphicsMenu"
-P.layoutString = "GraphicsMenu.layout"
-
-function P:init()
+function P.onLoad()
     block = true
     file = orxonox.PathConfig:getConfigPathString() .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_")
@@ -62,5 +53,5 @@
     for k,v in pairs(resolutionList) do
         item = CEGUI.createListboxTextItem(v)
-        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
         CEGUI.toListbox(listboxwindow):addItem(item)
     end
@@ -152,5 +143,5 @@
     if scrollbar_active == false then
         -- brightness
-        debug("event: brightness")
+        logMessage(0, "event: brightness")
     end
 end
@@ -162,5 +153,5 @@
 function P.GraphicsBrightnessScrollbar_ended(e)
     -- brightness
-    debug("event: brightness")
+    logMessage(0, "event: brightness")
     scrollbar_active = false
 end
@@ -201,5 +192,5 @@
 
 function P.GraphicsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/HUDSheet.lua
===================================================================
--- code/trunk/data/gui/scripts/HUDSheet.lua	(revision 6746)
+++ code/trunk/data/gui/scripts/HUDSheet.lua	(revision 6746)
@@ -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/trunk/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/InGameMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/InGameMenu.lua	(revision 6746)
@@ -1,18 +1,5 @@
 -- InGameMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    InGameMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "InGameMenu"
-P.layoutString = "InGameMenu.layout"
-
-function P:init()
-end
-
+local P = createMenuSheet("InGameMenu")
 
 -- events for ingamemenu
@@ -25,18 +12,18 @@
     orxonox.Game:getInstance():popState()
     orxonox.Game:getInstance():requestState("mainmenu")
-    hideGUI("InGameMenu")
+    hideMenuSheet("InGameMenu")
 end
 
 function P.button_settings_clicked(e)
-    showGUI("SettingsMenu", true)
+    showMenuSheet("SettingsMenu", true)
 end
 
 function P.button_return_clicked(e)
-    hideGUI("InGameMenu")
+    hideMenuSheet("InGameMenu")
 end
 
 function P.callback(doExit)
     if doExit then
-        hideGUI("InGameMenu")
+        hideMenuSheet("InGameMenu")
         orxonox.execute("exit")
     end
Index: code/trunk/data/gui/scripts/InfoPopup.lua
===================================================================
--- code/trunk/data/gui/scripts/InfoPopup.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/InfoPopup.lua	(revision 6746)
@@ -1,18 +1,5 @@
 -- InfoPopup.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-
-if _REQUIREDNAME == nil then
-    InfoPopup = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "InfoPopup"
-P.layoutString = "InfoPopup.layout"
-
-function P:init()
-end
+local P = createMenuSheet("InfoPopup")
 
 function P.execute(functionPtr, arguments)
@@ -26,5 +13,5 @@
 end
 
-function P.setText( text )
+function P.setText(text)
     winMgr:getWindow("orxonox/InfoPopup_text"):setText( text )
 end
@@ -42,5 +29,5 @@
 -- events for ingamemenu
 function P.close(e)
-    hideGUI("InfoPopup")
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/InitialiseGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/InitialiseGUI.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/InitialiseGUI.lua	(revision 6746)
@@ -1,228 +1,31 @@
-local schemeMgr = CEGUI.SchemeManager:getSingleton()
-winMgr = CEGUI.WindowManager:getSingleton()
-local logger = CEGUI.Logger:getSingleton()
-local system = CEGUI.System:getSingleton()
-local cursor = CEGUI.MouseCursor:getSingleton()
+-- Define some global shortcuts for common Managers
+guiMgr    = orxonox.GUIManager:getInstance()
+inputMgr  = orxonox.InputManager:getInstance()
+schemeMgr = CEGUI.SchemeManager:getSingleton()
+winMgr    = CEGUI.WindowManager:getSingleton()
 
-schemeMgr:loadScheme("TaharezLookSkin.scheme")
--- load scheme with our own images
+-- Load all required skins
+schemeMgr:loadScheme("TaharezGreenLook.scheme")
+--schemeMgr:loadScheme("TaharezLook.scheme")
+--schemeMgr:loadScheme("WindowsLook.scheme")
+--schemeMgr:loadScheme("VanillaLook.scheme")
+--schemeMgr:loadScheme("SleekSpaceLook.scheme")
+
+-- Connect skin specific window types with our own window types
+-- By loading a different file (if there is) you can change the skin
+-- of the menus or the HUD independently
+schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
+menuImageSet = "TaharezGreenLook"
+schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
+hudImageSet = "TaharezGreenLook"
+
+-- Just a remaining test hack
 schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
 
-system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+local system = CEGUI.System:getSingleton()
+system:setDefaultMouseCursor(menuImageSet, "MouseArrow")
 system:setDefaultFont("BlueHighway-12")
-system:setDefaultTooltip("TaharezLook/Tooltip")
+system:setDefaultTooltip("MenuWidgets/Tooltip")
 
-loadedGUIs = {}
-cursorVisibility = {}
-activeSheets = {}
-nrOfActiveSheets = 0
-root = nil
-bShowsCursor = false
-bHidePrevious = {}
-
--- Require all tools
+-- Convenience function and additional tools
 require("GUITools")
-
--- loads the GUI with the specified filename
--- be sure to set the global variable "filename" before calling this function
-function loadGUI(filename)
-    -- check if it already exists
-    loadedGui = loadedGUIs[filename]
-    if loadedGui == nil then
-        loadedGuiNS = require(filename)
-        if loadedGuiNS == nil then
-            return
-        end
-        loadedGui = loadedGuiNS:load()
-        loadedGUIs[filename] = loadedGui
-        -- if there has no GUI been loaded yet, set new GUI as current
-        if table.getn(loadedGUIs) == 1 then
-            current = loadedGUIs[1]
-        end
-        -- hide new GUI as we do not want to show it accidentially
-        loadedGui:hide()
-    end
-    return loadedGui
-end
-
-function showGUI(filename, hidePrevious, bCursorVisible, ptr)
-    gui = showGUI(filename, hidePrevious, bCursorVisible)
-    gui.overlay = ptr
-end
-
--- shows the specified and loads it if not loaded already
--- be sure to set the global variable "filename" before calling this function
-function showGUI(filename, hidePrevious, bCursorVisible)
-    if bCursorVisible == nil then
-        if nrOfActiveSheets > 0 then
-            bCursorVisible = cursorVisibility[activeSheets[nrOfActiveSheets]]
-        else
-            bCursorVisible = true
-        end
-    end
-
-    if root == nil then
-        setBackground("")
-    end
-
-    local currentGUI = loadedGUIs[filename]
-    if(currentGUI == nil) then
-        currentGUI = loadGUI(filename)
-    end
-
-    if(root:isChild(currentGUI.window)) then
-        root:removeChildWindow(currentGUI.window)
-    end
-    root:addChildWindow(currentGUI.window)
-
-    if bCursorVisible then
-        showCursor()
-    else
-        hideCursor()
-    end
-
-    if find( activeSheets, filename ) ~= nil then
-        table.remove( activeSheets, find( activeSheets, filename ) )
-        nrOfActiveSheets = nrOfActiveSheets - 1
-    else
-        if nrOfActiveSheets == 0 then
-            orxonox.InputManager:getInstance():enterState("guiMouseOnly")
-            orxonox.HumanController:pauseControl()
-        end
-    end
-    nrOfActiveSheets = nrOfActiveSheets + 1
-    table.insert(activeSheets, filename)
-    activeSheets[nrOfActiveSheets] = filename
-    bHidePrevious[filename]=hidePrevious
-    cursorVisibility[filename] = bCursorVisible
-
-    if hidePrevious == true then
-        for i=1,nrOfActiveSheets-1 do
-            loadedGUIs[ activeSheets[i] ]:hide()
-        end
-    end
-    currentGUI:show()
-    return currentGUI
-end
-
-function hideCursor()
-    if bShowsCursor==true then
-        bShowsCursor=false
-        cursor:hide()
-    end
-end
-
-function showCursor()
-    if bShowsCursor==false then
-        bShowsCursor=true
-        cursor:show()
-    end
-end
-
-function hideGUI(filename)
-    local currentGUI = loadedGUIs[filename]
-    if currentGUI == nil then
-        return
-    end
-    currentGUI:hide()
-    if bHidePrevious[filename] == true then
-        local i = nrOfActiveSheets-1
-        while i>0 do
-            loadedGUIs[ activeSheets[i] ]:show()
-            if bHidePrevious[filename]==true then
-                break
-            else
-                i=i-1
-            end
-        end
-    end
-    root:removeChildWindow(currentGUI.window)
-    local i=1
-    while activeSheets[i] do
-        if activeSheets[i+1] == nil then
-            if activeSheets[i-1] ~= nil then
-                if cursorVisibility[ activeSheets[i-1] ] == true then
-                    showCursor()
-                else
-                    hideCursor()
-                end
-            else
-                hideCursor()
-            end
-        end
-        if activeSheets[i] == filename then
-            table.remove( activeSheets, i )
-            nrOfActiveSheets = nrOfActiveSheets-1
-        else
-            i = i+1
-        end
-    end
-    cursorVisibility[filename] = nil -- remove the cursor visibility of the current gui from the table
-    bHidePrevious[filename] = nil
-    if nrOfActiveSheets == 0 then
-        orxonox.InputManager:getInstance():leaveState("guiMouseOnly")
-        orxonox.HumanController:resumeControl()
-        hideCursor()
-    end
-end
-
-function hideAllGUIs()
-    while nrOfActiveSheets ~= 0 do
-        hideGUI(activeSheets[nrOfActiveSheets])
-    end
-end
-
-function keyESC()
-    if nrOfActiveSheets == 1 and activeSheets[1] == "MainMenu" then
-        orxonox.execute("exit")
-    elseif nrOfActiveSheets > 0 then
-        orxonox.execute("hideGUI "..activeSheets[nrOfActiveSheets])
-    else
-        showGUI("InGameMenu")
-    end
-end
-
-function setBackground(filename)
-    local newroot
-    if root ~= nil then
-        root:rename("oldRootWindow")
-    end
-    if filename ~= "" then
-        newroot = winMgr:loadWindowLayout(filename .. ".layout")
-        newroot:rename("AbsoluteRootWindow")
-        system:setGUISheet(newroot)
-    else
-        newroot = winMgr:createWindow("DefaultWindow", "AbsoluteRootWindow")
-        newroot:setProperty("Alpha", "0.0")
-        newroot:setSize(CEGUI.UVector2(CEGUI.UDim(1.0,0),CEGUI.UDim(1.0,0)))
-        system:setGUISheet(newroot)
-    end
-    if root ~= nil then
-        local child
-        while root:getChildCount()~=0 do
-            child = root:getChildAtIdx(0)
-            root:removeChildWindow(child)
-            newroot:addChildWindow(child)
-        end
-        winMgr:destroyWindow(root)
-    end
-    newroot:show()
-    root = newroot
-end
-
-function find(table, value)
-    local i=0
-    while table[i] ~= nil do
-        if table[i]==value then
-            return i
-        else
-            i=i+1
-        end
-    end
-    return nil
-end
-
---TODO: Needed?
-function test(e)
-    debug(0, "Blubb")
-end
Index: code/trunk/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/KeyBindMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/KeyBindMenu.lua	(revision 6746)
@@ -1,17 +1,7 @@
 -- KeyBindMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-
-if _REQUIREDNAME == nil then
-    KeyBindMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "KeyBindMenu"
-P.layoutString = "KeyBindMenu.layout"
-
-function P:init()
+local P = createMenuSheet("KeyBindMenu")
+
+function P.onLoad()
 
     commandList = {}
@@ -68,5 +58,5 @@
 
     --Calculate design parameters:
-    sampleWindow = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/SampleWindow")
+    sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/SampleWindow")
     sampleWindow:setText("SampleText")
 
@@ -125,5 +115,5 @@
     line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, lineHeight*(k-1))))
 
-    local command = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
+    local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
     command:setText(nameList[k])
     command:setSize(CEGUI.UVector2(CEGUI.UDim(0, commandWidth), CEGUI.UDim(1, 0)))
@@ -132,9 +122,9 @@
     offset = offset + commandWidth + spaceWidth
 
-    local plus = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")
+    local plus = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")
     plus:setSize(CEGUI.UVector2(CEGUI.UDim(0, addWidth), CEGUI.UDim(0.7, 0)))
     plus:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
     plus:setText("add")
-    orxonox.GUIManager:subscribeEventHelper(plus, "Clicked", P.filename .. ".KeyBindPlus_clicked")
+    orxonox.GUIManager:subscribeEventHelper(plus, "Clicked", P.name .. ".KeyBindPlus_clicked")
     line:addChildWindow(plus)
     offset = offset + addWidth + spaceWidth
@@ -142,5 +132,5 @@
     local numButtons = orxonox.KeyBinderManager:getInstance():getCurrent():getNumberOfBindings(commandList[k]);
     for i=0,(numButtons-1) do
-        local button = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)
+        local button = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)
         local name = orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(commandList[k],i)
         name = P.KeyNameNiceifier(name)
@@ -151,14 +141,14 @@
         button:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0.7, 0)))
         button:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
-        orxonox.GUIManager:subscribeEventHelper(button, "Clicked", P.filename .. ".KeyBindButton_clicked")
-        --button:subscribeScriptedEvent("EventClicked", P.filename .. ".KeyBindButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(button, "Clicked", P.name .. ".KeyBindButton_clicked")
+        --button:subscribeScriptedEvent("EventClicked", P.name .. ".KeyBindButton_clicked")
         line:addChildWindow(button)
         offset = offset + buttonWidth
 
-        local clear = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)
+        local clear = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)
         clear:setSize(CEGUI.UVector2(CEGUI.UDim(0, clearWidth), CEGUI.UDim(0.7, 0)))
         clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
         clear:setText("X")
-        orxonox.GUIManager:subscribeEventHelper(clear, "Clicked", P.filename .. ".KeyBindClear_clicked")
+        orxonox.GUIManager:subscribeEventHelper(clear, "Clicked", P.name .. ".KeyBindClear_clicked")
         line:addChildWindow(clear)
         offset = offset + clearWidth + spaceWidth
@@ -254,5 +244,5 @@
 
 function P.KeyBindBackButton_clicked(e)
-    hideGUI("KeyBindMenu")
+    hideMenuSheet("KeyBindMenu")
 end
 
Index: code/trunk/data/gui/scripts/MainMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MainMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/MainMenu.lua	(revision 6746)
@@ -1,14 +1,5 @@
 -- MainMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    MainMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "MainMenu"
-P.layoutString = "MainMenu.layout"
+local P = createMenuSheet("MainMenu")
 
 -- events for MainMenu
@@ -18,17 +9,17 @@
 
 function P.SingleplayerButton_clicked(e)
-    showGUI("SingleplayerMenu", true)
+    showMenuSheet("SingleplayerMenu", true)
 end
 
 function P.MultiplayerButton_clicked(e)
-    showGUI("MultiplayerMenu", true)
+    showMenuSheet("MultiplayerMenu", true)
 end
 
 function P.SettingsButton_clicked(e)
-    showGUI("SettingsMenu", true)
+    showMenuSheet("SettingsMenu", true)
 end
 
 function P.CreditsButton_clicked(e)
-    showGUI("CreditsMenu", true)
+    showMenuSheet("CreditsMenu", true)
 end
 
Index: code/trunk/data/gui/scripts/MenuSheet.lua
===================================================================
--- code/trunk/data/gui/scripts/MenuSheet.lua	(revision 6746)
+++ code/trunk/data/gui/scripts/MenuSheet.lua	(revision 6746)
@@ -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.Dontcare)
+    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/trunk/data/gui/scripts/MouseControlsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MouseControlsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/MouseControlsMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- MouseControlsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    MouseControlsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("MouseControlsMenu")
 
-P.filename = "MouseControlsMenu"
-P.layoutString = "MouseControlsMenu.layout"
-
-function P:init()
+function P.onLoad()
     block = false
     mousenormalscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseNormalScrollbar"),"CEGUI::Scrollbar")
@@ -104,5 +95,5 @@
 
 function P.MouseControlsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MultiplayerMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/MultiplayerMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- MultiplayerMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    MultiplayerMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("MultiplayerMenu")
 
-P.filename = "MultiplayerMenu"
-P.layoutString = "MultiplayerMenu.layout"
-
-function P:init()
+function P.onLoad()
     listbox = winMgr:getWindow("orxonox/MultiplayerLevelListbox")
     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
@@ -30,5 +21,5 @@
     for k,v in pairs(levelList) do
         item = CEGUI.createListboxTextItem(v)
-        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
         CEGUI.toListbox(listbox):addItem(item)
         if v .. ".oxw" == preselect then
@@ -71,10 +62,10 @@
         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
         orxonox.execute(multiplayerMode)
-        hideAllGUIs()
+        hideAllMenuSheets()
     end
 end
 
 function P.MultiplayerBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/MultiplayerOptionsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6746)
@@ -1,17 +1,8 @@
 -- MultiplayerOptionsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    MultiplayerOptionsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "MultiplayerOptionsMenu"
-P.layoutString = "MultiplayerOptionsMenu.layout"
+local P = createMenuSheet("MultiplayerOptionsMenu")
 
 function P.MultiplayerOptionsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/trunk/data/gui/scripts/PickupInventory.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/PickupInventory.lua	(revision 6746)
@@ -1,15 +1,5 @@
 -- PickupInventory.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-
-if _REQUIREDNAME == nil then
-    PickupInventory = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "PickupInventory"
-P.layoutString = "PickupInventory.layout"
+local P = createMenuSheet("PickupInventory")
 
 P.carrierList = {}
@@ -17,5 +7,5 @@
 P.detailsWindows = {}
 
-function P.init()
+function P.onLoad()
     carrierList = {}
 end
@@ -23,5 +13,5 @@
 function P.show()
     P.window:show() -- TODO: Do this through parent...
-    P.visible = true 
+    P.bVisible = true 
     
     P.createInventory()
@@ -137,5 +127,5 @@
         useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
         useButton:setText("use")
-        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.filename .. ".InventoryUseButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
         item:addChildWindow(useButton)
         
@@ -144,5 +134,5 @@
         dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
         dropButton:setText("drop")
-        orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.filename .. ".InventoryDropButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
         item:addChildWindow(dropButton)
         
@@ -151,5 +141,5 @@
         detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
         detailsButton:setText("details")
-        orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.filename .. ".InventoryDetailsButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name .. ".InventoryDetailsButton_clicked")
         item:addChildWindow(detailsButton)
     end
@@ -201,5 +191,5 @@
     local window = winMgr:createWindow("TaharezLook/FrameWindow", name)
     window:setSize(CEGUI.UVector2(CEGUI.UDim(0.5,0),CEGUI.UDim(0.4,0)))
-    orxonox.GUIManager:subscribeEventHelper(window, "CloseClicked", P.filename .. ".closeDetailWindow")
+    orxonox.GUIManager:subscribeEventHelper(window, "CloseClicked", P.name .. ".closeDetailWindow")
     
     local root = winMgr:getWindow("orxonox/PickupInventory/Background")
@@ -240,5 +230,5 @@
     useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, titleHeight)))
     useButton:setText("use")
-    orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.filename .. ".InventoryUseButton_clicked")
+    orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
     wrapper:addChildWindow(useButton)
     
@@ -247,5 +237,5 @@
     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, titleHeight)))
     dropButton:setText("drop")
-    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.filename .. ".InventoryDropButton_clicked")
+    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
     wrapper:addChildWindow(dropButton)
     
Index: code/trunk/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/QuestGUI.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/QuestGUI.lua	(revision 6746)
@@ -1,16 +1,9 @@
-gui = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    QuestGUI = P
-else
-    _G[_REQUIREDNAME] = P
-end
+-- QuestGUI.lua
 
-P.filename = "QuestGUI"
-P.layoutString = "QuestGUI.layout"
+local P = createMenuSheet("QuestGUI")
 
-function P:show()
-    self.window:show() -- TODO: Do this through parent...
-    self.visible = true
+function P.show()
+    P.window:show() -- TODO: Do this through parent...
+    P.visible = true
 
     local questManager = orxonox.QuestManager:getInstance()
@@ -18,5 +11,5 @@
     local questsList = winMgr:getWindow("orxonox/QuestGUI/QuestsList")
 
-    local window = questManager:getQuestGUI(P.filename)
+    local window = questManager:getQuestGUI(P.name)
 
     questsList:addChildWindow(window)
Index: code/trunk/data/gui/scripts/SettingsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SettingsMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/SettingsMenu.lua	(revision 6746)
@@ -1,42 +1,33 @@
 -- SettingsMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    SettingsMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
-
-P.filename = "SettingsMenu"
-P.layoutString = "SettingsMenu.layout"
+local P = createMenuSheet("SettingsMenu")
 
 function P.SettingsGameplayButton_clicked(e)
-    showGUI("GameplayMenu", true)
+    showMenuSheet("GameplayMenu", true)
 end
 
 function P.SettingsMultiplayerOptionsButton_clicked(e)
-    showGUI("MultiplayerOptionsMenu", true)
+    showMenuSheet("MultiplayerOptionsMenu", true)
 end
 
 function P.SettingsControlsButton_clicked(e)
-    showGUI("ControlsMenu", true)
+    showMenuSheet("ControlsMenu", true)
 end
 
 function P.SettingsGraphicsButton_clicked(e)
-    showGUI("GraphicsMenu", true)
+    showMenuSheet("GraphicsMenu", true)
 end
 
 function P.SettingsAudioButton_clicked(e)
-    showGUI("AudioMenu", true)
+    showMenuSheet("AudioMenu", true)
 end
 
 function P.SettingsResetSettingsButton_clicked(e)
     -- reset settings
-    debug("event: reset settings")
+    logMessage(0, "event: reset settings")
 end
 
 function P.SettingsBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
Index: code/trunk/data/gui/scripts/SheetManager.lua
===================================================================
--- code/trunk/data/gui/scripts/SheetManager.lua	(revision 6746)
+++ code/trunk/data/gui/scripts/SheetManager.lua	(revision 6746)
@@ -0,0 +1,197 @@
+-- SheetManager.lua
+
+local cursor = CEGUI.MouseCursor:getSingleton()
+local loadedSheets = {}
+local activeMenuSheets = {size = 0, topSheetTuple = nil}
+local menuSheetsRoot = guiMgr:getMenuRootWindow()
+
+-----------------------
+--- Local functions ---
+-----------------------
+
+local function hideCursor()
+    if cursor:isVisible() then
+        cursor:hide()
+    end
+end
+
+local function showCursor()
+    if not cursor:isVisible() and inputMgr:isMouseExclusive() then
+        cursor:show()
+    end
+end
+
+
+------------------------
+--- Global functions ---
+------------------------
+
+-- Loads the GUI with the specified name
+-- The name corresponds to the filename of the *.lua and *.layout files
+-- but without the extension
+function loadSheet(name)
+    -- Check if it has already been loaded
+    local sheet = loadedSheets[name]
+    if sheet == nil then
+        -- Load the sheet
+        sheet = require(name)
+        sheet:load()
+        loadedSheets[name] = sheet
+    end
+    return sheet
+end
+
+-- ?
+function showMenuSheet(name, bHidePrevious, ptr)
+    local sheet = showMenuSheet(name, bHidePrevious)
+    sheet.overlay = ptr
+    return sheet
+end
+
+-- Shows the specified menu sheet and loads it if neccessary
+function showMenuSheet(name, bHidePrevious)
+    if name == "" then
+        return nil
+    end
+    -- Get sheet (or load it)
+    local menuSheet = loadSheet(name)
+
+    -- Use sheet's value if nil was provided
+    if bHidePrevious == nil then
+        bHidePrevious = menuSheet.bHidePrevious
+        assert(bHidePrevious ~= nil)
+    end
+
+    -- Pause game control if this is the first menu to be displayed
+    -- HUGE HACK?
+    if activeMenuSheets.size == 0 then
+        orxonox.HumanController:pauseControl()
+    end
+
+    -- Hide if already displayed (to make sure it is up front in the end)
+    if activeMenuSheets[name] ~= nil then
+        hideMenuSheet(name)
+    end
+
+    -- Add the sheet in a tuple of additional information
+    local sheetTuple =
+    {
+        ["sheet"]          = menuSheet,
+        ["bHidePrevious"]  = bHidePrevious
+    }
+    table.insert(activeMenuSheets, sheetTuple) -- indexed array access
+    activeMenuSheets[name] = sheetTuple -- name access
+    activeMenuSheets.size = activeMenuSheets.size + 1
+    activeMenuSheets.topSheetTuple = sheetTuple
+
+    -- Add sheet to the root window
+    menuSheetsRoot:addChildWindow(menuSheet.window)
+
+    -- Handle input distribution
+    inputMgr: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].sheet:hide()
+        end
+    end
+
+    menuSheet:show()
+
+    return menuSheet
+end
+
+function hideMenuSheet(name)
+    local sheetTuple = activeMenuSheets[name]
+    if sheetTuple == nil then
+        return
+    end
+
+    -- Hide the sheet
+    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 == true and sheetTuple.bHidePrevious == true
+    while i > 0 do
+        if activeMenuSheets[i].bHidePrevious then
+            if activeMenuSheets[i] == sheetTuple then
+                i = i - 1
+                while i > 0 do
+                    activeMenuSheets[i].sheet:show()
+                    if activeMenuSheets[i].bHidePrevious then
+                        break
+                    end
+                    i = i - 1
+                end
+            end
+            break
+        end
+        i = i - 1
+    end
+
+    -- Remove sheet with its tuple from the table
+    menuSheetsRoot:removeChildWindow(sheetTuple.sheet.window)
+    table.remove(activeMenuSheets, table.findIndex(activeMenuSheets, sheetTuple))
+    activeMenuSheets[name] = nil
+    activeMenuSheets.size = activeMenuSheets.size - 1
+    activeMenuSheets.topSheetTuple = activeMenuSheets[activeMenuSheets.size]
+
+    -- Leave the input state
+    inputMgr:leaveState(sheetTuple.sheet.inputState)
+    
+    -- 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
+        hideCursor()
+    end
+
+    -- Resume control if the last menu is hidden
+    if activeMenuSheets.size == 0 then
+        orxonox.HumanController:resumeControl()
+        hideCursor()
+    end
+end
+
+-- Hides all menu GUI sheets
+function hideAllMenuSheets()
+    while activeMenuSheets.size ~= 0 do
+        hideMenuSheet(activeMenuSheets.topSheetTuple.sheet.name)
+    end
+end
+
+function keyESC()
+    -- HUGE, very HUGE hacks!
+    if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
+        orxonox.execute("exit")
+    elseif activeMenuSheets.size > 0 then
+        orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name)
+    else
+        showMenuSheet("InGameMenu")
+    end
+end
+
+function setBackgroundImage(imageSet, imageName)
+    guiMgr:setBackgroundImage(imageSet, imageName)
+end
+
+----------------------
+--- Initialisation ---
+----------------------
+
+hideCursor()
Index: code/trunk/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 6711)
+++ code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 6746)
@@ -1,16 +1,7 @@
 -- SingleplayerMenu.lua
 
-BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
-if _REQUIREDNAME == nil then
-    SingleplayerMenu = P
-else
-    _G[_REQUIREDNAME] = P
-end
+local P = createMenuSheet("SingleplayerMenu")
 
-P.filename = "SingleplayerMenu"
-P.layoutString = "SingleplayerMenu.layout"
-
-function P:init()
+function P.onLoad()
     listbox = winMgr:getWindow("orxonox/SingleplayerLevelListbox")
     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
@@ -30,5 +21,5 @@
     for k,v in pairs(levelList) do
         item = CEGUI.createListboxTextItem(v)
-        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
         CEGUI.toListbox(listbox):addItem(item)
         if v .. ".oxw" == preselect then
@@ -43,10 +34,10 @@
         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
         orxonox.execute("startGame")
-        hideAllGUIs()
+        hideAllMenuSheets()
     end
 end
 
 function P.SingleplayerBackButton_clicked(e)
-    hideGUI(P.filename)
+    hideMenuSheet(P.name)
 end
 
