Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

media update for a working main menu. I hope this does not destroy something, I think it shouldn't.

File size: 816 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    self:init()
18    return newElement
19end
20
21function P:init()
22-- this function is empty and intended for inheriting GUIs to use
23end
24
25-- hide function for the GUI
26function P:hide ()
27    self.window:hide()
28    self.visible = false
29end
30
31-- show function for the GUI
32function P:show ()
33    self.window:show()
34    self.visible = true
35end
36
37function P:load ()
38    return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename)
39end
40
41return gui or _G[_REQUIREDNAME]
Note: See TracBrowser for help on using the repository browser.