Index: code/branches/notifications/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/NotificationLayer.lua	(revision 7338)
+++ code/branches/notifications/data/gui/scripts/NotificationLayer.lua	(revision 7338)
@@ -0,0 +1,102 @@
+-- NotificationLayer.lua
+
+local P = createMenuSheet("NotificationLayer")
+
+P.queueList = {}
+P.nameList = {}
+
+function P.createQueue(name, size)
+    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
+    local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name)
+    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
+    queue:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0.2, 0)))
+    root:addChildWindow(queue)
+    table.insert(P.queueList, queue)
+    table.insert(P.nameList, name)
+    --TODO: Check name for uniqueness.
+end
+
+function P.removeQueue(name)
+    local queue = nil
+
+    for k,v in pairs(P.nameList) do
+        if v == name then
+            P.nameList[k] = nil
+            queue = P.queueList[k]
+            P.queueList[k] = nil
+            break
+        end
+    end
+
+    if queue ~= nil then
+        winMgr:destroyWindow(queue)
+    end
+end
+
+function P.changePosition(name, xPos, yPos)
+    local queue = P.nameToQueue(name)
+    if queue == nil then
+        cout(0, "Queue is nil!")
+        return
+    end
+    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(tonumber(xPos), 0), CEGUI.UDim(tonumber(yPos), 0)))
+end
+
+function P.pushNotification(queueName, notification)
+    local queue = P.nameToQueue(queueName)
+    if queue == nil then
+        cout(0, "Queue is nil!")
+        return
+    end
+    item = CEGUI.createListboxTextItem(notification)
+    local listbox = CEGUI.toListbox(queue)
+    if listbox:getItemCount() == 0 then
+        listbox:addItem(item)
+    else
+        listbox:insertItem(item, listbox:getListboxItemFromIndex(0))
+    end
+end
+
+function P.popNotification(queueName)
+    local queue = P.nameToQueue(queueName)
+    if queue == nil then
+        cout(0, "Queue is nil!")
+        return
+    end
+    local listbox = CEGUI.toListbox(queue)
+    listbox:removeItem(listbox:getListboxItemFromIndex(listbox:getItemCount()-1))
+end
+
+function P.removeNotification(queueName, index)
+    local queue = P.nameToQueue(queueName)
+    if queue == nil then
+        cout(0, "Queue is nil!")
+        return
+    end
+    local listbox = CEGUI.toListbox(queue)
+    listbox:removeItem(listbox:getListboxItemFromIndex(tonumber(index)))
+end
+
+function P.clearQueue(name)
+    local queue = P.nameToQueue(name)
+    if queue == nil then
+        cout(0, "Queue is nil!")
+        return
+    end
+    local listbox = CEGUI.toListbox(queue)
+    CEGUI.toListbox(queue):resetList()
+end
+
+function P.nameToQueue(name)
+    local queue = nil
+    for k,v in pairs(P.nameList) do
+        if v == name then
+            queue = P.queueList[k]
+            break
+        end
+    end
+    return queue
+end
+
+return P
+
Index: code/branches/notifications/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/SheetManager.lua	(revision 7313)
+++ code/branches/notifications/data/gui/scripts/SheetManager.lua	(revision 7338)
@@ -43,6 +43,6 @@
 
 -- ?
-function showMenuSheet(name, bHidePrevious, ptr)
-    local sheet = showMenuSheet(name, bHidePrevious)
+function showMenuSheet(name, bHidePrevious, bNoInput, ptr)
+    local sheet = showMenuSheet(name, bHidePrevious, bNoInput)
     sheet.overlay = ptr
     return sheet
@@ -50,5 +50,5 @@
 
 -- Shows the specified menu sheet and loads it if neccessary
-function showMenuSheet(name, bHidePrevious)
+function showMenuSheet(name, bHidePrevious, bNoInput)
     if name == "" then
         return nil
@@ -63,4 +63,8 @@
     end
 
+    if bNoInput == nil then
+        bNoInput = false
+    end
+
     -- Pause game control if this is the first menu to be displayed
     -- HUGE HACK?
@@ -74,9 +78,12 @@
     end
 
+    menuSheet.tShowCursor = TriBool.Dontcare
+
     -- Add the sheet in a tuple of additional information
     local sheetTuple =
     {
         ["sheet"]          = menuSheet,
-        ["bHidePrevious"]  = bHidePrevious
+        ["bHidePrevious"]  = bHidePrevious,
+        ["bNoInput"]       = bNoInput
     }
     table.insert(activeMenuSheets, sheetTuple) -- indexed array access
@@ -89,5 +96,7 @@
 
     -- Handle input distribution
-    inputMgr:enterState(menuSheet.inputState)
+    if bNoInput == false then
+        inputMgr:enterState(menuSheet.inputState)
+    end
 
     -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare
@@ -148,5 +157,7 @@
 
     -- Leave the input state
-    inputMgr:leaveState(sheetTuple.sheet.inputState)
+    if not sheetTuple.bNoInput then
+        inputMgr:leaveState(sheetTuple.sheet.inputState)
+    end
     
     -- CURSOR SHOWING
@@ -178,8 +189,17 @@
 function keyESC()
     -- HUGE, very HUGE hacks!
-    if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" 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
+
+    -- If the first sheet that needs input is the MainMenu.
+    if counter > 0 and activeMenuSheets.size == counter and activeMenuSheets[counter].sheet.name == "MainMenu" then
         orxonox.execute("exit")
-    elseif activeMenuSheets.size > 0 then
-        orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name)
+    -- If there is at least one sheet that needs input.
+    elseif counter > 0 then
+        orxonox.execute("hideGUI "..activeMenuSheets[counter].sheet.name)
     else
         showMenuSheet("InGameMenu")
