Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/resource2/data/gui/scripts/BasicGUI.lua @ 5838

Last change on this file since 5838 was 5661, checked in by rgrieder, 15 years ago

Cleaned out the lua script files for the GUI.
Also replaced "require" function to support resources.
Fixed a problem with the return value of doFile, includeFile and require being discarded because the tolua binding is for a C++ function returning void.

  • Property svn:eol-style set to native
File size: 796 bytes
RevLine 
[5491]1-- gui.lua
2
3local P = {}
4if _REQUIREDNAME == nil then
[5661]5    BasicGUI = P
[5491]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
[5523]20function P:init()
21-- this function is empty and intended for inheriting GUIs to use
22end
23
[5491]24-- hide function for the GUI
25function P:hide ()
26    self.window:hide()
27    self.visible = false
28end
29
30-- show function for the GUI
31function P:show ()
32    self.window:show()
33    self.visible = true
34end
35
36function P:load ()
[5559]37    self.window = winMgr:loadWindowLayout(self.layoutString)
38    self:init()
39    return self
[5491]40end
41
[5661]42return P
Note: See TracBrowser for help on using the repository browser.