Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/media/gui/scripts/gui.lua @ 5491

Last change on this file since 5491 was 5491, checked in by bknecht, 15 years ago

new version of the GUI

File size: 711 bytes
Line 
1-- gui.lua
2
3local P = {}
4if _REQUIREDNAME == nil then
5    gui = P
6else
7    _G[_REQUIREDNAME] = P
8end
9
10P.overlay = nil
11
12-- constructor of the GUI
13function P:new (gui, fname)
14    local newElement = { window = gui, filename = fname, visible = false } or {}
15    setmetatable(newElement, self) -- connects new element with class
16    self.__index = self
17    return newElement
18end
19
20-- hide function for the GUI
21function P:hide ()
22    self.window:hide()
23    self.visible = false
24end
25
26-- show function for the GUI
27function P:show ()
28    self.window:show()
29    self.visible = true
30end
31
32function P:load ()
33    return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename)
34end
35
36return gui or _G[_REQUIREDNAME]
Note: See TracBrowser for help on using the repository browser.