// 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 // 2007-09-19 wsl Changed all occurrences of 'afstands-' to 'meet-' //============================================================================= class MenuYellowMarker extends GUIPage; var string EN_CurrentDist, EN_PreviousDist, EN_Distance, EN_CurrentHeight, EN_PreviousHeight, EN_Move, EN_NA, EN_Erase, EN_Topic, NL_CurrentDist, NL_PreviousDist, NL_Distance, NL_CurrentHeight, NL_PreviousHeight, NL_Move, NL_NA, NL_Erase, NL_Topic; var string NL_TakeNote,NL_Note1,NL_Note2H,NL_Note2D,NL_Note3, EN_TakeNote,EN_Note1,EN_Note2H,EN_Note2D,EN_Note3, Note1, Note2D, Note2H, Note3; var bool bNoteTakenD, bNoteTakenH; var int OptionSelected; var GeoPlayerController GeoPC; var bool bIgnoreEsc; const NOTE_DIST = 1; const NOTE_HEIGHT = 2; 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; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); GeoPC=GeoPlayerController(PlayerOwner()); OnKeyEvent = InternalOnKeyEvent; OnClose = InternalOnClose; bNoteTakenD=false; bNoteTakenH=false; // ************************* // 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 9 Controls[9].WinTop = 0.53 - (0.5 * ButtonVGap) - (1.0 * ButtonHeight); Controls[9].WinLeft = 0.5 - (0.5 * ButtonWidth); Controls[9].WinWidth = 1.25 * ButtonWidth; Controls[9].WinHeight = 1.4 * ButtonHeight; // BUTTON 10 Controls[10].WinTop = 0.5 + (1 * ButtonVGap); Controls[10].WinLeft =0.5 - ButtonWidth - ( 0.5 * ButtonHGap); // BUTTON 10 Controls[11].WinTop = Controls[10].WinTop; Controls[11].WinLeft = Controls[10].WinLeft + ButtonWidth + (2 * ButtonHGap); //TAKE NOTES Controls[16].WinWidth = SButtonSize * 2.5; Controls[16].WinHeight = SButtonSize * 0.55; Controls[16].WinTop = Controls[5].WinTop + ButtonWidth * 0.3; Controls[16].WinLeft = Controls[7].WinLeft + ButtonWidth * 0.6; Controls[17].WinWidth = SButtonSize * 2.5; Controls[17].WinHeight = SButtonSize * 0.55; Controls[17].WinTop = Controls[12].WinTop + ButtonWidth * 0.3; Controls[17].WinLeft = Controls[14].WinLeft + ButtonWidth * 0.6; for(i=10; i<12; i++) { Controls[i].WinWidth = ButtonWidth; Controls[i].WinHeight = ButtonHeight; } if(GeoPC!=None) UpdateLanguage(); else log("ERROR WITH TYPE OF GAME"); InitialButtons(); Controls[0].SetFocus(none); } function InitialButtons() { // IF THERE IS ANOTHER MARKER if(GeoPC.NearByYellowMarker.OtherMarker != None) { //SET CURRENT DISTANCE if(GeoPC.NearByYellowMarker.CurrentDist==0) { if(GeoPC.Dutch) { GUILabel(Controls[7]).Caption=NL_NA; GUILabel(Controls[14]).Caption=NL_NA; } else { GUILabel(Controls[7]).Caption=EN_NA; GUILabel(Controls[14]).Caption=EN_NA; } Controls[16].bVisible=false; Controls[17].bVisible=false; } else { if(bNoteTakenD==false) { Controls[16].bVisible=true; } else { Controls[16].bVisible=false; } if(bNoteTakenH==false) { Controls[17].bVisible=true; } else { Controls[17].bVisible=false; } GUILabel(Controls[7]).Caption=string(GeoPC.NearByYellowMarker.CurrentDist) @"cm"; GUILabel(Controls[14]).Caption=string(GeoPC.NearByYellowMarker.CurrentHeight) @"cm"; } //SET PREVIOUS DISTANCE and HEIGHT if(GeoPC.NearByYellowMarker.PreviousDist==0) { if(GeoPC.Dutch) { GUILabel(Controls[8]).Caption=NL_NA; GUILabel(Controls[15]).Caption=NL_NA; } else { GUILabel(Controls[8]).Caption=EN_NA; GUILabel(Controls[15]).Caption=EN_NA; } } else { GUILabel(Controls[8]).Caption=string(GeoPC.NearByYellowMarker.PreviousDist) @"cm"; GUILabel(Controls[15]).Caption=string(GeoPC.NearByYellowMarker.PreviousHeight) @"cm"; } Controls[9].bVisible=false; } else { Controls[5].bVisible=false; Controls[6].bVisible=false; Controls[7].bVisible=false; Controls[8].bVisible=false; Controls[12].bVisible=false; Controls[13].bVisible=false; Controls[14].bVisible=false; Controls[15].bVisible=false; Controls[16].bVisible=false; Controls[17].bVisible=false; } } 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(Key == 0x1B) { pc.InMenu(false); Controller.CloseMenu(); return true; } } function InternalOnClose(optional Bool bCanceled) { Super.OnClose(bCanceled); } function bool InternalOnClick(GUIComponent Sender) { local int i; local Marker TempMarker; for(i=0; i<18; i++) { if(Sender==Controls[i]) { switch(i) { case 1: GeoPC.InMenu(false); Controller.CloseMenu(); // Close _all_ menus break; case 2: //HELP Controller.ReplaceMenu("GeoSimulator.HelpMenuYellowMarker"); break; case 3: // not visible Controller.OpenMenu("GeoInterface.NotAvailable"); break; case 9: // place second yellow marker GeoPC.ConsoleCommand("PutSecondYellowMarkerDown"); GeoPC.InMenu(false); Controller.CloseMenu(); break; case 10: // move the yellow marker GeoPC.ConsoleCommand("MoveYellowMarker"); GeoPC.InMenu(false); Controller.CloseMenu(); break; case 11: // remove current marker GeoPC.geoFb.logDeleteMarker(GeoPC.NearByYellowMarker.name); GeoPC.NearByYellowMarker.OtherMarker.SetOtherMarker(GeoPC.NearByYellowMarker.OtherMarker); GeoPC.NearByYellowMarker.OtherMarker.UpdateDistanceToOtherMarker(); GeoPC.NearByYellowMarker.OtherMarker.SetOtherMarker(none); TempMarker = GeoPC.NearByYellowMarker; GeoPC.AwayFromMarker(TempMarker, false); TempMarker.Destroy(); GeoPC.InMenu(false); Controller.CloseMenu(); break; case 16: // take note distance TakeNote(NOTE_DIST); Controls[16].bVisible=false; break; case 17: // take note height TakeNote(NOTE_HEIGHT); Controls[17].bVisible=false; break; } } } return true; } function TakeNote(int NoteType) { local GeoNotebook NTB; local LocationNameSign MyLocSign; local string LocName; // CHECK THE CLOSEST LOCATION SIGN MyLocSign=GeoPC.NearByYellowMarker.CheckLocationSign(); //EN_LocationName, NL_LocationName if(GeoPC.Dutch) LocName = MyLocSign.NL_LocationName; else LocName = MyLocSign.EN_LocationName; NTB = new class'GeoNotebook'; switch(NoteType) { case NOTE_DIST: NTB.AddNote(Note1 @string(GeoPC.NearByYellowMarker.CurrentDist) $Note2D @LocName $Note3, "AUTO"); GeoPC.geoFb.logNote(Note1 @string(GeoPC.NearByYellowMarker.CurrentDist) $Note2D @LocName $Note3, "AUTO"); bNoteTakenD=true; break; case NOTE_HEIGHT: NTB.AddNote(Note1 @string(GeoPC.NearByYellowMarker.CurrentHeight) $Note2H @LocName $Note3, "AUTO"); GeoPC.geoFb.logNote(Note1 @string(GeoPC.NearByYellowMarker.CurrentHeight) $Note2H @LocName $Note3, "AUTO"); bNoteTakenH=true; break; } } function UpdateLanguage() { if(GeoPC.Dutch) { GUILabel(Controls[4]).Caption=NL_Topic; GUILabel(Controls[5]).Caption=NL_CurrentDist; GUILabel(Controls[6]).Caption=NL_PreviousDist; GUIButton(Controls[9]).Caption=NL_Distance; GUIButton(Controls[10]).Caption=NL_Move; GUIButton(Controls[11]).Caption=NL_Erase; GUILabel(Controls[12]).Caption=NL_CurrentHeight; GUILabel(Controls[13]).Caption=NL_PreviousHeight; GUIButton(Controls[16]).Caption=NL_TakeNote; GUIButton(Controls[17]).Caption=NL_TakeNote; Note1=NL_Note1; Note2D=NL_Note2D; Note2H=NL_Note2H; Note3=NL_Note3; } else { GUILabel(Controls[4]).Caption=EN_Topic; GUILabel(Controls[5]).Caption=EN_CurrentDist; GUILabel(Controls[6]).Caption=EN_PreviousDist; GUIButton(Controls[9]).Caption=EN_Distance; GUIButton(Controls[10]).Caption=EN_Move; GUIButton(Controls[11]).Caption=EN_Erase; GUILabel(Controls[12]).Caption=EN_CurrentHeight; GUILabel(Controls[13]).Caption=EN_PreviousHeight; GUIButton(Controls[16]).Caption=EN_TakeNote; GUIButton(Controls[17]).Caption=EN_TakeNote; Note1=EN_Note1; Note2D=EN_Note2D; Note2H=EN_Note2H; Note3=EN_Note3; } } 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=GUILabel Name=CuMeasLabel Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.33 WinTop=0.35 WinHeight=0.1 End Object Controls(5)=GUILabel'CuMeasLabel' Begin Object class=GUILabel Name=PrMeasLabel Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.33 WinTop=0.39 WinHeight=0.1 End Object Controls(6)=GUILabel'PrMeasLabel' Begin Object class=GUILabel Name=CuMeas Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.55 WinTop=0.35 WinHeight=0.1 End Object Controls(7)=GUILabel'CuMeas' Begin Object class=GUILabel Name=PrMeas Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.55 WinTop=0.39 WinHeight=0.1 End Object Controls(8)=GUILabel'PrMeas' // BUTTONS Begin Object Class=GUIGFxButton Name=DistButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalDistance' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(9)=GUIButton'DistButton' Begin Object Class=GUIGFxButton Name=MoveButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalMoveYellowMarker' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(10)=GUIButton'MoveButton' Begin Object Class=GUIGFxButton Name=EraseButton Graphic=Material'InGameMenuImagesT.ImageButtons.FinalEraseYellowMarker' Position="ICP_Scaled" Caption="***" StyleName="MidGameButton_Orange" OnClick=InternalOnClick End Object Controls(11)=GUIButton'EraseButton' // ************************************************************** // HEIGHT OPTIONS // // ************************************************************** Begin Object class=GUILabel Name=CuDistLabel Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.33 WinTop=0.45 WinHeight=0.1 End Object Controls(12)=GUILabel'CuDistLabel' Begin Object class=GUILabel Name=PrDistLabel Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.33 WinTop=0.48 WinHeight=0.1 End Object Controls(13)=GUILabel'PrDistLabel' Begin Object class=GUILabel Name=CuDist Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.55 WinTop=0.45 WinHeight=0.1 End Object Controls(14)=GUILabel'CuDist' Begin Object class=GUILabel Name=PrDist Caption="***" TextALign=TXTA_Left TextColor=(R=255,G=120,B=0,A=255) TextFont="MidGameFont" WinWidth=0.2 WinLeft=0.55 WinTop=0.48 WinHeight=0.1 End Object Controls(15)=GUILabel'PrDist' Begin Object Class=GUIButton Name=BTakeNote1 Caption = "" StyleName = "MidGameButton" bVisible = false OnClick = InternalOnClick End Object Controls(16) = GUIButton'BTakeNote1' Begin Object Class=GUIButton Name=BTakeNote2 Caption = "" StyleName = "MidGameButton" bVisible = false OnClick = InternalOnClick End Object Controls(17) = GUIButton'BTakeNote2' ButtonWidth=0.17 ButtonHeight=0.12 ButtonHGap=0.02 ButtonVGap=0.07 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_CurrentDist="Current Distance" EN_PreviousDist="Previous Distance" EN_CurrentHeight="Current Height Difference" EN_PreviousHeight="Previous Height Difference" EN_Distance="Measure Distance" EN_Move="Move Marker" EN_Erase="Remove Marker" EN_NA="N.A." EN_Topic="Measurement Menu" EN_TakeNote="Take Note" EN_Note1="Distante of" EN_Note2H="cm of height measured" EN_Note2D="cm of distance measured" EN_Note3="." NL_CurrentDist="Huidige Afstand" NL_PreviousDist="Vorige Afstand" NL_CurrentHeight="Huidig Hoogteverschil" NL_PreviousHeight="Vorig Hoogteverschil" NL_Distance="Meet Afstand" NL_Move="Verplaats Piket" NL_Erase="Verwijder Piket" NL_NA="N.V.T." NL_Topic="Meetmenu" NL_TakeNote="Plaats Notitie" NL_Note1="Gemeten:" NL_Note2H=" cm hoogte" NL_Note2D=" cm afstand" NL_Note3="." }