[Orxonox-commit 403] r2148 - media/gui/scripts
bknecht at orxonox.net
bknecht at orxonox.net
Tue May 19 11:43:04 CEST 2009
Author: bknecht
Date: 2009-05-19 11:43:04 +0200 (Tue, 19 May 2009)
New Revision: 2148
Modified:
media/gui/scripts/gui.lua
media/gui/scripts/mainmenu_2.lua
Log:
small change improving the handling of the GUIs in Lua
Modified: media/gui/scripts/gui.lua
===================================================================
--- media/gui/scripts/gui.lua 2009-05-18 17:26:55 UTC (rev 2147)
+++ media/gui/scripts/gui.lua 2009-05-19 09:43:04 UTC (rev 2148)
@@ -14,9 +14,14 @@
local newElement = { window = gui, filename = fname, visible = false } or {}
setmetatable(newElement, self) -- connects new element with class
self.__index = self
+ P:init()
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()
Modified: media/gui/scripts/mainmenu_2.lua
===================================================================
--- media/gui/scripts/mainmenu_2.lua 2009-05-18 17:26:55 UTC (rev 2147)
+++ media/gui/scripts/mainmenu_2.lua 2009-05-19 09:43:04 UTC (rev 2148)
@@ -7,16 +7,13 @@
P.filename = "mainmenu_2"
P.layoutString = "MainMenu_2.layout"
--- overwrites load function of previous load function
-function P:load()
- element = P.__index.load(P) -- calling load function of parent class with ourselves and do other stuff now
+function P:init()
--win = winMgr:getWindow("orxonox/LevelListBox")
--print(win.getItemCount())
--item = winMgr:createWindow("TaharezLook/ListboxItem", "orxonox/LevelListBoxItem1")
--item:setText("HiHo")
--win:addItem(item)
--print(win:getItemCount())
- return element
end
More information about the Orxonox-commit
mailing list