예제 #1
0
            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()
예제 #2
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameSmoothLevelTool);
            base.OnActivate();

            PickerX = brushPicker;      // Assign X button to brush picker and activate.

            // If the location of the cursor is not over any terrain then
            // don't allow the magic brush as the default.
            if (Terrain.GetTerrainHeightFlat(Boku.InGame.inGame.Cursor3D.Position) == 0.0f)
            {
                // By not including the magic brush in the brush set we
                // force the picker to change the current brush to one
                // of the standard brushes if not already.
                brushPicker.BrushSet = Brush2DManager.BrushType.Binary;
            }

            brushPicker.BrushSet = Brush2DManager.BrushType.Binary
                                   | Brush2DManager.BrushType.Selection;
            brushPicker.UseAltOverlay = true;

            inGame.Terrain.LevelHeight = Terrain.GetTerrainHeightFlat(shared.editBrushPosition);

            PickerY = materialPicker; // Assign Y button to material picker and activate.
        }                             // end of OnActivate()
예제 #3
0
        override public void Activate()
        {
            if (state != States.Active)
            {
                // 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.Push(commandMap);

                pendingState             = States.Active;
                BokuGame.objectListDirty = true;

                saveChangesActivated = false;

                HelpOverlay.ToolIcon = null;

                InGame.inGame.RenderWorldAsThumbnail = true;

                timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.MiniHubTime);

                Foley.PlayMenuLoop();

                Time.Paused = true;

                AuthUI.ShowStatusDialog();
            }
        }
예제 #4
0
        override public void Activate()
        {
            if (state != States.Active)
            {
                // If we're in a tutorial and we get to the MainMenu, kill the tutorial.
                TutorialManager.Deactivate();

                // 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.Push(commandMap);
                shared.menu.Active = true;

                pendingState             = States.Active;
                BokuGame.objectListDirty = true;

                // Restore the default texture map for UI use.
                BokuGame.bokuGame.shaderGlobals.EnvTextureName = null;

                // Not persisting, make sure it's empty.
                XmlOptionsData.WebUserSecret = String.Empty;

                timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.MainMenuTime);

                Foley.PlayMenuLoop();
            }
        }   // end of MainMenu Activate()
예제 #5
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameWaterTool);

            base.OnActivate();

            PickerY = waterPicker;

            inGame.ShowCursor();
        }   // end of OnActivate()
예제 #6
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameRaiseLowerTool);

            base.OnActivate();

            PickerX = brushPicker;      // Assign X button to brush picker and activate.
            brushPicker.BrushSet = Brush2DManager.BrushType.All
                                   | Brush2DManager.BrushType.Selection;
        }   // end of OnActivate()
        }   // end of GetHelpDescription()

        /// <summary>
        /// Activates the AddItem help card.
        /// </summary>
        /// <param name="parent">Parent pie selector.</param>
        /// <param name="typeName">This is the string that identifies the type of the object we're getting help for.  This is used to get the correct help data from the Help class.</param>
        /// <param name="objectName">This the displayed name of the object/actor.  This comes from the Strings class and may be localized.</param>
        public void Activate(PieSelector parent, string typeName, string objectName)
        {
            ToolTipManager.Clear();

            if (typeName == null || objectName == null)
            {
                return;
            }

            this.parent = parent;

            if (state != States.Active)
            {
                // Ensure we have valid help before activating.
                shared.actorHelp = Help.GetActorHelp(typeName);

                if (shared.actorHelp == null || shared.actorHelp.upid == null)
                {
                    return;
                }

                // 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.Push(commandMap);

                state = States.Active;

                shared.curActorName = objectName;
                if (shared.actorHelp.description != null)
                {
                    shared.descBlob.RawText = shared.actorHelp.description.Trim();
                }

                shared.SetUpGrid();

                if (shared.examplesGrid != null)
                {
                    shared.examplesGrid.Active = true;
                }

                // Always start the description at the beginning.
                shared.topLine    = 0;
                shared.descOffset = 0;

                // Get the current scene thumbnail.
                shared.thumbnail = InGame.inGame.SmallThumbNail;

                // Tell InGame we're using the thumbnail so no need to do full render.
                InGame.inGame.RenderWorldAsThumbnail = true;

                HelpOverlay.Push(@"HelpCardAddItem");

                timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.AddItemHelpCards);
            }
        }   // end of Activate
예제 #8
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameDeleteTool);
            base.OnActivate();

            PickerX = brushPicker;      // Assign X button to brush picker and activate.
            brushPicker.BrushSet = Brush2DManager.BrushType.Binary
                                   | Brush2DManager.BrushType.StretchedBinary
                                   | Brush2DManager.BrushType.Selection;
            brushPicker.UseAltOverlay = true;
        }   // end of HeightMapTool OnActivate()
            public override void Activate()
            {
                if (!active)
                {
                    base.Activate();

                    parent.cursor3D.Deactivate();
                    shared.editObjectParameters.Activate();

                    timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameEditObjectParameters);
                }
            }   // end of EditObjectParametersUpdateObj Activate()
예제 #10
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameRaiseLowerTool);

            base.OnActivate();

            Boku.InGame.inGame.Cursor3D.Hidden = true;

            PickerX = brushPicker;      // Assign X button to brush picker and activate.
            brushPicker.BrushSet = Brush2DManager.BrushType.All
                                   | Brush2DManager.BrushType.StretchedAll
                                   | Brush2DManager.BrushType.Selection;
        }   // end of HeightMapTool OnActivate()
예제 #11
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameSpikeyHillyTool);

            base.OnActivate();

            Boku.InGame.inGame.Cursor3D.Hidden = true;

            Terrain.Reseed();

            PickerX = brushPicker;      // Assign X button to brush picker and activate.
            brushPicker.BrushSet = Brush2DManager.BrushType.All
                                   | Brush2DManager.BrushType.StretchedAll
                                   | Brush2DManager.BrushType.Selection;
        }   // end of NoiseTool OnActivate()
예제 #12
0
        public override void OnActivate()
        {
            timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameSmoothLevelTool);
            base.OnActivate();

            Boku.InGame.inGame.Cursor3D.Hidden = true;

            PickerX = brushPicker;      // Assign X button to brush picker and activate.
            brushPicker.BrushSet = Brush2DManager.BrushType.All
                                   | Brush2DManager.BrushType.StretchedAll
                                   | Brush2DManager.BrushType.Selection;

            endSamplePosition = shared.editBrushPosition;
            inGame.Terrain.LevelHeight
                = Terrain.GetTerrainHeightFlat(shared.editBrushPosition);
        }   // end of RoadLevelTool OnActivate()