Index: code/branches/gamestate/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/AudioMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/AudioMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("AudioMenu")
 if _REQUIREDNAME == nil then
     AudioMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "AudioMenu"
-P.layoutString = "AudioMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/BasicGUI.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/BasicGUI.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/BasicGUI.lua	(revision 6459)
@@ -8,9 +8,14 @@
 end
 
+-- useless?
 P.overlay = nil
 
 -- constructor of the GUI
-function P:new (gui, fname)
-    local newElement = { window = gui, filename = fname, visible = false } or {}
+function P:new(_filename, _visible, _gui)
+    local newElement = {
+        filename = _filename,
+        gui = _gui,
+        visible = _visible or false
+    } or {}
     setmetatable(newElement, self) -- connects new element with class
     self.__index = self
@@ -23,5 +28,5 @@
 
 -- hide function for the GUI
-function P:hide ()
+function P:hide()
     self.window:hide()
     self.visible = false
@@ -29,11 +34,11 @@
 
 -- show function for the GUI
-function P:show ()
+function P:show()
     self.window:show()
     self.visible = true
 end
 
-function P:load ()
-    self.window = winMgr:loadWindowLayout(self.layoutString)
+function P:load()
+    self.window = winMgr:loadWindowLayout(self.filename .. ".layout")
     self:init()
     return self
Index: code/branches/gamestate/data/gui/scripts/ControlsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/ControlsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/ControlsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("ControlsMenu")
 if _REQUIREDNAME == nil then
     ControlsMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "ControlsMenu"
-P.layoutString = "ControlsMenu.layout"
 
 function P.ControlsMouseControlsButton_clicked(e)
Index: code/branches/gamestate/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/CreditsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/CreditsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("CreditsMenu")
 if _REQUIREDNAME == nil then
     CreditsMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "CreditsMenu"
-P.layoutString = "CreditsMenu.layout"
 
 function P.CreditsBackButton_clicked(e)
Index: code/branches/gamestate/data/gui/scripts/DecisionPopup.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/DecisionPopup.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/DecisionPopup.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("DecisionPopup")
 if _REQUIREDNAME == nil then
     DecisionPopup = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "DecisionPopup"
-P.layoutString = "DecisionPopup.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/GameplayMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/GameplayMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/GameplayMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("GameplayMenu")
 if _REQUIREDNAME == nil then
     GameplayMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "GameplayMenu"
-P.layoutString = "GameplayMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("GraphicsMenu")
 if _REQUIREDNAME == nil then
     GraphicsMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "GraphicsMenu"
-P.layoutString = "GraphicsMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/InGameMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/InGameMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("InGameMenu")
 if _REQUIREDNAME == nil then
     InGameMenu = P
@@ -9,6 +9,4 @@
 end
 
-P.filename = "InGameMenu"
-P.layoutString = "InGameMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/InfoPopup.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/InfoPopup.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/InfoPopup.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("InfoPopup")
 
 if _REQUIREDNAME == nil then
@@ -9,7 +9,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "InfoPopup"
-P.layoutString = "InfoPopup.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("KeyBindMenu")
 
 if _REQUIREDNAME == nil then
@@ -9,7 +9,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "KeyBindMenu"
-P.layoutString = "KeyBindMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/MainMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MainMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/MainMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("MainMenu")
 if _REQUIREDNAME == nil then
     MainMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "MainMenu"
-P.layoutString = "MainMenu.layout"
 
 -- events for MainMenu
Index: code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("MouseControlsMenu")
 if _REQUIREDNAME == nil then
     MouseControlsMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "MouseControlsMenu"
-P.layoutString = "MouseControlsMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("MultiplayerMenu")
 if _REQUIREDNAME == nil then
     MultiplayerMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "MultiplayerMenu"
-P.layoutString = "MultiplayerMenu.layout"
 
 function P:init()
Index: code/branches/gamestate/data/gui/scripts/MultiplayerOptionsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/MultiplayerOptionsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("MultiplayerOptionsMenu")
 if _REQUIREDNAME == nil then
     MultiplayerOptionsMenu = P
@@ -9,7 +9,4 @@
 end
 
-P.filename = "MultiplayerOptionsMenu"
-P.layoutString = "MultiplayerOptionsMenu.layout"
-
 function P.MultiplayerOptionsBackButton_clicked(e)
     hideGUI(P.filename)
Index: code/branches/gamestate/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/PickupInventory.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/PickupInventory.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("PickupInventory")
 if _REQUIREDNAME == nil then
     PickupInventory = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "PickupInventory"
-P.layoutString = "PickupInventory.layout"
 
 P.lastEquipmentCount_ = 0
Index: code/branches/gamestate/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/QuestGUI.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/QuestGUI.lua	(revision 6459)
@@ -1,4 +1,4 @@
 gui = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("QuestGUI")
 if _REQUIREDNAME == nil then
     QuestGUI = P
@@ -6,7 +6,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "QuestGUI"
-P.layoutString = "QuestGUI.layout"
 
 function P:show()
Index: code/branches/gamestate/data/gui/scripts/SettingsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/SettingsMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/SettingsMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("SettingsMenu")
 if _REQUIREDNAME == nil then
     SettingsMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "SettingsMenu"
-P.layoutString = "SettingsMenu.layout"
 
 function P.SettingsGameplayButton_clicked(e)
Index: code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua	(revision 6430)
+++ code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua	(revision 6459)
@@ -2,5 +2,5 @@
 
 BasicGUI = require("BasicGUI")
-local P = BasicGUI:new() --inherit everything from the gui package
+local P = BasicGUI:new("SingleplayerMenu")
 if _REQUIREDNAME == nil then
     SingleplayerMenu = P
@@ -8,7 +8,4 @@
     _G[_REQUIREDNAME] = P
 end
-
-P.filename = "SingleplayerMenu"
-P.layoutString = "SingleplayerMenu.layout"
 
 function P:init()
