Changeset 5446 for data/media/gui
- Timestamp:
- Apr 2, 2009, 5:05:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/scripts/loadGUI_2.lua
r5432 r5446 25 25 -- function which returns a GUI by name 26 26 loadedGUIs.getGUIbyName = function (str) 27 print("number of GUIs loaded: " .. #loadedGUIs) 27 28 for i = 1, #loadedGUIs, 1 do 29 print("Checking GUI " .. loadedGUIs[i].filename) 28 30 if str == loadedGUIs[i].filename then 29 31 return loadedGUIs[i] … … 37 39 function loadGUI(filename) 38 40 -- check if it already exists 41 print("about to load " .. filename) 42 print("search for GUI " .. filename) 39 43 newlyLoaded = loadedGUIs:getGUIbyName(filename) 40 44 if newlyLoaded == nil then … … 57 61 -- be sure to set the global variable "filename" before calling this function 58 62 function showGUI(filename) 63 print("about to show " .. filename) 59 64 if current == nil or current.filename ~= filename then 65 print("current not set") 66 print("search for GUI " .. filename) 60 67 current = loadedGUIs.getGUIbyName(filename) 61 68 if current == nil then … … 64 71 system:setGUISheet(current) 65 72 end 73 print("Showing " .. filename) 66 74 current:show() 67 cursor:show()68 75 showing = true 69 76 end … … 82 89 end 83 90 84 function hideGUI() 85 current:hide() 86 showing = false 91 function hideCursor() 92 cursor:hide() 87 93 end 94 95 function showCursor() 96 cursor:show() 97 end 98 99 function 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 109 end
Note: See TracChangeset
for help on using the changeset viewer.