// 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. //============================================================================= // In game menu for choosing what type of damage is to be reported. // Started from MenuMarker. // ------------------------------------------------------------ // Created by Maarten Wesselius // © 2006, GeoDelft // // Date Id Modification // 2007 11 13 Zmr Made the esc button not swallow //============================================================================= class MenuChooseSignal extends GUIPage; var string EN_Title, NL_Title; var string EN_SignalStrings[12], NL_SignalStrings[12]; var GeoPlayerController GeoPC; var bool bIgnoreEsc; var float ButtonWidth; var float ButtonHeight; var float ButtonHGap; var float ButtonVGap; var float BarHeight; var float BarVPos; var float SButtonSize; var float SButtonVGap; var float SButtonHGap; var float TitleLeftGap; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); OnKeyEvent = InternalOnKeyEvent; OnClose = InternalOnClose; // Menu Background Controls[0].WinLeft = (1 - Controls[0].WinWidth) / 2; Controls[0].WinTop = (1 - Controls[0].WinHeight) / 2; // QuitButton Controls[1].WinTop = 0.5 - (Controls[0].WinHeight / 2) + SButtonVGap; Controls[1].WinLeft = 0.5 + (Controls[0].WinWidth / 2) - SButtonSize - SButtonHGap; Controls[1].WinWidth = SButtonSize; Controls[1].WinHeight = SButtonSize; // HelpButton Controls[2].WinTop = Controls[1].WinTop; Controls[2].WinLeft = Controls[1].WinLeft - SButtonSize - SButtonHGap; Controls[2].WinWidth = SButtonSize; Controls[2].WinHeight = SButtonSize; // NextButton Controls[3].WinTop = Controls[0].WinTop + Controls[0].WinHeight - SButtonVGap - SButtonSize; Controls[3].WinLeft = Controls[1].WinLeft; Controls[3].WinWidth = SButtonSize; Controls[3].WinHeight = SButtonSize; // Menu Title Controls[4].WinTop = Controls[1].WinTop; Controls[4].WinLeft = 0.5 - (Controls[0].WinWidth / 2) + TitleLeftGap; Controls[4].WinWidth = 0.7; Controls[4].WinHeight = 0.1; // Signal Buttons for(i=5; i<17; i++) { Controls[i].WinWidth = ButtonWidth; Controls[i].WinHeight = ButtonHeight; moCheckBox(Controls[i]).MyCheckBox.OnClick = SetRadioButtons; moCheckBox(Controls[i]).MyLabel.OnClick = SetRadioButtons; moCheckBox(Controls[i]).MyLabel.bAcceptsInput = true; } // first column of Signal buttons Controls[5].WinTop = 0.5 - (3.0 * ButtonHeight) - (2.5 * ButtonVGap) + 0.05; Controls[5].WinLeft = 0.5 - ButtonWidth - (2 * ButtonHGap); Controls[6].WinTop = Controls[5].WinTop + ButtonHeight + ButtonVGap; Controls[6].WinLeft = Controls[5].WinLeft; Controls[7].WinTop = Controls[6].WinTop + ButtonHeight + ButtonVGap; Controls[7].WinLeft = Controls[6].WinLeft; Controls[8].WinTop = Controls[7].WinTop + ButtonHeight + ButtonVGap; Controls[8].WinLeft = Controls[7].WinLeft; Controls[9].WinTop = Controls[8].WinTop + ButtonHeight + ButtonVGap; Controls[9].WinLeft = Controls[8].WinLeft; Controls[10].WinTop = Controls[9].WinTop + ButtonHeight + ButtonVGap; Controls[10].WinLeft = Controls[9].WinLeft; // second column of Signal buttons Controls[11].WinTop = Controls[5].WinTop; Controls[11].WinLeft = 0.5 + (2 * ButtonHGap); Controls[12].WinTop = Controls[11].WinTop + ButtonHeight + ButtonVGap; Controls[12].WinLeft = Controls[11].WinLeft; Controls[13].WinTop = Controls[12].WinTop + ButtonHeight + ButtonVGap; Controls[13].WinLeft = Controls[12].WinLeft; Controls[14].WinTop = Controls[13].WinTop + ButtonHeight + ButtonVGap; Controls[14].WinLeft = Controls[13].WinLeft; Controls[15].WinTop = Controls[14].WinTop + ButtonHeight + ButtonVGap; Controls[15].WinLeft = Controls[14].WinLeft; Controls[16].WinTop = Controls[15].WinTop + ButtonHeight + ButtonVGap; Controls[16].WinLeft = Controls[15].WinLeft; // fake button to take away the focus Controls[17].WinTop = 0; Controls[17].WinLeft = 0; Controls[17].SetVisibility(false); GeoPC=GeoPlayerController(PlayerOwner()); if(GeoPC!=None) UpdateLanguage(); else log("ERROR WITH TYPE OF GAME"); FillResults(); } //============================================================================= // Date Id Modification // 2007-04-05 Zmr Created this header //============================================================================= Event Opened(GUIComponent Sender) { Super.Opened(Sender); bVisible = true; } function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) { //must not swallow if( Key == 0x1B) { Controller.ReplaceMenu("GeoSimulator.MenuObservationMain"); } return true; } function InternalOnClose(optional Bool bCanceled) { Super.OnClose(bCanceled); } function bool InternalOnClick(GUIComponent Sender) { local int i; local PlayerController pc; pc = PlayerOwner(); for(i = 0; i < Controls.length; i++) { if(Sender == Controls[i]) { switch(i) { case 1: // Quit Button Controller.ReplaceMenu("GeoSimulator.MenuObservationMain"); // Controller.CloseMenu(); break; case 2: // Help Button bVisible = false; Controller.OpenMenu("GeoSimulator.HelpMenuChooseSignal"); break; case 3: // Next Button StoreResult(); Controller.ReplaceMenu("GeoSimulator.MenuSignalLocation"); break; } } } return true; } function StoreResult() { local int i; local Signal tempSignal; local bool bIsA; for(i=5; i<17 && !moCheckBox(Controls[i]).IsChecked(); i++) {} if(GeoPC!=None) { switch(i) { case 5: tempSignal = new class'SignalRipPitching'; tempSignal.SignalType = SIG_RipRapPitching; bIsA = GeoPC.NewSignal.IsA('SignalRipPitching'); break; case 6: tempSignal = new class'SignalGrass'; tempSignal.SignalType = SIG_GrassRevetment; bIsA = GeoPC.NewSignal.IsA('SignalGrass'); break; case 7: tempSignal = new class'SignalCrack'; tempSignal.SignalType = SIG_Crack; bIsA = GeoPC.NewSignal.IsA('SignalCrack'); break; case 8: tempSignal = new class'SignalSettlement'; tempSignal.SignalType = SIG_Settlement; bIsA = GeoPC.NewSignal.IsA('SignalSettlement'); break; case 9: tempSignal = new class'SignalHorizontalMovement'; tempSignal.SignalType = SIG_HorizontalMovement; bIsA = GeoPC.NewSignal.IsA('SignalHorizontalMovement'); break; case 10: tempSignal = new class'SignalUprise'; tempSignal.SignalType = SIG_Uprise; bIsA = GeoPC.NewSignal.IsA('SignalUprise'); break; case 11: tempSignal = new class'SignalLiquefaction'; tempSignal.SignalType = SIG_Liquefaction; bIsA = GeoPC.NewSignal.IsA('SignalLiquefaction'); break; case 12: tempSignal = new class'SignalWaterOutflow'; tempSignal.SignalType = SIG_WaterOutflow; bIsA = GeoPC.NewSignal.IsA('SignalWaterOutflow'); break; case 13: tempSignal = new class'SignalOverToppingWash'; tempSignal.SignalType = SIG_OverToppingWash; bIsA = GeoPC.NewSignal.IsA('SignalOverToppingWash'); break; case 14: tempSignal = new class'SignalFloatingWaste'; tempSignal.SignalType = SIG_FloatingWasteOther; bIsA = GeoPC.NewSignal.IsA('SignalFloatingWaste'); break; case 15: tempSignal = new class'SignalHumanActivity'; tempSignal.SignalType = SIG_HumanActivity; bIsA = GeoPC.NewSignal.IsA('SignalHumanActivity'); break; case 16: tempSignal = new class'SignalBioActivity'; tempSignal.SignalType = SIG_BioActivity; bIsA = GeoPC.NewSignal.IsA('SignalBioActivity'); break; } if(bIsA) { // The Variables in GeoPC.NewSignal should remain unchanged. } else { // All Variables in GeoPC.NewSignal are forgotten and a new one is made GeoPC.NewSignal = tempSignal; } } else { log("ERROR WITH TYPE OF GAME"); } } function FillResults() { local int i; if(GeoPC!=None) { if (GeoPC.NewSignal != none) { switch(GeoPC.NewSignal.SignalType) { case SIG_RipRapPitching: i = 5; break; case SIG_GrassRevetment: i = 6; break; case SIG_Crack: i = 7; break; case SIG_Settlement: i = 8; break; case SIG_HorizontalMovement: i = 9; break; case SIG_Uprise: i = 10; break; case SIG_Liquefaction: i = 11; break; case SIG_WaterOutflow: i = 12; break; case SIG_OverToppingWash: i = 13; break; case SIG_FloatingWasteOther: i = 14; break; case SIG_HumanActivity: i = 15; break; case SIG_BioActivity: i = 16; break; case SIG_NONE: i = 17; break; } SetRadioButtons(moCheckBox(Controls[i]).MyCheckBox); } } else { log("ERROR WITH TYPE OF GAME"); } } function UpdateLanguage() { if(GeoPC.Dutch) { GUILabel(Controls[4]).Caption = NL_Title; moCheckBox(Controls[5]).myLabel.Caption = " " $ NL_SignalStrings[0]; moCheckBox(Controls[6]).myLabel.Caption = " " $ NL_SignalStrings[1]; moCheckBox(Controls[7]).myLabel.Caption = " " $ NL_SignalStrings[2]; moCheckBox(Controls[8]).myLabel.Caption = " " $ NL_SignalStrings[3]; moCheckBox(Controls[9]).myLabel.Caption = " " $ NL_SignalStrings[4]; moCheckBox(Controls[10]).myLabel.Caption = " " $ NL_SignalStrings[5]; moCheckBox(Controls[11]).myLabel.Caption = " " $ NL_SignalStrings[6]; moCheckBox(Controls[12]).myLabel.Caption = " " $ NL_SignalStrings[7]; moCheckBox(Controls[13]).myLabel.Caption = " " $ NL_SignalStrings[8]; moCheckBox(Controls[14]).myLabel.Caption = " " $ NL_SignalStrings[9]; moCheckBox(Controls[15]).myLabel.Caption = " " $ NL_SignalStrings[10]; moCheckBox(Controls[16]).myLabel.Caption = " " $ NL_SignalStrings[11]; } else { GUILabel(Controls[4]).Caption=EN_Title; moCheckBox(Controls[5]).myLabel.Caption = " " $ EN_SignalStrings[0]; moCheckBox(Controls[6]).myLabel.Caption = " " $ EN_SignalStrings[1]; moCheckBox(Controls[7]).myLabel.Caption = " " $ EN_SignalStrings[2]; moCheckBox(Controls[8]).myLabel.Caption = " " $ EN_SignalStrings[3]; moCheckBox(Controls[9]).myLabel.Caption = " " $ EN_SignalStrings[4]; moCheckBox(Controls[10]).myLabel.Caption = " " $ EN_SignalStrings[5]; moCheckBox(Controls[11]).myLabel.Caption = " " $ EN_SignalStrings[6]; moCheckBox(Controls[12]).myLabel.Caption = " " $ EN_SignalStrings[7]; moCheckBox(Controls[13]).myLabel.Caption = " " $ EN_SignalStrings[8]; moCheckBox(Controls[14]).myLabel.Caption = " " $ EN_SignalStrings[9]; moCheckBox(Controls[15]).myLabel.Caption = " " $ EN_SignalStrings[10]; moCheckBox(Controls[16]).myLabel.Caption = " " $ EN_SignalStrings[11]; } } function bool SetRadioButtons(GUIComponent Sender) { local int j; local moCheckBox Abutton; Controls[3].SetVisibility(false); // no next button for(j = 5; j < 17;j++) { Abutton = moCheckBox(Controls[j]); if(Sender == Abutton.MyCheckBox || Sender == moCheckBox(Controls[j]).MyLabel ) { Abutton.Checked(True); Controls[3].SetVisibility(true); } else { Abutton.Checked(false); } } return true; } defaultproperties { Begin Object Class=GUIButton name=Background WinWidth=0.85 WinHeight=0.65 bAcceptsInput=false bNeverFocus=true StyleName="GeoCallBar" End Object Controls(0)=GUIButton'Background' Begin Object Class=GUIGFxButton Name=QuitButton Caption="" Graphic=Material'InGameMenuImagesT.NoBackgroundButtons.Closed' Position=ICP_Scaled StyleName="MidGameButton" OnClick=InternalOnClick bNeverFocus=true End Object Controls(1)=GUIButton'QuitButton' Begin Object Class=GUIGFxButton Name=HelpButton Caption="" Graphic=Material'InGameMenuImagesT.NoBackgroundButtons.Questionmark' Position=ICP_Scaled StyleName="MidGameButton" bNeverFocus=true OnClick=InternalOnClick End Object Controls(2)=GUIButton'HelpButton' Begin Object Class=GUIGFxButton Name=NextPage Caption="" Graphic=Material'InGameMenuImagesT.NoBackgroundButtons.Next' Position=ICP_Scaled StyleName="MidGameButton" bNeverFocus=true bVisible=true OnClick=InternalOnClick End Object Controls(3)=GUIButton'NextPage' Begin Object class=GUILabel Name=MenuTitle Caption="***" TextAlign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="HeaderFont" End Object Controls(4)=GUILabel'MenuTitle' // Controls 5 to 16 are the buttons for the different signals Begin Object class=moCheckBox Name=SignalButton Caption="***" INIOption="@Internal" INIDefault="True" CaptionWidth=1 bSquare=true bFlipped=true bHeightFromComponent=false WinHeight=0.02 ComponentJustification=TXTA_Left LabelJustification=TXTA_Right End Object Controls(5)=moCheckBox'SignalButton' Controls(6)=moCheckBox'SignalButton' Controls(7)=moCheckBox'SignalButton' Controls(8)=moCheckBox'SignalButton' Controls(9)=moCheckBox'SignalButton' Controls(10)=moCheckBox'SignalButton' Controls(11)=moCheckBox'SignalButton' Controls(12)=moCheckBox'SignalButton' Controls(13)=moCheckBox'SignalButton' Controls(14)=moCheckBox'SignalButton' Controls(15)=moCheckBox'SignalButton' Controls(16)=moCheckBox'SignalButton' Controls(17)=moCheckBox'SignalButton' ButtonWidth=0.25 ButtonHeight=0.04 ButtonHGap=0.025 ButtonVGap=0.025 BarHeight=0.21 BarVPos=0.5 SButtonSize=0.06 SButtonHGap=0.02 SButtonVGap=0.02 TitleLeftGap=0.05 OpenSound=sound'RuntimeInterfaceSounds.SelectDshort' bIgnoreEsc=true bRequire640x480=false bAllowedAsLast=true EN_Title = "What kind of signal do you want to report?" EN_SignalStrings(0) = "Rip-rap / pitching stone" EN_SignalStrings(1) = "Grass revetment" EN_SignalStrings(2) = "Crack" EN_SignalStrings(3) = "Settlement" EN_SignalStrings(4) = "Horizontal movement" EN_SignalStrings(5) = "Uprise" EN_SignalStrings(6) = "Liquefaction" EN_SignalStrings(7) = "Water outflow" EN_SignalStrings(8) = "Overtopping / overwash" EN_SignalStrings(9) = "Floating waste et al." EN_SignalStrings(10) = "Human activity" EN_SignalStrings(11) = "Biological activity" NL_Title = "Wat voor signaal wil je rapporteren?" NL_SignalStrings(0) = "Zet- en stortsteen" NL_SignalStrings(1) = "Grasbekleding" NL_SignalStrings(2) = "Scheur" NL_SignalStrings(3) = "Verzakking" NL_SignalStrings(4) = "Horizontale verplaatsing" NL_SignalStrings(5) = "Opbolling" NL_SignalStrings(6) = "Verweking" NL_SignalStrings(7) = "Uitstromend water" NL_SignalStrings(8) = "Overloop / overslag" NL_SignalStrings(9) = "Drijfvuil e.a." NL_SignalStrings(10) = "Menselijke activiteit" NL_SignalStrings(11) = "Biologische activiteit" }