Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5432


Ignore:
Timestamp:
Mar 25, 2009, 11:48:19 PM (15 years ago)
Author:
rgrieder
Message:

Added inGameGUI test sheet.
Also removed workaround for the filename. Found another way by using executeString() in CEGUILua.

Location:
data/media/gui
Files:
2 added
1 edited

Legend:

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

    r5430 r5432  
    1515local loadedGUIs = {}
    1616local showing
    17 -- we cannot directly call functions with parameters and so need this as a global variable, which sucks of course
    18 filename = ""
     17
    1918datapath = "" -- points to media-folder (set after loading the script)
    2019
     
    3635-- loads the GUI with the specified filename
    3736-- be sure to set the global variable "filename" before calling this function
    38 function loadGUI()
     37function loadGUI(filename)
    3938    -- check if it already exists
    4039    newlyLoaded = loadedGUIs:getGUIbyName(filename)
    4140    if newlyLoaded == nil then
    42         dofile(datapath .. "gui/scripts/" .. filename)
     41        dofile(datapath .. "gui/scripts/" .. filename .. ".lua")
    4342        newlyLoaded = winMgr:loadWindowLayout(layoutPath)
    4443        newlyLoaded.filename = filename
     
    5756-- shows the specified and loads it if not loaded already
    5857-- be sure to set the global variable "filename" before calling this function
    59 function showGUI()
     58function showGUI(filename)
    6059    if current == nil or current.filename ~= filename then
    6160        current = loadedGUIs.getGUIbyName(filename)
Note: See TracChangeset for help on using the changeset viewer.