home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- System Initialization
- --------------------------------------------------------------------------------
- function UI:OnInit()
-
- -- get the list of videofiles
- --local szScriptFolder = "Scripts/UIScreens/";
-
- ----------------------
- -- Load Configuration
- ----------------------
- --Script:LoadScript(szScriptFolder.."UISystemCfg.lua", 1); -- Load Configuration File
-
- -- Load the skin
- --Script:LoadScript(UI.szSkinPath, 1);
-
- -- Set background and mouse cursor
- UI:SetMouseCursor(System:LoadImage(UI.szMouseCursor));
- UI:SetMouseCursorSize(24, 24);
-
- ----------------------
- -- Load Screen Scripts
- ----------------------
-
- -- Load Common Generic Screens
- --Script:LoadScript(szScriptFolder..szLuaFile, 1); -- Back Borders
- UI:ActivateScreen(szScreen);
- end
-
- --------------------------------------------------------------------------------
- -- System Deinitialization
- --------------------------------------------------------------------------------
- function UI:OnRelease()
- end
-
- --------------------------------------------------------------------------------
- -- System Idle
- --------------------------------------------------------------------------------
- function UI:OnIdle(fIdleTime)
- end
-
- --------------------------------------------------------------------------------
- -- System Switch (e.g. user pressed ESC to switch between game and menu)
- --------------------------------------------------------------------------------
- -- /param bSwitchOn 1=on, 0=off
- function UI:OnSwitch( bSwitchOn )
-
- -- System:Log("UI:OnSwitch"); -- debugging
-
- System:ShowConsole(0);
-
- if (bSwitchOn) then
- UI:ActivateScreen(szScreen);
-
- if (ClientStuff and _localplayer and ClientStuff.OnMenuEnter) then
- ClientStuff:OnMenuEnter();
- end
- else
- UI:DeactivateAllScreens();
- end
- end
-
-
-
- -----------------------------------------------------------------------------
- -- Can we render the game in the background ?
- ------------------------------------------------------------------------------
- function UI:CanRenderGame()
- if (not ClientStuff) then
- return nil;
- end
-
- if (Game:IsInMenu()) then
- if (ClientStuff.GetInGameMenuVideoOn) then
- if (ClientStuff:GetInGameMenuVideoOn() ~= 0) then
- return nil;
- end
- end
- end
-
- return 1;
- end
-
- --------------------------------------------------------------------------------
- -- System Can Switch ? (e.g. user pressed ESC to switch between game and menu)
- --------------------------------------------------------------------------------
- -- /param bSwitchOn 1=on, 0=off
- function UI:CanSwitch( bSwitchOn )
- if (bSwitchOn) then
- if ((UI.bCanSwitchOn and UI.bCanSwitchOn ~= 0) or (not UI.bCanSwitchOn)) then
- return 1;
- end
-
- return nil;
- else
- if (UI.bCanSwitchOff and UI.bCanSwitchOff == 0) then
- return nil;
- end
-
- return 1;
- end
- end