// 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. //============================================================================= // Menu that shows up when you are close to a marker // And Whant to take actions on that marker // ------------------------------------------------------------ // Created by Rui Guimaraes // © 2006, Geodelft // // Date Id Modification // 2006-09-16 Gui Pause in menus //============================================================================= class MenuMarker extends GUIPage; var globalconfig string EN_Location, EN_Observation, EN_CallCenter, EN_Diagnosis, EN_TakeMeasure, EN_Erase, EN_Topic, NL_Location, NL_Observation, NL_CallCenter, NL_Diagnosis, NL_TakeMeasure, NL_Erase, NL_Topic; var int OptionSelected; 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; //============================================================================= // Date Id Modification // 2006-11-20 zmr When in the marker bActionCenterCalled is true you can't delete that marker. //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; local GeoLevelDetails GLD; local RedMarker RMarker; local ConversationState lastConvState; Super.InitComponent(MyController, MyOwner); OnKeyEvent = InternalOnKeyEvent; OnClose = InternalOnClose; // ************************* // Consider buttons: // -2- -1- // -1- -2- -3- // -5- -6- -7- // -3- // ************************* // BUTTON 1 Controls[1].WinTop = 0.25 + SButtonVGap; Controls[1].WinLeft = 0.5 + (0.7 / 2) - (SButtonSize) - SButtonHGap; Controls[1].WinWidth = SButtonSize; Controls[1].WinHeight = SButtonSize; // BUTTON 2 Controls[2].WinTop = Controls[1].WinTop; Controls[2].WinLeft = Controls[1].WinLeft - (SButtonSize) - SButtonHGap;; Controls[2].WinWidth = SButtonSize; Controls[2].WinHeight = SButtonSize; // BUTTON 3 Controls[3].WinTop = 0.75 - SButtonSize - SButtonVGap; Controls[3].WinLeft = 0.5 + (0.7 / 2) - (SButtonSize * 1.2) - SButtonHGap; Controls[3].WinWidth = SButtonSize * 1.2; Controls[3].WinHeight = SButtonSize; // BUTTON 5 Controls[5].WinTop = 0.53 - (0.5 * ButtonVGap) - (1.0 * ButtonHeight); Controls[5].WinLeft = 0.5 - (1.5 * ButtonWidth) - (1 * ButtonHGap); // BUTTON 6 Controls[6].WinTop = Controls[5].WinTop; Controls[6].WinLeft = Controls[5].WinLeft + ButtonWidth + ButtonHGap; // BUTTON 7 Controls[7].WinTop = Controls[5].WinTop; Controls[7].WinLeft = Controls[6].WinLeft + ButtonWidth + ButtonHGap; // BUTTON 8 Controls[8].WinTop = Controls[5].WinTop + ButtonVGap + ButtonHeight; Controls[8].WinLeft = Controls[5].WinLeft; // BUTTON 9 Controls[9].WinTop = Controls[8].WinTop; Controls[9].WinLeft = Controls[8].WinLeft + ButtonWidth + ButtonHGap; // BUTTON 10 Controls[10].WinTop = Controls[8].WinTop; Controls[10].WinLeft = Controls[9].WinLeft + ButtonWidth + ButtonHGap; GeoPC=GeoPlayerController(PlayerOwner()); for(i=5; i<11; i++) { Controls[i].WinWidth = ButtonWidth; Controls[i].WinHeight = ButtonHeight; } if(GeoPC!=None) { UpdateLanguage(); //Is the player allowed to take measures or make diagnosis GLD = new class'GeoLevelDetails'; RMarker = GeoPC.NearByMarker; if(RMarker.ConvState.length > 0) { lastConvState = RMarker.ConvState[RMarker.ConvState.Length-1]; } if(lastConvState!=none) { if(GLD.TakeMeasures&&lastConvState.ConversationStates[lastConvState.ConversationStates.Length-1] == Con_Measure) { // the player is allowed to take measures } else { // the player is not allowed to take measures yet Controls[9].MenuState=MSAT_Disabled; } } else { //The conversation is not in an state yet Controls[9].MenuState=MSAT_Disabled; } if(!GLD.MakeDiagnoses) { //The player is not allowed to make an diagnosis so hide it for the player Controls[8].MenuState=MSAT_Disabled; } if(GeoPC.bIsgameOver) { //The game is ended and the button action center should be disabled. Controls[7].MenuState=MSAT_Disabled; } if(Rmarker.bActionCenterCalled) { //There has already been an phone call with the ac so you may not erase the rmarker Controls[10].MenuState=MSAT_Disabled; } } else log("ERROR WITH TYPE OF GAME"); Controls[0].SetFocus(none); } function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) { local GeoPlayerController pc; pc = GeoPlayerController(PlayerOwner()); // Swallow first escape key event (key up from key down that opened menu) if(bIgnoreEsc && Key == 0x1B) { bIgnoreEsc = false; return true; } else if (Key == 0x1B ) { pc.InMenu(false); Controller.CloseMenu(); return true; } } function InternalOnClose(optional Bool bCanceled) { Super.OnClose(bCanceled); } //============================================================================= // Date Id Modification // 2006-08-15 The Fixed error on selection Diagnosis //============================================================================= function bool InternalOnClick(GUIComponent Sender) { local int i; local Marker TempMarker; for(i=0; i<11; i++) { if(Sender==Controls[i]) { switch(i) { case 1: GeoPC.InMenu(false); Controller.CloseMenu(); // Close _all_ menus break; case 2: //HELP Controller.ReplaceMenu("GeoSimulator.HelpMenuMarker"); break; case 3: Controller.OpenMenu("GeoInterface.NotAvailable"); break; case 4: Controller.OpenMenu("GeoInterface.NotAvailable"); break; case 5: Controller.ReplaceMenu("GeoSimulator.MenuRedMarkerLocation"); break; case 6: GeoPC.ResetNewSignal(); Controller.ReplaceMenu("GeoSimulator.MenuObservationMain"); break; case 7: if (GeoPC.IsDroogte() == false) { Controller.ReplaceMenu("GeoSimulator.MenuActionCenterStandard"); } else { Controller.ReplaceMenu("GeoSimulator.MenuActionCenterDroogte"); } //Controller.ReplaceMenu("GeoSimulator.MenuActionCenterStandard"); break; case 8: Controller.ReplaceMenu("GeoSimulator.MenuDiagnosis"); break; case 9: Log("MenuMarker - MenuMeasure"); Controller.ReplaceMenu("GeoSimulator.MenuMeasure"); break; case 10: TempMarker = GeoPC.NearByMarker; if ((RedMarker(TempMarker).LTile)!= none) { (RedMarker(TempMarker).LTile).CurrentRedMarker = none; } GeoPC.pauseWarnings(false); //deleten doorgeven GeoPC.geoFb.logDeleteMarker(GeoPC.NearByMarker.name); GeoPC.removeWarning(GeoPC.NearByMarker); GeoPC.AwayFromMarker(TempMarker, true); TempMarker.Destroy(); GeoPC.InMenu(false); Controller.CloseMenu(); break; } } } return true; } function UpdateLanguage() { if(GeoPC.Dutch) { GUILabel(Controls[4]).Caption=NL_Topic; GUIButton(Controls[5]).Caption=NL_Location; GUIButton(Controls[6]).Caption=NL_Observation; GUIButton(Controls[7]).Caption=NL_CallCenter; GUIButton(Controls[8]).Caption=NL_Diagnosis; GUIButton(Controls[9]).Caption=NL_TakeMeasure; GUIButton(Controls[10]).Caption=NL_Erase; } else { GUILabel(Controls[4]).Caption=EN_Topic; GUIButton(Controls[5]).Caption=EN_Location; GUIButton(Controls[6]).Caption=EN_Observation; GUIButton(Controls[7]).Caption=EN_CallCenter; GUIButton(Controls[8]).Caption=EN_Diagnosis; GUIButton(Controls[9]).Caption=EN_TakeMeasure; GUIButton(Controls[10]).Caption=EN_Erase; } } defaultproperties { Begin Object Class=GUIButton name=QuitBackground WinWidth=0.7 WinLeft=0.15 WinTop=0.25 WinHeight=0.5 bAcceptsInput=false bNeverFocus=true StyleName="GeoCallBar" End Object Controls(0)=GUIButton'QuitBackground' Begin Object Class=GUIGFxButton Name=NoReport Caption="" Graphic=Material'InGameMenuImagesT.NoBackgroundButtons.Closed' Position="ICP_Scaled" StyleName="MidGameButton" OnClick=InternalOnClick End Object Controls(1)=GUIButton'NoReport' 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=false OnClick=InternalOnClick End Object Controls(3)=GUIButton'NextPage' Begin Object class=GUILabel Name=TopicDesc Caption="***" TextALign=TXTA_Center TextColor=(R=255,G=120,B=0,A=255) TextFont="HeaderFont" WinWidth=1 WinLeft=0 WinTop=0.3 WinHeight=32 End Object Controls(4)=GUILabel'TopicDesc' // ************************************************************** // BUTTONS FOR OPTIONS // // ************************************************************** Begin Object Class=GUIGFxButton Name=LocButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalLocation' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(5)=GUIButton'LocButton' Begin Object Class=GUIGFxButton Name=ObsButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalObservationReport' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(6)=GUIButton'ObsButton' Begin Object Class=GUIGFxButton Name=CallButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalCallActionCenter' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(7)=GUIButton'CallButton' Begin Object Class=GUIGFxButton Name=DiagButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalDiagnosisReport' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(8)=GUIButton'DiagButton' Begin Object Class=GUIGFxButton Name=MeasButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalMeasure' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(9)=GUIButton'MeasButton' Begin Object Class=GUIGFxButton Name=EraseButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalErase' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(10)=GUIButton'EraseButton' ButtonWidth=0.17 ButtonHeight=0.12 ButtonHGap=0.02 ButtonVGap=0.037 BarHeight=0.21 BarVPos=0.5 SButtonSize=0.06 SButtonHGap=0.02 SButtonVGap=0.02 OptionSelected=0 OpenSound=sound'RuntimeInterfaceSounds.SelectDshort' bIgnoreEsc=true bRequire640x480=false bAllowedAsLast=true EN_Location="Location" EN_Observation="Observation Report" EN_CallCenter="Call Action Center" EN_Diagnosis="Diagnosis Report" EN_TakeMeasure="Take Measure" EN_Erase="Remove Marker" EN_Topic="Report Menu" NL_Location="Locatie" NL_Observation="Observatie Rapport" NL_CallCenter="Bel Actiecentrum" NL_Diagnosis="Diagnose Rapport" NL_TakeMeasure="Neem Maatregel" NL_Erase="Verwijder Piket" NL_Topic="Rapport Menu" }