Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 24, 2010, 5:03:27 PM (16 years ago)
Author:
rgrieder
Message:

Simplified BasicGUI construction. Just give the name of the GUI as argument. The rest will be deduced.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/data/gui/scripts/BasicGUI.lua

    r5781 r6459  
    88end
    99
     10-- useless?
    1011P.overlay = nil
    1112
    1213-- constructor of the GUI
    13 function P:new (gui, fname)
    14     local newElement = { window = gui, filename = fname, visible = false } or {}
     14function P:new(_filename, _visible, _gui)
     15    local newElement = {
     16        filename = _filename,
     17        gui = _gui,
     18        visible = _visible or false
     19    } or {}
    1520    setmetatable(newElement, self) -- connects new element with class
    1621    self.__index = self
     
    2328
    2429-- hide function for the GUI
    25 function P:hide ()
     30function P:hide()
    2631    self.window:hide()
    2732    self.visible = false
     
    2934
    3035-- show function for the GUI
    31 function P:show ()
     36function P:show()
    3237    self.window:show()
    3338    self.visible = true
    3439end
    3540
    36 function P:load ()
    37     self.window = winMgr:loadWindowLayout(self.layoutString)
     41function P:load()
     42    self.window = winMgr:loadWindowLayout(self.filename .. ".layout")
    3843    self:init()
    3944    return self
Note: See TracChangeset for help on using the changeset viewer.