Last change
on this file since 5553 was
5527,
checked in by bknecht, 16 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 | |
---|
3 | local P = {} |
---|
4 | if _REQUIREDNAME == nil then |
---|
5 | gui = P |
---|
6 | else |
---|
7 | _G[_REQUIREDNAME] = P |
---|
8 | end |
---|
9 | |
---|
10 | P.overlay = nil |
---|
11 | |
---|
12 | -- constructor of the GUI |
---|
13 | function 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 |
---|
19 | end |
---|
20 | |
---|
21 | function P:init() |
---|
22 | -- this function is empty and intended for inheriting GUIs to use |
---|
23 | end |
---|
24 | |
---|
25 | -- hide function for the GUI |
---|
26 | function P:hide () |
---|
27 | self.window:hide() |
---|
28 | self.visible = false |
---|
29 | end |
---|
30 | |
---|
31 | -- show function for the GUI |
---|
32 | function P:show () |
---|
33 | self.window:show() |
---|
34 | self.visible = true |
---|
35 | end |
---|
36 | |
---|
37 | function P:load () |
---|
38 | return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename) |
---|
39 | end |
---|
40 | |
---|
41 | return gui or _G[_REQUIREDNAME] |
---|
Note: See
TracBrowser
for help on using the repository browser.