Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6666


Ignore:
Timestamp:
Mar 31, 2010, 2:37:45 AM (15 years ago)
Author:
rgrieder
Message:

Fixed problem that can occur when BasicGUI cannot be loaded.

Location:
code/branches/gamestates2/data/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua

    r6662 r6666  
    11-- CreditsMenu.lua
    22
    3 local sheetName = _REQUIREDNAME or "CreditsMenu"
    4 -- Create object of type BasicGUI and make it global
    5 local P = require("BasicGUI"):new(sheetName)
    6 _G[sheetName] = P
     3local P = createSheet("CreditsMenu")
    74
    85function P.CreditsBackButton_clicked(e)
  • code/branches/gamestates2/data/gui/scripts/GUITools.lua

    r6662 r6666  
    11function createSheet(sheetName)
    22    -- Create object of type BasicGUI and make it global
    3     local sheet = require("BasicGUI"):new(sheetName)
     3    local basicGUI = require("BasicGUI")
     4    if basicGUI == nil then
     5        error("Loading BasicGUI.lua failed")
     6    end
     7    local sheet = basicGUI:new(sheetName)
    48    _G[sheetName] = sheet
    59    return sheet
Note: See TracChangeset for help on using the changeset viewer.