Changeset 6595 for code/branches/gamestates2/data/gui/scripts/BasicGUI.lua
- Timestamp:
- Mar 22, 2010, 2:47:10 PM (15 years ago)
- Location:
- code/branches/gamestates2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2
- Property svn:mergeinfo changed
/code/branches/gamestate merged: 6441-6442,6459,6537,6544-6546,6548,6564,6566-6567,6569,6571-6572
- Property svn:mergeinfo changed
-
code/branches/gamestates2/data/gui/scripts/BasicGUI.lua
r5781 r6595 8 8 end 9 9 10 -- useless, even wrong? P is the class, not the object.. 10 11 P.overlay = nil 11 12 12 13 -- constructor of the GUI 13 function P:new (gui, fname) 14 local newElement = { window = gui, filename = fname, visible = false } or {} 14 function P:new(_filename, _gui, _visible) 15 local newElement = { 16 filename = _filename, 17 gui = _gui, 18 visible = _visible or false 19 } or {} 15 20 setmetatable(newElement, self) -- connects new element with class 16 21 self.__index = self … … 18 23 end 19 24 25 -- Override this function if you need to 20 26 function P:init() 21 -- this function is empty and intended for inheriting GUIs to use 27 end 28 29 -- Override this function if you need to 30 -- But don't forget to stick to the naming convention ("GUI_" .. self.filename) 31 function P:createInputState() 32 self.inputState = guiMgr:createInputState("GUI_" .. self.filename) 22 33 end 23 34 24 35 -- hide function for the GUI 25 function P:hide 36 function P:hide() 26 37 self.window:hide() 27 38 self.visible = false … … 29 40 30 41 -- show function for the GUI 31 function P:show 42 function P:show() 32 43 self.window:show() 33 44 self.visible = true 34 45 end 35 46 36 function P:load () 37 self.window = winMgr:loadWindowLayout(self.layoutString) 47 function P:load() 48 self.window = winMgr:loadWindowLayout(self.filename .. ".layout") 49 self:createInputState() 38 50 self:init() 39 51 return self
Note: See TracChangeset
for help on using the changeset viewer.