// 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. //============================================================================= // Game Story option // ------------------------------------------------------------ // © 2006, Geodelft // // Date Id Modification // 2006-10-29 The Created this header // 2007-05-30 wsl Pressing Esc does the same as back-button //============================================================================= class GameStory extends GUIPage config(GeoUser); #exec OBJ LOAD FILE=GUIContent.utx var bool Dutch; var float SavedPitch; var automated GUIGFXButton but_1, but_2; var automated GUITitleBar but_BackGroundButton; var automated GUIButton but_Back; var automated GUITitleBar lab_Hint; var automated GUILabel lab_BackGroundLabel; var automated GUIImage ima_MainLogo; // Buttons in 2 languages var string EN_but_Back, NL_but_Back; // Hints in 2 languages var string EN_hint_Back, EN_B1, EN_B2, EN_B1_hint, EN_B2_hint, EN_SelectText, NL_hint_Back, NL_B1, NL_B2, NL_B1_hint, NL_B2_hint, NL_SelectText; var bool AllowSelect; // To make sure that on sub menus appear can't click on options function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.InitComponent(MyController, MyOwner); lab_Hint.SetFocus(none); SetLanguage(); UpdateLanguage(); SaveConfig(); } // whenever the window is opened it makes a refresh of language event Opened(GUIComponent Sender) { Super.Opened(Sender); SetLanguage(); UpdateLanguage(); } function ChangeAllow(bool a) { AllowSelect = a; } //************************************** //LANGUAGE: IF IT IS IN GAME OR IN MENU'S //************************************** function bool SetLanguage() { if(PlayerOwner().IsA('GeoPlayerController')) { return GeoPlayerController(PlayerOwner()).Dutch; } else { warn("THIS PLAYER CONTROLLER DOESN'T SUPPORT LANGUAGE"); return true; } } event ChangeHint(string NewHint) { lab_Hint.Caption = NewHint; } function MyOpenPage() { Dutch=SetLanguage(); UpdateLanguage(); } function InternalOnClose(optional Bool bCanceled) { local rotator NewRot; // Reset player NewRot = PlayerOwner().Rotation; NewRot.Pitch = SavedPitch; PlayerOwner().SetRotation(NewRot); // Save config. //pPlayer.InternalApply(none); Super.OnClose(bCanceled); } function bool MyKeyEvent(out byte Key,out byte State,float delta) { if(Key == 0x1B && State == 1) // Escape pressed { Controller.ReplaceMenu("GeoInterface.MainMenuOptions"); return true; } else return false; } event NotifyLevelChange() { Controller.CloseMenu(true); } function bool ButtonClick(GUIComponent Sender) { local GeoCompleteExercise GCE; if (Sender != None && AllowSelect) switch(Sender) { case but_1: // continue last exercise StartExercise(); break; case but_2: // start new exercise GCE = new class'GeoCompleteExercise'; GCE.CurrentLevel=0; GCE.CurrentScore=0; GCE.SaveConfig(); StartExercise(); break; case but_Back: Controller.ReplaceMenu("GeoInterface.MainMenuOptions"); break; default: break; } return true; } function StartExercise() { local GeoCompleteExercise GCE; local string FullMapURL; GCE = new class'GeoCompleteExercise'; GCE.IsCompleteExercise=true; GCE.SaveConfig(); GCE.SetDetails(); FullMapURL = GCE.GetLevelString(); log("Full URL" @FullMapURL); log("UT2InstantActionMain::PlayButtonClick - Sending [open"@FullMapURL$"] to the console"); Console(Controller.Master.Console).ConsoleCommand("start"@FullMapURL); Controller.CloseAll(false); } function UpdateLanguage() { if(Dutch) { but_Back.Caption=NL_but_Back; lab_BackGroundLabel.Caption=NL_SelectText; but_1.Caption=NL_B1; but_2.Caption=NL_B2; but_1.Hint=NL_B1_hint; but_2.Hint=NL_B2_hint; but_Back.Hint=NL_hint_Back; ima_MainLogo.Image=Material'GeoDelft.Logo_NL'; } else { but_Back.Caption=EN_but_Back; lab_BackGroundLabel.Caption=EN_SelectText; but_1.Caption=EN_B1; but_2.Caption=EN_B2; but_1.Hint=EN_B1_hint; but_2.Hint=EN_B2_hint; but_Back.Hint=EN_hint_Back; ima_MainLogo.Image=Material'GeoDelft.Logo_EN'; } } defaultproperties { Begin Object Class=GUIImage Name=GeoMainLogo WinWidth=1.0 WinHeight=0.15 WinLeft=0 WinTop=0.08 Image=Material'GeoDelft.Logo_EN' ImageColor=(R=255,G=255,B=255,A=240); ImageStyle=ISTY_Justified ImageRenderStyle=MSTY_Alpha ImageAlign=IMGA_Center End Object Begin Object class=GUITitleBar name=SettingFooter WinWidth=0.88 WinHeight=0.055 WinLeft=0.12 WinTop=0.93 bUseTextHeight=false StyleName="Footer" Justification=TXTA_Center End Object //TITLE AND BACKGROUND OF MAP Begin Object Class=GUITitleBar Name=BackGroundButton bUseTextHeight=false Caption="" Hint="" StyleName="SquareMenuButton" WinWidth=0.61 WinHeight=0.45 WinLeft=0.195 WinTop=0.27 End Object Begin Object class=GUILabel Name=BackGroundLabel Caption="" TextALign=TXTA_Center TextColor=(R=255,G=255,B=255,A=255) TextFont="HeaderFont" WinWidth=1 WinLeft=0 WinTop=0.3 WinHeight=32 End Object //BUTTONS FOR THE OPTIONS Begin Object Class=GUIGFXButton Name=B1 Position="ICP_Scaled" Graphic=Material'GeoDelft.Buttons.ContinueFinal' //bFocusOnWatch=True Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.28 WinHeight=0.25 WinLeft=0.21 WinTop=0.45 End Object Begin Object Class=GUIGFXButton Name=B2 Position="ICP_Scaled" Graphic=Material'GeoDelft.Buttons.CompleteFinal' //bFocusOnWatch=True Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.28 WinHeight=0.25 WinLeft=0.51 WinTop=0.45 End Object Begin Object Class=GUIButton Name=Back Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.12 WinHeight=0.055 WinLeft=0 WinTop=0.93 End Object OnKeyEvent=MyKeyEvent bAllowedAsLast=true bDisconnectOnOpen=false ima_MainLogo=GeoMainLogo AllowSelect = true lab_Hint=SettingFooter OnOpen=MyOpenPage but_1 = B1 but_2 = B2 but_Back = Back but_BackGroundButton = BackGroundButton lab_BackGroundLabel = BackGroundLabel bPersistent=true EN_but_Back="Back" EN_SelectText="Complete Exercise" NL_but_Back="Terug" NL_SelectText="Volledige Oefening" EN_hint_Back="Go to Main Menu" EN_B1="Continue Previous Exercise" EN_B2="New Complete Exercise" EN_B1_hint="Continue Previous Exercise" EN_B2_hint="New Complete Exercise" NL_hint_Back="Ga naar het Hoofdmenu" NL_B1="Ga Door Met Vorige Oefening" NL_B2="Nieuwe Volledige Oefening" NL_B1_hint="Ga Door Met Vorige Oefening" NL_B2_hint="Nieuwe Oefening" }