Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5446 for data/media/gui


Ignore:
Timestamp:
Apr 2, 2009, 5:05:25 PM (16 years ago)
Author:
bknecht
Message:

added some debug-output to fix stuff I ran into with LUa on Tardis. Not solved unfortunately. Game crashes when using the showingamegui command

File:
1 edited

Legend:

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

    r5432 r5446  
    2525-- function which returns a GUI by name
    2626loadedGUIs.getGUIbyName = function (str)
     27    print("number of GUIs loaded: " .. #loadedGUIs)
    2728    for i = 1, #loadedGUIs, 1 do
     29        print("Checking GUI " .. loadedGUIs[i].filename)
    2830        if str == loadedGUIs[i].filename then
    2931            return loadedGUIs[i]
     
    3739function loadGUI(filename)
    3840    -- check if it already exists
     41    print("about to load " .. filename)
     42    print("search for GUI " .. filename)
    3943    newlyLoaded = loadedGUIs:getGUIbyName(filename)
    4044    if newlyLoaded == nil then
     
    5761-- be sure to set the global variable "filename" before calling this function
    5862function showGUI(filename)
     63    print("about to show " .. filename)
    5964    if current == nil or current.filename ~= filename then
     65        print("current not set")
     66        print("search for GUI " .. filename)
    6067        current = loadedGUIs.getGUIbyName(filename)
    6168        if current == nil then
     
    6471        system:setGUISheet(current)
    6572    end
     73    print("Showing " .. filename)
    6674    current:show()
    67     cursor:show()
    6875    showing = true
    6976end
     
    8289end
    8390
    84 function hideGUI()
    85     current:hide()
    86     showing = false
     91function hideCursor()
     92    cursor:hide()
    8793end
     94
     95function showCursor()
     96    cursor:show()
     97end
     98
     99function hideGUI(filename)
     100    print("about to hide " .. filename)
     101    print("search for GUI " .. filename)
     102    current = loadedGUIs.getGUIbyName(filename)
     103    print("current is: " .. current)
     104    if current ~= nil then
     105        print("Hiding " .. filename)
     106        current:hide()
     107        showing = false
     108    end
     109end
Note: See TracChangeset for help on using the changeset viewer.