public override void Activate() { if (!active) { active = true; CommandStack.Push(commandMap); HelpOverlay.Push("RunSimulation"); // Wake everything up. parent.ActivateAllGameThings(); // This is commented out since it was removing Creatables from the level // when it shouldn't. In particular if you restart Kodu, find a level in // the LoadLevelMenu, and choose Edit, it would remove all the creatables. // Running and then editing would restore them so it's not peristing the // removal. // Normally I'd just delete the line but if this change starts causing issues // it might help to know this was here. If it's now 2019 or later you can // probably feel free to remove this. :-) //parent.RemoveCreatablesFromScene(); timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameRunSim); #if !NETFX_CORE // Refresh the list of attached microbits. { System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(MicrobitManager.RefreshWorker)); t.Start(); } #endif // Be sure all Auth UI is hidden. AuthUI.HideAllDialogs(); base.Activate(); } if (Program2.CmdLine.Exists("analytics")) { #if !NETFX_CORE Console.WriteLine("Begin Analytics"); #endif ObjectAnalysis oa = new ObjectAnalysis(); oa.beginAnalysis(MainMenu.StartupWorldFilename.ToString()); // GamePadInput.stopActiveInputTimer(); //deactivate the menu on exit to stop the timer Deactivate(); // Wave bye, bye. #if NETFX_CORE Windows.UI.Xaml.Application.Current.Exit(); #else BokuGame.bokuGame.Exit(); #endif } } // end of RunSimUpdateObj Activate()
override public void Deactivate() { if (state != States.Inactive && pendingState != States.Inactive) { // Do stack handling here. If we do it in the update object we have no // clue which order things get pushed and popped and madness ensues. CommandStack.Pop(commandMap); HelpOverlay.Pop(); shared.menu.Active = false; pendingState = States.Inactive; BokuGame.objectListDirty = true; InGame.inGame.RenderWorldAsThumbnail = false; Instrumentation.StopTimer(timerInstrument); Foley.StopMenuLoop(); Time.Paused = false; AuthUI.HideAllDialogs(); } }
public override void Deactivate() { AuthUI.HideAllDialogs(); }