Rev | Line | |
---|
[5491] | 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 | return newElement |
---|
| 18 | end |
---|
| 19 | |
---|
| 20 | -- hide function for the GUI |
---|
| 21 | function P:hide () |
---|
| 22 | self.window:hide() |
---|
| 23 | self.visible = false |
---|
| 24 | end |
---|
| 25 | |
---|
| 26 | -- show function for the GUI |
---|
| 27 | function P:show () |
---|
| 28 | self.window:show() |
---|
| 29 | self.visible = true |
---|
| 30 | end |
---|
| 31 | |
---|
| 32 | function P:load () |
---|
| 33 | return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename) |
---|
| 34 | end |
---|
| 35 | |
---|
| 36 | return gui or _G[_REQUIREDNAME] |
---|
Note: See
TracBrowser
for help on using the repository browser.