// 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 button of QUIT // - 2 languages // //************************************************* class QuitPage extends GUIPage; var string NL_Yes, EN_Yes, NL_No, EN_No, NL_Message, EN_Message; var bool Dutch,bIgnoreEsc; //************************************** //LANGUAGE: IF IT IS IN GAME OR IN MENU'S //Shouldn't be like this but works... correct me please //************************************** function bool SetLanguage() { if(PlayerOwner().IsA('GeoPlayerController')) { return GeoPlayerController(PlayerOwner()).Dutch; } else { warn("THIS PLAYER CONTROLLER DOESN'T SUPPORT LANGUAGE"); return true; } } function bool MyKeyEvent(out byte Key,out byte State,float delta) { local PlayerController pc; local int SizeArray; pc = PlayerOwner(); //ESC if(Key == 0x1B){ if(bIgnoreEsc) { bIgnoreEsc=false; return true; } else { SizeArray = Controller.MenuStack.Length; if (SizeArray > 1){ MainMenuOptions(Controller.MenuStack[(SizeArray-2)]).ChangeAllow(true); } pc.ConsoleCommand("OutMenu"); Controller.CloseMenu(); return true; } } return false; } function bool InternalOnClick(GUIComponent Sender) { local int SizeArray; if (Sender==Controls[1]) { PlayerOwner().ConsoleCommand("exit"); } else { SizeArray = Controller.MenuStack.Length; if (SizeArray > 1) { MainMenuOptions(Controller.MenuStack[(SizeArray-2)]).ChangeAllow(true); } Controller.CloseMenu(false); } return true; } function UpdateLanguage() { if(Dutch) { GUIButton(Controls[1]).Caption=NL_Yes; GUIButton(Controls[2]).Caption=NL_No; GUILabel(Controls[3]).Caption=NL_Message; } else { GUIButton(Controls[1]).Caption=EN_Yes; GUIButton(Controls[2]).Caption=EN_No; GUILabel(Controls[3]).Caption=EN_Message; } } function MyOpenPage() { Dutch=SetLanguage(); UpdateLanguage(); } defaultproperties { Begin Object Class=GUIButton name=QuitBackground WinWidth=1.0 WinHeight=1.0 WinTop=0 WinLeft=0 bAcceptsInput=false bNeverFocus=true StyleName="SquareBar" bBoundToParent=true bScaleToParent=true End Object Controls(0)=GUIButton'QuitBackground' Begin Object Class=GUIButton Name=YesButton Caption="***" WinWidth=0.2 WinHeight=0.04 WinLeft=0.125 WinTop=0.75 bBoundToParent=true OnClick=InternalOnClick End Object Controls(1)=GUIButton'YesButton' Begin Object Class=GUIButton Name=NoButton Caption="***" WinWidth=0.2 WinHeight=0.04 WinLeft=0.65 WinTop=0.75 bBoundToParent=true OnClick=InternalOnClick End Object Controls(2)=GUIButton'NoButton' Begin Object class=GUILabel Name=QuitDesc Caption="***" TextALign=TXTA_Center TextColor=(R=220,G=180,B=0,A=255) TextFont="HeaderFont" WinWidth=1 WinLeft=0 WinTop=0.4 WinHeight=32 End Object Controls(3)=GUILabel'QuitDesc' WinLeft=0 WinTop=0.375 WinWidth=1 WinHeight=0.25 bRequire640x480=false bIgnoreEsc=true OnKeyEvent=MyKeyEvent OnOpen=MyOpenPage // *********************************** // Language Settings // *********************************** EN_Message="Are you sure you wish to quit?" NL_Message="Weet je zeker dat je wilt stoppen?" EN_Yes="Yes" NL_Yes="Ja" EN_No="No" NL_No="Nee" }