Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 19, 2009, 12:19:11 AM (15 years ago)
Author:
rgrieder
Message:

Cleaned out the lua script files for the GUI.
Also replaced "require" function to support resources.
Fixed a problem with the return value of doFile, includeFile and require being discarded because the tolua binding is for a C++ function returning void.

Location:
code/branches/resource2/data/gui/scripts
Files:
9 deleted
1 edited
3 moved

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/data/gui/scripts/BasicGUI.lua

    r5653 r5661  
    33local P = {}
    44if _REQUIREDNAME == nil then
    5     gui = P
     5    BasicGUI = P
    66else
    77    _G[_REQUIREDNAME] = P
     
    4040end
    4141
    42 return gui or _G[_REQUIREDNAME]
     42return P
  • code/branches/resource2/data/gui/scripts/InitialiseGUI.lua

    r5653 r5661  
    1414
    1515loadedGUIs = {}
    16 
    17 -- datapath is set before executing the script and points to media-folder
    18 package.path = package.path .. ";" .. datapath .. "gui/scripts/?.lua"
    1916
    2017-- 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
    42
    5 mainmenu_2 = P
     3BasicGUI = require("BasicGUI")
     4local P = BasicGUI:new() --inherit everything from the gui package
     5if _REQUIREDNAME == nil then
     6    MainMenu = P
     7else
     8    _G[_REQUIREDNAME] = P
     9end
    610
    7 P.filename = "mainmenu_2"
    8 P.layoutString = "MainMenu_2.layout"
     11P.filename = "MainMenu"
     12P.layoutString = "MainMenu.layout"
    913
    1014function P:init()
     
    8589end
    8690
    87 return mainmenu_2
     91return P
    8892
  • 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
    32
    4 PickupInventory = P
     3BasicGUI = require("BasicGUI")
     4local P = BasicGUI:new() --inherit everything from the gui package
     5if _REQUIREDNAME == nil then
     6    PickupInventory = P
     7else
     8    _G[_REQUIREDNAME] = P
     9end
    510
    611P.filename = "PickupInventory"
     
    6166end
    6267
    63 return PickupInventory
     68return P
Note: See TracChangeset for help on using the changeset viewer.