Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5523


Ignore:
Timestamp:
May 19, 2009, 11:43:04 AM (15 years ago)
Author:
bknecht
Message:

small change improving the handling of the GUIs in Lua

Location:
data/media/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • data/media/gui/scripts/gui.lua

    r5491 r5523  
    1515    setmetatable(newElement, self) -- connects new element with class
    1616    self.__index = self
     17    P:init()
    1718    return newElement
     19end
     20
     21function P:init()
     22-- this function is empty and intended for inheriting GUIs to use
    1823end
    1924
  • data/media/gui/scripts/mainmenu_2.lua

    r5491 r5523  
    88P.layoutString = "MainMenu_2.layout"
    99
    10 -- overwrites load function of previous load function
    11 function P:load()
    12     element = P.__index.load(P) -- calling load function of parent class with ourselves and do other stuff now
     10function P:init()
    1311    --win = winMgr:getWindow("orxonox/LevelListBox")
    1412    --print(win.getItemCount())
     
    1715    --win:addItem(item)
    1816    --print(win:getItemCount())
    19     return element
    2017end
    2118
Note: See TracChangeset for help on using the changeset viewer.