Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 26, 2010, 8:51:37 PM (15 years ago)
Author:
rgrieder
Message:

Simplified GUI sheet creation (first lines in the lua file) a lot by exporting it to GUITools.lua

Location:
code/branches/gamestate/data/gui/scripts
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/data/gui/scripts/AudioMenu.lua

    r6571 r6621  
    11-- AudioMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("AudioMenu")
    5 if _REQUIREDNAME == nil then
    6     AudioMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("AudioMenu")
    104
    115function P:init()
  • code/branches/gamestate/data/gui/scripts/BasicGUI.lua

    r6537 r6621  
    1 -- gui.lua
     1-- BasicGUI.lua
    22
    33local P = {}
    4 if _REQUIREDNAME == nil then
    5     BasicGUI = P
    6 else
    7     _G[_REQUIREDNAME] = P
    8 end
     4_G[_REQUIREDNAME or "BasicGUI"] = P
    95
    106-- useless, even wrong? P is the class, not the object..
     
    2723end
    2824
    29 -- Override this function if you need to
     25-- Override this function if you want to change one of the three input parameters:
     26-- showCursor = true, useKeyboard = true and blockJoyStick = false
    3027-- But don't forget to stick to the naming convention ("GUI_" .. self.filename)
    3128function P:createInputState()
  • code/branches/gamestate/data/gui/scripts/ControlsMenu.lua

    r6459 r6621  
    11-- ControlsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("ControlsMenu")
    5 if _REQUIREDNAME == nil then
    6     ControlsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("ControlsMenu")
    104
    115function P.ControlsMouseControlsButton_clicked(e)
  • code/branches/gamestate/data/gui/scripts/CreditsMenu.lua

    r6459 r6621  
    11-- CreditsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("CreditsMenu")
    5 if _REQUIREDNAME == nil then
    6     CreditsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local sheetName = _REQUIREDNAME or "CreditsMenu"
     4-- Create object of type BasicGUI and make it global
     5local P = require("BasicGUI"):new(sheetName)
     6_G[sheetName] = P
    107
    118function P.CreditsBackButton_clicked(e)
  • code/branches/gamestate/data/gui/scripts/DecisionPopup.lua

    r6537 r6621  
    11-- DecisionPopup.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("DecisionPopup")
    5 if _REQUIREDNAME == nil then
    6     DecisionPopup = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("DecisionPopup")
    104
    115function P.setCallback(functionPtr)
  • code/branches/gamestate/data/gui/scripts/GUITools.lua

    r6417 r6621  
     1function createSheet(sheetName)
     2    -- Create object of type BasicGUI and make it global
     3    local sheet = require("BasicGUI"):new(sheetName)
     4    _G[sheetName] = sheet
     5    return sheet
     6end
     7
    18function openDecisionPopup( text, callbackPtr )
    29    showGUI("DecisionPopup", false, true)
  • code/branches/gamestate/data/gui/scripts/GameplayMenu.lua

    r6571 r6621  
    11-- GameplayMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("GameplayMenu")
    5 if _REQUIREDNAME == nil then
    6     GameplayMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("GameplayMenu")
    104
    115function P:init()
  • code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua

    r6571 r6621  
    11-- GraphicsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("GraphicsMenu")
    5 if _REQUIREDNAME == nil then
    6     GraphicsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("GraphicsMenu")
    104
    115function P:init()
  • code/branches/gamestate/data/gui/scripts/InGameMenu.lua

    r6537 r6621  
    11-- InGameMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("InGameMenu")
    5 if _REQUIREDNAME == nil then
    6     InGameMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("InGameMenu")
    104
    115-- events for ingamemenu
  • code/branches/gamestate/data/gui/scripts/InfoPopup.lua

    r6537 r6621  
    11-- InfoPopup.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("InfoPopup")
    5 
    6 if _REQUIREDNAME == nil then
    7     InfoPopup = P
    8 else
    9     _G[_REQUIREDNAME] = P
    10 end
     3local P = createSheet("InfoPopup")
    114
    125function P.execute(functionPtr, arguments)
  • code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua

    r6564 r6621  
    11-- KeyBindMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("KeyBindMenu")
    5 
    6 if _REQUIREDNAME == nil then
    7     KeyBindMenu = P
    8 else
    9     _G[_REQUIREDNAME] = P
    10 end
     3local P = createSheet("KeyBindMenu")
    114
    125function P:init()
  • code/branches/gamestate/data/gui/scripts/MainMenu.lua

    r6459 r6621  
    11-- MainMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("MainMenu")
    5 if _REQUIREDNAME == nil then
    6     MainMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("MainMenu")
    104
    115-- events for MainMenu
  • code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua

    r6459 r6621  
    11-- MouseControlsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("MouseControlsMenu")
    5 if _REQUIREDNAME == nil then
    6     MouseControlsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("MouseControlsMenu")
    104
    115function P:init()
  • code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua

    r6571 r6621  
    11-- MultiplayerMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("MultiplayerMenu")
    5 if _REQUIREDNAME == nil then
    6     MultiplayerMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("MultiplayerMenu")
    104
    115function P:init()
  • code/branches/gamestate/data/gui/scripts/MultiplayerOptionsMenu.lua

    r6459 r6621  
    11-- MultiplayerOptionsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("MultiplayerOptionsMenu")
    5 if _REQUIREDNAME == nil then
    6     MultiplayerOptionsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("MultiplayerOptionsMenu")
    104
    115function P.MultiplayerOptionsBackButton_clicked(e)
  • code/branches/gamestate/data/gui/scripts/PickupInventory.lua

    r6459 r6621  
    11-- PickupInventory.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("PickupInventory")
    5 if _REQUIREDNAME == nil then
    6     PickupInventory = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("PickupInventory")
    104
    115P.lastEquipmentCount_ = 0
  • code/branches/gamestate/data/gui/scripts/QuestGUI.lua

    r6459 r6621  
    1 gui = require("BasicGUI")
    2 local P = BasicGUI:new("QuestGUI")
    3 if _REQUIREDNAME == nil then
    4     QuestGUI = P
    5 else
    6     _G[_REQUIREDNAME] = P
    7 end
     1-- QuestGUI.lua
     2
     3local P = createSheet("QuestGUI")
    84
    95function P:show()
  • code/branches/gamestate/data/gui/scripts/SettingsMenu.lua

    r6459 r6621  
    11-- SettingsMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("SettingsMenu")
    5 if _REQUIREDNAME == nil then
    6     SettingsMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("SettingsMenu")
    104
    115function P.SettingsGameplayButton_clicked(e)
  • code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua

    r6571 r6621  
    11-- SingleplayerMenu.lua
    22
    3 BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new("SingleplayerMenu")
    5 if _REQUIREDNAME == nil then
    6     SingleplayerMenu = P
    7 else
    8     _G[_REQUIREDNAME] = P
    9 end
     3local P = createSheet("SingleplayerMenu")
    104
    115function P:init()
Note: See TracChangeset for help on using the changeset viewer.