Changeset 5661 for code/branches/resource2/data
- Timestamp:
- Aug 19, 2009, 12:19:11 AM (15 years ago)
- Location:
- code/branches/resource2/data
- Files:
-
- 9 deleted
- 2 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/data/gui/layouts/MainMenu.layout
r5653 r5661 12 12 <Property Name="Text" Value="Standalone"/> 13 13 <Property Name="Disabled" Value="true"/> 14 <Event Name="Clicked" Function=" mainmenu_2.button_standalone_clicked"/>14 <Event Name="Clicked" Function="MainMenu.button_standalone_clicked"/> 15 15 </Window> 16 16 … … 20 20 <Property Name="UnifiedSize" Value="{{0.35,0},{0.33,0}}" /> 21 21 <Property Name="Tooltip" Value="Available Levels." /> 22 <Event Name="ItemSelectionChanged" Function=" mainmenu_2.listbox_level_selectionchanged" />22 <Event Name="ItemSelectionChanged" Function="MainMenu.listbox_level_selectionchanged" /> 23 23 </Window> 24 24 … … 27 27 <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/> 28 28 <Property Name="Text" Value="Dedicated"/> 29 <Event Name="Clicked" Function=" mainmenu_2.button_dedicated_clicked"/>29 <Event Name="Clicked" Function="MainMenu.button_dedicated_clicked"/> 30 30 </Window> 31 31 … … 34 34 <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/> 35 35 <Property Name="Text" Value="Server"/> 36 <Event Name="Clicked" Function=" mainmenu_2.button_server_clicked"/>36 <Event Name="Clicked" Function="MainMenu.button_server_clicked"/> 37 37 </Window> 38 38 … … 41 41 <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/> 42 42 <Property Name="Text" Value="Client"/> 43 <Event Name="Clicked" Function=" mainmenu_2.button_client_clicked"/>43 <Event Name="Clicked" Function="MainMenu.button_client_clicked"/> 44 44 </Window> 45 45 … … 48 48 <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/> 49 49 <Property Name="Text" Value="Quit"/> 50 <Event Name="Clicked" Function=" mainmenu_2.button_quit_clicked"/>50 <Event Name="Clicked" Function="MainMenu.button_quit_clicked"/> 51 51 </Window> 52 52 </Window> -
code/branches/resource2/data/gui/scripts/BasicGUI.lua
r5653 r5661 3 3 local P = {} 4 4 if _REQUIREDNAME == nil then 5 gui= P5 BasicGUI = P 6 6 else 7 7 _G[_REQUIREDNAME] = P … … 40 40 end 41 41 42 return gui or _G[_REQUIREDNAME]42 return P -
code/branches/resource2/data/gui/scripts/InitialiseGUI.lua
r5653 r5661 14 14 15 15 loadedGUIs = {} 16 17 -- datapath is set before executing the script and points to media-folder18 package.path = package.path .. ";" .. datapath .. "gui/scripts/?.lua"19 16 20 17 -- loads the GUI with the specified filename -
code/branches/resource2/data/gui/scripts/MainMenu.lua
r5653 r5661 1 -- mainmenu_2.lua 2 gui = require("gui") 3 local P = gui:new() --inherit everything from the gui package 1 -- MainMenu.lua 4 2 5 mainmenu_2 = P 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new() --inherit everything from the gui package 5 if _REQUIREDNAME == nil then 6 MainMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 6 10 7 P.filename = " mainmenu_2"8 P.layoutString = "MainMenu _2.layout"11 P.filename = "MainMenu" 12 P.layoutString = "MainMenu.layout" 9 13 10 14 function P:init() … … 85 89 end 86 90 87 return mainmenu_291 return P 88 92 -
code/branches/resource2/data/gui/scripts/PickupInventory.lua
r5587 r5661 1 gui = require("gui") 2 local P = gui:new() --inherit everything from the gui package 1 -- PickupInventory.lua 3 2 4 PickupInventory = P 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new() --inherit everything from the gui package 5 if _REQUIREDNAME == nil then 6 PickupInventory = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 5 10 6 11 P.filename = "PickupInventory" … … 61 66 end 62 67 63 return P ickupInventory68 return P -
code/branches/resource2/data/lua/LuaStateInit.lua
r5654 r5661 1 1 -- Note: luaState is a pointer to the LuaState instance that created this lua state 2 2 3 -- Redirect debug to print3 -- Save original print function in debug 4 4 debug = print 5 5 … … 23 23 resourceGroup = resourceGroup or "NoResourceGroupProvided" 24 24 luaState:doFile(filename, resourceGroup, bSearchOtherPaths) 25 -- Required because the C++ function cannot return whatever might be on the stack 26 return LuaStateReturnValue 25 27 end 28 original_dofile = dofile 26 29 dofile = doFile 27 30 … … 33 36 resourceGroup = resourceGroup or "NoResourceGroupProvided" 34 37 luaState:includeFile(filename, resourceGroup, bSearchOtherPaths) 38 -- Required because the C++ function cannot return whatever might be on the stack 39 return LuaStateReturnValue 35 40 end 41 42 -- Replace require function with almost similar behaviour 43 -- The difference is that you need to provide a resource group 44 -- Default value there is the current one (if present) or else "General" 45 -- But the loaded modules are then stored with only with the name (where name has no .lua extension) 46 -- CAUTION: That also means that you need to take care of conflicting filenames among groups 47 -- Furthermore the moduleName parameters is appended with the .lua extension when looking for the file 48 old_require = require 49 require = function(moduleName, resourceGroup) 50 local bSearchOtherPaths = (resourceGroup == nil) or false 51 resourceGroup = resourceGroup or "NoResourceGroupProvided" 52 if not luaState:fileExists(moduleName .. ".lua", resourceGroup, bSearchOtherPaths) then 53 return nil 54 end 55 if not _LOADED then 56 _LOADED = {} 57 end 58 if not _LOADED[moduleName] then 59 -- save old value 60 _REQUIREDNAME_OLD = _REQUIREDNAME 61 _REQUIREDNAME = moduleName 62 luaState:doFile(moduleName .. ".lua", resourceGroup, bSearchOtherPaths) 63 _LOADED[moduleName] = LuaStateReturnValue or true 64 -- restore old value 65 _REQUIREDNAME = _REQUIREDNAME_OLD 66 end 67 return _LOADED[moduleName] 68 end
Note: See TracChangeset
for help on using the changeset viewer.