Changeset 5432
- Timestamp:
- Mar 25, 2009, 11:48:19 PM (16 years ago)
- Location:
- data/media/gui
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/scripts/loadGUI_2.lua
r5430 r5432 15 15 local loadedGUIs = {} 16 16 local showing 17 -- we cannot directly call functions with parameters and so need this as a global variable, which sucks of course 18 filename = "" 17 19 18 datapath = "" -- points to media-folder (set after loading the script) 20 19 … … 36 35 -- loads the GUI with the specified filename 37 36 -- be sure to set the global variable "filename" before calling this function 38 function loadGUI( )37 function loadGUI(filename) 39 38 -- check if it already exists 40 39 newlyLoaded = loadedGUIs:getGUIbyName(filename) 41 40 if newlyLoaded == nil then 42 dofile(datapath .. "gui/scripts/" .. filename )41 dofile(datapath .. "gui/scripts/" .. filename .. ".lua") 43 42 newlyLoaded = winMgr:loadWindowLayout(layoutPath) 44 43 newlyLoaded.filename = filename … … 57 56 -- shows the specified and loads it if not loaded already 58 57 -- be sure to set the global variable "filename" before calling this function 59 function showGUI( )58 function showGUI(filename) 60 59 if current == nil or current.filename ~= filename then 61 60 current = loadedGUIs.getGUIbyName(filename)
Note: See TracChangeset
for help on using the changeset viewer.