// 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-20 gui Class created // 2007-06-10 gui Made option for Handbook and Notebook available //============================================================================= class MenuTrainingInventory extends MenuInventory; var GeoPlayerControllerTraining GeoPCTrain; //============================================================================= // Date Id Modification // 2006-09-22 gui Created this function // 2007-06-10 gui Made option for Handbook and Notebook available //============================================================================= function bool InternalOnClick(GUIComponent Sender) { local int i; local GeoPlayerController pc; pc = GeoPlayerController(PlayerOwner()); for(i=0; i<11; i++) { if(Sender==Controls[i]) { switch(i) { case 1: pc.InMenu(false); if(GeoPCTrain.TrainStep==7 && GeoPCTrain.IsNextStepAllowed==false) { GeoPCTrain.IsNextStepAllowed=true; } Controller.CloseMenu(); // Close _all_ menus break; case 2: //HELP Controller.ReplaceMenu("GeoSimulator.HelpMenuTrainingInventory"); break; case 3: Controller.OpenMenu("GeoInterface.NotAvailable"); break; case 4: Controller.OpenMenu("GeoInterface.NotAvailable"); break; case 5: pc.ConsoleCommand("PlaceMarker MK_Red"); pc.InMenu(false); Controller.CloseMenu(); break; case 6: pc.ConsoleCommand("PlaceMarker MK_Yellow"); pc.InMenu(false); Controller.CloseMenu(); break; case 7: Controller.ReplaceMenu("GeoSimulator.MenuTrainingMap"); break; case 8: Controller.ReplaceMenu("GeoSimulator.MenuTrainingHandbook"); break; case 9: Controller.ReplaceMenu("GeoSimulator.MenuNotebook"); break; case 10: Controller.ReplaceMenu("GeoSimulator.MenuTrainingScore"); break; } } } return true; } //============================================================================= // Date Id Modification // 2006-09-20 gui function created // 2008-01-16 Jln Map button will only work after step 6. //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); // ***************************** // // 5 Report // 6 Distance // 7 Map // 8 HandBook // 9 Notebook // 10 Score // // ***************************** for(i=5; i<11; i++) { ///Todo Almar: uncomment, this is for easier level testing: Almar JLN Controls[i].MenuState=MSAT_Disabled; } GeoPCTrain=GeoPlayerControllerTraining(PlayerOwner()); if(GeoPCTrain.TrainStep==4) { Controls[6].MenuState=MSAT_Blurry; } else if(GeoPCTrain.TrainStep==5) { //Controls[5].MenuState=MSAT_Blurry; Controls[6].MenuState=MSAT_Blurry; Controls[7].MenuState=MSAT_Blurry; } else if(GeoPCTrain.TrainStep==6) { Controls[5].MenuState=MSAT_Blurry; //if(GeoPCTrain.TrainSubStep==3) //{ Controls[6].MenuState=MSAT_Blurry; //} } else if(GeoPCTrain.TrainStep==7) { Controls[8].MenuState=MSAT_Blurry; Controls[9].MenuState=MSAT_Blurry; Controls[10].MenuState=MSAT_Blurry; } Log("Trainstep: " @ GeoPCTrain.TrainStep); if(GeoPCTrain.TrainStep > 5) { Controls[7].MenuState=MSAT_Blurry; } Controls[0].SetFocus(none); } //============================================================================= // Date Id Modification // 2006-09-20 gui function created //============================================================================= defaultproperties { }