// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // Class for Menu from Level // ------------------------------------------------------------ // // © 2006, Geodelft // // Date Id Modification // 2006-10-24 The Created this header // 2006-10-24 The Formatted code // 2006-10-24 The Implemented score at close of level // 2006-10-26 The Resized controls and made lowercase captions //============================================================================= class MidGameMenu extends GUIPage config(GeoUser); var GeoPlayerController GeoPC; var bool bIgnoreEsc; var bool Dutch; var string EN_Cont, EN_Options, EN_Quit, EN_Close, NL_Cont, NL_Options, NL_Quit, NL_Close; var float ButtonWidth; var float ButtonHeight; var float ButtonHGap; var float ButtonVGap; var float BarHeight; var float BarVPos; //============================================================================= // Date Id Modification // 2006-10-24 The Created //============================================================================= function GeoPlayerController GetGeoPC() { return GeoPlayerController(PlayerOwner()); } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header // 2007-08-08 gui Added calling to function to call GeoPC //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); GeoPC = GetGeoPC(); OnKeyEvent = InternalOnKeyEvent; OnClose = InternalOnClose; // Bar Controls[0].WinHeight = BarHeight; Controls[0].WinWidth = 0.9; Controls[0].WinTop = BarVPos - (0.5 * BarHeight); Controls[0].Winleft = 0.05; // U MIDDLE Controls[1].WinTop = BarVPos - (1.0 * ButtonHeight); Controls[1].WinLeft = 0.5 - (0.5 * ButtonWidth); // U L Controls[2].WinTop = Controls[1].WinTop; Controls[2].WinLeft = 0.5 - (1.5 * ButtonWidth) - ButtonHGap; // U R Controls[3].WinTop = Controls[1].WinTop; Controls[3].WinLeft = 0.5 + (0.5 * ButtonWidth) + ButtonHGap; for(i=1; i<4; i++) { Controls[i].WinWidth = ButtonWidth; Controls[i].WinHeight = ButtonHeight; } Dutch=SetLanguage(); UpdateLanguage(); } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header //============================================================================= function MyOpenPage() { Dutch=SetLanguage(); UpdateLanguage(); } //============================================================================= // Description: LANGUAGE: IF IT IS IN GAME OR IN MENU'S // Date Id Modification // 2006-10-24 The Created this header //============================================================================= function bool SetLanguage() { if(PlayerOwner().IsA('GeoPlayerController')) { return GeoPlayerController(PlayerOwner()).Dutch; } else { warn("THIS PLAYER CONTROLLER DOESN'T SUPPORT LANGUAGE"); return true; } } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header //============================================================================= function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) { // Swallow first escape key event (key up from key down that opened menu) if(bIgnoreEsc && Key == 0x1B) { bIgnoreEsc = false; return true; } } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header //============================================================================= function InternalOnClose(optional Bool bCanceled) { local PlayerController pc; pc = PlayerOwner(); // Turn pause off if currently paused if(pc != None && pc.Level.Pauser != None) pc.SetPause(false); Super.OnClose(bCanceled); } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header // 2006-10-24 The Implemented score at close of level //============================================================================= function bool InternalOnClick(GUIComponent Sender) { if(Sender==Controls[2]) // LEAVE/DISCONNECT { Controller.CloseMenu(); GeoPC.PlayerInvokedQuit = true; GeoPC.GameOver(false); // GeoPC.bIsGameOver = True; // Controller.ReplaceMenu("GeoSimulator.MenuScore"); } else if(Sender==Controls[1]) // CONTINUE { Controller.CloseMenu(); // Close _all_ menus } else if(Sender==Controls[3]) // SETTINGS { Controller.OpenMenu("GeoInterface.OptionsMenu"); } return true; } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header //============================================================================= function UpdateLanguage() { if(Dutch) { GUIButton(Controls[1]).Caption=NL_Cont; GUIButton(Controls[2]).Caption=NL_Close; GUIButton(Controls[3]).Caption=NL_Options; } else { GUIButton(Controls[1]).Caption=EN_Cont; GUIButton(Controls[2]).Caption=EN_Close; GUIButton(Controls[3]).Caption=EN_Options; } } //============================================================================= // Date Id Modification // 2006-10-24 The Created this header //============================================================================= defaultproperties { Begin Object Class=GUIButton name=QuitBackground bAcceptsInput=false bNeverFocus=true StyleName="SquareBar" End Object Controls(0)=GUIButton'QuitBackground' Begin Object Class=GUIButton Name=ContMatchButton Caption="***" StyleName="MidGameButton" OnClick=InternalOnClick End Object Controls(1)=GUIButton'ContMatchButton' /// Begin Object Class=GUIButton Name=QuitGameButton // Caption="***" // StyleName="MidGameButton" // OnClick=InternalOnClick // End Object // Controls(2)=GUIButton'QuitGameButton' Begin Object Class=GUIButton Name=LeaveMatchButton Caption="***" StyleName="MidGameButton" OnClick=InternalOnClick End Object Controls(2)=GUIButton'LeaveMatchButton' Begin Object Class=GUIButton Name=SettingsButton Caption="***" StyleName="MidGameButton" OnClick=InternalOnClick End Object Controls(3)=GUIButton'SettingsButton' ButtonWidth=0.25 ButtonHeight=0.04 ButtonHGap=0.02 ButtonVGap=0.02 BarHeight=0.21 BarVPos=0.5 OpenSound=sound'RuntimeInterfaceSounds.SelectDshort' bIgnoreEsc=true bRequire640x480=false bAllowedAsLast=true EN_Cont="Continue" EN_Options="Settings" EN_Quit="Exit" EN_Close="Close map" NL_Cont="Doorgaan" NL_Options="Opties" NL_Quit="Einde" NL_Close="Afsluiten" }