// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // Endgame dialog to enter your name. //============================================================================= class DialogEndEnterName extends GeoGUIPage; var automated GeoTitle MenuTitle; var automated GeoLabel Label1; var automated moEditBox PlayerName; var automated GeoButton OK; var string NL_Title , NL_Score, NL_FillIn, NL_Name, NL_Interested, NL_Done; var bool bIgnoreEsc; /// When was a key or mouse pressed for the last time. var int LastActivityTime; function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.InitComponent(MyController, MyOwner); InternalOnOpen(); UpdateLanguage(); /// Set timer: //NewActivity(); //GeoPC.SetPause(true); // GeoPC.showTimer=false; //SetTimer(2.0, true); } function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) { //StoreResult( // if(key == 13 && moEditBox(Controls[4]).MyEditBox.bHasFocus) //{ // InternalOnClick(Controls[6]); //} return true; /// New activity.. //NewActivity(); } /// Function which updates inactivity time function NewActivity() { LastActivityTime = PlayerOwner().Level.TimeSeconds; Log("Menu activity reset: " @ LastActivityTime ); } event OnActivate() { NewActivity(); } event Opened(GUIComponent Sender) { NewActivity(); Super.Opened(Sender); // SetTimer(2.0, true); } //============================================================================= // Date Id Modification // 2007-02-03 Gui Function for having scores updated //============================================================================= function Timer() { local int ia; ia = (PlayerOwner().Level.TimeSeconds - LastActivityTime); /// Inactivity limit reached, proceed to another map. Log("Inactivity: " @ ia @ "level time: " @ PlayerOwner().Level.TimeSeconds) ; /// Inactivity time for starting the animation. if (ia > 180) { //NewActivity(); // LoadMovie(); } } //============================================================================= /// Load flying movie level // Date Id Modification // 2008-03-07 Jln Created this header //============================================================================= /* function bool LoadMovie() { local string FullMapURL; local GeoCompleteExercise GCE; if(SaveLevelInfo()) { GCE = new class'GeoCompleteExercise'; GCE.IsCompleteExercise=false; GCE.SaveConfig(); FullMapURL="Scenario2DG"; SaveConfig(); log("UT2InstantActionMain::PlayButtonClick - Sending [open"@FullMapURL$"] to the console"); Console(Controller.Master.Console).ConsoleCommand("start"@FullMapURL); Controller.CloseAll(false); } return true; } */ function InternalOnClose(optional Bool bCanceled) { Super.OnClose(bCanceled); } event InternalOnOpen () { SetResults(); } function bool InternalOnClick(GUIComponent Sender) { if(Sender == OK) { // Done button StoreResult(); Controller.OpenMenu(Controller.GetMainMenuClass()); GeoPC.ConsoleCommand( "DISCONNECT" ); } return true; } function UpdateLanguage() { MenuTitle.Caption = NL_Title; Label1.Caption = NL_Score $ GeoPC.GetRaceTime() $ "!"; PlayerName.MyLabel.Caption = NL_Name; OK.Caption = NL_Done; } function SetResults() { } //============================================================================= // Date Id Modification // 2007-02-03 Gui Function for having scores updated //============================================================================= function StoreResult() { local string MyResult; local GlobalScore GScore; local string TempName, FinalName, Character; local int i; FinalName=""; TempName=(PlayerName).GetText(); for(i=0; i