// 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. //============================================================================= // Options to choose level // ------------------------------------------------------------ // © 2006, Geodelft // // Date Id Modification // 2006-10-09 The Created this header // 2006-10-09 The Disabled level 6 option // 2006-12-12 gui Placed level 4 // 2007-02-02 The Added IsReleaseVersion and set it to true // 2007-05-30 wsl Pressing Esc does the same as back-button // 2008-01-28 Jln Is release version is no longer necessary. Level 4 does exist now. //============================================================================= class SingleExercise extends GUIPage config(GeoUser); #exec OBJ LOAD FILE=GUIContent.utx //var bool IsReleaseVersion; var bool Dutch; var float SavedPitch; var automated GUIGFXButton but_Level1, but_Level2, but_Level3, but_Level4, but_Level5, but_Level6; 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_hint_Level1, EN_hint_Level2, EN_hint_Level3, EN_hint_Level4, EN_hint_Level5, EN_hint_Level6, EN_SelectText, NL_hint_Back, NL_hint_Level1, NL_hint_Level2, NL_hint_Level3, NL_hint_Level4, NL_hint_Level5, NL_hint_Level6, NL_SelectText ; var bool AllowSelect; // To make sure that on sub menus appear can't click on options //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= 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 // Date Id Modification // 2007-02-02 The Created this header //============================================================================= event Opened(GUIComponent Sender) { Super.Opened(Sender); SetLanguage(); UpdateLanguage(); } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function ChangeAllow(bool a) { AllowSelect = a; } //============================================================================= //LANGUAGE: IF IT IS IN GAME OR IN MENU'S // Date Id Modification // 2007-02-02 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 // 2007-02-02 The Created this header //============================================================================= function MyOpenPage() { Dutch=SetLanguage(); UpdateLanguage(); } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= 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); } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= 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; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= event ChangeHint(string NewHint) { lab_Hint.Caption = NewHint; //SHOULDN'T BE LIKE THIS BUT WORKS -> normal way not working if(NewHint == EN_hint_Level1 || NewHint == NL_hint_Level1) { FocusImage1(); } else if(NewHint == EN_hint_Level2 || NewHint == NL_hint_Level2) { FocusImage2(); } else if(NewHint == EN_hint_Level3 || NewHint == NL_hint_Level3) { FocusImage3(); } else if(NewHint == EN_hint_Level4 || NewHint == NL_hint_Level4) { FocusImage4(); } else if(NewHint == EN_hint_Level5 || NewHint == NL_hint_Level5) { FocusImage5(); } else if(NewHint == EN_hint_Level6 || NewHint == NL_hint_Level6) { FocusImage6(); } else { FocusImage0(); } } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= event NotifyLevelChange() { Controller.CloseMenu(true); } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header // 2007-02-02 The Added IsReleaseVersion and set it to true //============================================================================= function bool ButtonClick(GUIComponent Sender) { local GeoLevelDetails GLD; GLD = new class'GeoLevelDetails'; if (Sender != None && AllowSelect) { switch(Sender) { case but_Level1: GLD.CurrentLevelScenarioNumber = 1; GLD.SaveConfig(); Controller.ReplaceMenu("GeoInterface.MenuLevelOptionsOne"); break; case but_Level2: GLD.CurrentLevelScenarioNumber = 2; GLD.SaveConfig(); Controller.ReplaceMenu("GeoInterface.MenuLevelOptionsTwo"); break; case but_Level3: //ChangeAllow(false); Controller.OpenMenu("GeoInterface.NotAvailable"); break; case but_Level4: GLD.CurrentLevelScenarioNumber = 4; GLD.SaveConfig(); Controller.ReplaceMenu("GeoInterface.MenuLevelOptionsFour"); break; case but_Level5: //ChangeAllow(false); Controller.OpenMenu("GeoInterface.NotAvailable"); //Controller.ReplaceMenu("GeoInterface.MenuLevelOptionsOne"); break; case but_Level6: //ChangeAllow(false); Controller.OpenMenu("GeoInterface.NotAvailable"); // Controller.ReplaceMenu("GeoInterface.LevelSixOptions"); break; case but_Back: Controller.ReplaceMenu("GeoInterface.MainMenuOptions"); break; default: break; } } return true; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage0() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage1() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01Focus'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage2() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02Focus'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage3() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03Focus'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage4() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04Focus'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage5() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05Focus'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function FocusImage6() { but_Level1.Graphic=Material'GeoDelft.MapPreview.Map01'; but_Level2.Graphic=Material'GeoDelft.MapPreview.Map02'; but_Level3.Graphic=Material'GeoDelft.MapPreview.Map03'; but_Level4.Graphic=Material'GeoDelft.MapPreview.Map04'; but_Level5.Graphic=Material'GeoDelft.MapPreview.Map05'; but_Level6.Graphic=Material'GeoDelft.MapPreview.Map06Focus'; } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header //============================================================================= function UpdateLanguage() { if(Dutch) { but_Back.Caption=NL_but_Back; lab_BackGroundLabel.Caption=NL_SelectText; but_Level1.Hint=NL_hint_Level1; but_Level2.Hint=NL_hint_Level2; but_Level3.Hint=NL_hint_Level3; but_Level4.Hint=NL_hint_Level4; but_Level5.Hint=NL_hint_Level5; but_Level6.Hint=NL_hint_Level6; 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_Level1.Hint=EN_hint_Level1; but_Level2.Hint=EN_hint_Level2; but_Level3.Hint=EN_hint_Level3; but_Level4.Hint=EN_hint_Level4; but_Level5.Hint=EN_hint_Level5; but_Level6.Hint=EN_hint_Level6; but_Back.Hint=EN_hint_Back; ima_MainLogo.Image=Material'GeoDelft.Logo_EN'; } } //============================================================================= // Date Id Modification // 2007-02-02 The Created this header // 2007-02-02 The Added IsReleaseVersion and set it to true //============================================================================= 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.59 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=Level1 Graphic=Material'GeoDelft.MapPreview.Map01' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage1 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.2 WinTop=0.35 End Object Begin Object Class=GUIGFXButton Name=Level2 Graphic=Material'GeoDelft.MapPreview.Map02' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage2 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.4 WinTop=0.35 End Object Begin Object Class=GUIGFXButton Name=Level3 Graphic=Material'GeoDelft.MapPreview.Map03' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage3 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.6 WinTop=0.35 End Object Begin Object Class=GUIGFXButton Name=Level4 Graphic=Material'GeoDelft.MapPreview.Map04' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage4 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.2 WinTop=0.6 End Object Begin Object Class=GUIGFXButton Name=Level5 Graphic=Material'GeoDelft.MapPreview.Map05' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage5 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.4 WinTop=0.6 End Object Begin Object Class=GUIGFXButton Name=Level6 Graphic=Material'GeoDelft.MapPreview.Map06' Position="ICP_Scaled" bFocusOnWatch=True OnWatch=FocusImage6 Caption="***" Hint="***" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.20 WinHeight=0.25 WinLeft=0.6 WinTop=0.6 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_Level1 = Level1 but_Level2 = Level2 but_Level3 = Level3 but_Level4 = Level4 but_Level5 = Level5 but_Level6 = Level6 but_Back = Back but_BackGroundButton = BackGroundButton lab_BackGroundLabel = BackGroundLabel bPersistent=true EN_but_Back="Back" EN_SelectText="Select a region:" NL_but_Back="Terug" NL_SelectText="Selecteer een regio:" EN_hint_Back="Go to Main Menu" EN_hint_Level1="Region 1: Hooge Sluis" EN_hint_Level2="Region 2: Glazendorp" EN_hint_Level3="Region 3: Zoeteveen" EN_hint_Level4="Region 4: Nergenshuizen" EN_hint_Level5="Region 5: De Lange Leegte" EN_hint_Level6="Region 6: Kadorp" NL_hint_Back="Ga naar het Hoofdmenu" NL_hint_Level1="Regio 1: Hooge Sluis" NL_hint_Level2="Regio 2: Glazendorp" NL_hint_Level3="Regio 3: Zoeteveen" NL_hint_Level4="Regio 4: Nergenshuizen" NL_hint_Level5="Regio 5: De Lange Leegte" NL_hint_Level6="Regio 6: Kadorp" //IsReleaseVersion=false; }