protected override void OnUpdate()
        {
            base.OnUpdate();

            if (monolith == null && (HighLogic.LoadedScene == GameScenes.FLIGHT || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
            {
                monolith = ContractVesselTracker.Instance.GetAssociatedVessel("Monolith");
                if (monolith != null)
                {
                    monolith.vesselRanges.orbit.load   = MONOLITH_DRAW_DISTANCE * 1.05f;
                    monolith.vesselRanges.orbit.unload = MONOLITH_DRAW_DISTANCE * 1.1f;

                    // Set monolith name to unknown
                    if (!monolithDiscovered && monolith.vesselName != "???")
                    {
                        monolith.vesselName = "???";
                        GameEvents.onVesselRename.Fire(new GameEvents.HostedFromToAction <Vessel, string>(monolith, "Monolith", "???"));
                    }
                }
            }

            if (HighLogic.LoadedScene == GameScenes.FLIGHT && FlightGlobals.ActiveVessel != null)
            {
                // Set the load distance for the monolith to be much further
                SetLoadDistance();

                // Check our script progress
                ParameterDelegate <MonolithParameter> .CheckChildConditions(this, this);

                if (ChildChanged)
                {
                    ContractConfigurator.ContractConfigurator.OnParameterChange.Fire(Root, this);
                    ChildChanged = false;
                }

                if (currentState == MonolithState.FINISHED)
                {
                    // Reset the state of the progress tree
                    ProgressTracking.Instance.OnLoad(progressTreeBackup);

                    // Complete the parameter
                    SetState(ParameterState.Complete);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Whether this vessel meets the parameter condition.
        /// </summary>
        /// <param name="vessel">Vessel to check</param>
        /// <returns>Whether the vessel meets the parameter condition(s).</returns>
        protected override bool VesselMeetsCondition(Vessel vessel)
        {
            LoggingUtil.LogVerbose(this, "Checking VesselMeetsCondition: " + vessel.id);

            // Get all the antennae
            VesselSatellite        sat      = RTCore.Instance.Satellites[vessel.id];
            IEnumerable <IAntenna> antennas = sat != null ? sat.Antennas : new List <IAntenna>();

            // If we're a VesselParameterGroup child, only do actual state change if we're the tracked vessel
            bool checkOnly = false;

            if (Parent is VesselParameterGroup)
            {
                checkOnly = ((VesselParameterGroup)Parent).TrackedVessel != vessel;
            }

            return(ParameterDelegate <IAntenna> .CheckChildConditions(this, antennas, checkOnly));
        }
        /// <summary>
        /// Whether this vessel meets the parameter condition.
        /// </summary>
        /// <param name="vessel">The vessel to check</param>
        /// <returns>Whether the vessel meets the condition</returns>
        protected override bool VesselMeetsCondition(Vessel vessel)
        {
            LoggingUtil.LogVerbose(this, "Checking VesselMeetsCondition: " + vessel.id);

            return(ParameterDelegate <Vessel> .CheckChildConditions(this, vessel));
        }