Exemplo n.º 1
0
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
        }
Exemplo n.º 2
0
        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            foreach (var vessel in FlightGlobals.VesselsLoaded)
            {
                if (vessel.FindPartModuleImplementing <ModuleCommand>() != null &&
                    (Settings.MultiTrajectories || vessel == FlightGlobals.ActiveVessel) &&
                    LoadedVesselsTrajectories.All(t => t.AttachedVessel != vessel))
                {
                    AttachVessel(vessel);
                }
            }

            for (var i = LoadedVesselsTrajectories.Count - 1; i >= 0; i--)
            {
                Trajectory trajectory = LoadedVesselsTrajectories[i];
                if (trajectory.AttachedVessel.FindPartModuleImplementing <ModuleCommand>() == null ||
                    (!Settings.MultiTrajectories && trajectory.AttachedVessel != FlightGlobals.ActiveVessel) ||
                    FlightGlobals.VesselsLoaded.All(v => v != trajectory.AttachedVessel))
                {
                    trajectory.Destroy();
                    LoadedVesselsTrajectories.RemoveAt(i);
                }
            }

            foreach (var trajectory in LoadedVesselsTrajectories)
            {
                trajectory.Update();
            }

            MainGUI.Update();
        }
Exemplo n.º 3
0
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
            if (!Settings.NewGui)
#pragma warning disable CS0618 // Type or member is obsolete
            {
                OldGUI.Update();
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
Exemplo n.º 4
0
        //************************

        public override void Update(GameTime gameTime, Game1 game)
        {
            bool bHasTarget = SelectionUtility.HasMemberSelected();

            if (!bShowPopUp && !bPaused)
            {
                base.Update(gameTime, game);


                CameraUpdate();
                NormalRunUpdate(gameTime);

                if (bHasTarget)
                {
                    CommandUpdate();
                }

                SelectionUtility.Update(gameTime, activeObjects);
                MainGUI.Update(gameTime);
            }

            if (bShowPopUp && !bPaused)
            {
                ButtonControlPopUp(gameTime);
            }

            if (bPaused && !bShowPopUp)
            {
                SelectionUtility.Update(gameTime, activeObjects);
                MainGUI.Update(gameTime);
                PauseRunUpdate();
                CameraUpdate();

                if (bHasTarget)
                {
                    CommandUpdatePaused();
                }
            }

            if (bPaused && bShowPopUp)
            {
                ButtonControlPopUp(gameTime);
            }

            SceneUtility.xAxis = xAxis;
            SceneUtility.yAxis = yAxis;

            activeSceneObjects.Clear();
            activeSceneObjects.AddRange(shapes);
            activeSceneObjects.AddRange(enemies);
            activeSceneObjects.AddRange(heroes);

            activeSceneShapeCollections.Clear();
            activeSceneShapeCollections.Add(new IdentifiableShapeList("All Characters List", activeObjects));

            activeSceneButtonCollections.Clear();
            activeSceneButtonCollections.Add(new IdentifiableShapeList("Pop-up buttons List", pauseScreen.popUpButtons));

            activeSceneCharactersCollections.Clear();
            activeSceneCharactersCollections.Add(new IdentifiableShapeList("Enemies List", enemies));
            activeSceneCharactersCollections.Add(new IdentifiableShapeList("Heroes List", heroes));
        }