Exemple #1
0
        public void Start()
        {
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            Utils.Log("[ModuleSystemHeatSink] Setup completed", LogType.Modules);

            if (HeatLightTransformName != "")
            {
                rampLight = part.FindModelTransform(HeatLightTransformName).GetComponent <Renderer>();
                ramp      = new Gradient();
                GradientColorKey[] keys = new GradientColorKey[]
                {
                    new GradientColorKey(Color.black, 0f),
                    new GradientColorKey(Color.red, 0.33f),
                    new GradientColorKey(Color.yellow, 0.75f),
                    new GradientColorKey(Color.white, 1f)
                };
                GradientAlphaKey[] keysAlpha = new GradientAlphaKey[]
                {
                    new GradientAlphaKey(1f, 0f),
                    new GradientAlphaKey(1f, .33f),
                    new GradientAlphaKey(1f, .66f),
                    new GradientAlphaKey(1f, 1f)
                };
                ramp.SetKeys(keys, keysAlpha);
            }
            if (OnLightTransformName != "")
            {
                onLight = part.FindModelTransform(OnLightTransformName).GetComponent <Renderer>();
            }
            SetupUI();
        }
        public void Start()
        {
            heatModule   = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);
            scalarModule = part.GetComponents <ModuleColorChanger>().ToList().Find(x => x.moduleID == scalarModuleID);
            if (maxTempAnimation == -1f)
            {
                maxTempAnimation = (float)part.maxTemp;
            }

            maxTempAnimation -= draperPoint;
        }
        public override void Start()
        {
            base.Start();
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            if (scalarModuleID != "")
            {
                scalarModule = part.GetComponents <ModuleSystemHeatColorAnimator>().ToList().Find(x => x.moduleID == scalarModuleID);
            }

            if (maxTempAnimation == -1f)
            {
                maxTempAnimation = (float)part.maxTemp;
            }

            maxTempAnimation -= draperPoint;

            Utils.Log("[ModuleSystemHeatRadiator] Setup completed", LogType.Modules);

            if (this.GetComponent <ModuleDeployableRadiator>() != null)
            {
                if (HighLogic.LoadedSceneIsFlight)
                {
                    if (sunTracking)
                    {
                        base._depRad.trackingMode = ModuleDeployablePart.TrackingMode.SUN;
                        base._depRad.isTracking   = true;
                    }
                    else
                    {
                        base._depRad.trackingMode  = ModuleDeployablePart.TrackingMode.NONE;
                        base._depRad.trackingSpeed = 0f;
                        base._depRad.isTracking    = false;
                    }
                }
                else
                {
                    this.Events["ToggleEditorSunTracking"].guiActiveEditor = true;
                }
            }
            else
            {
                if (HighLogic.LoadedSceneIsEditor)
                {
                    this.Events["ToggleEditorSunTracking"].guiActiveEditor = false;
                }
            }
        }
Exemple #4
0
        public void Start()
        {
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            if (converterModuleIndex != -1)
            {
                base.part.partInfo.moduleInfos[converterModuleIndex].info = EditConverterModuleInfo(base.part.partInfo.moduleInfos[converterModuleIndex].info);

                converterModule = base.part.Modules[converterModuleIndex] as BaseConverter;
                if (converterModule == null)
                {
                    Debug.LogError("[ModuleSystemHeatBaseConverterAdapter]: Module at index " + converterModuleIndex +
                                   " is not a BaseConverter on part " + base.part.partName, base.gameObject);
                    return;
                }
            }
        }
        public void Start()
        {
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            if (engineModuleID != "")
            {
                engineModule = this.GetComponents <ModuleEngines>().ToList().Find(x => x.engineID == engineModuleID);
            }

            if (engineModule == null)
            {
                engineModule = this.GetComponent <ModuleEngines>();
            }

            multiModule = this.GetComponent <MultiModeEngine>();

            Utils.Log("[ModuleSystemHeatEngine] Setup completed", LogType.Modules);
        }
        public override void Start()
        {
            base.Start();
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            if (scalarModuleID != "")
            {
                scalarModule = part.GetComponents <ModuleSystemHeatColorAnimator>().ToList().Find(x => x.moduleID == scalarModuleID);
            }

            if (maxTempAnimation == -1f)
            {
                maxTempAnimation = (float)part.maxTemp;
            }

            maxTempAnimation -= draperPoint;

            Utils.Log("[ModuleSystemHeatRadiator] Setup completed", LogType.Modules);
        }
Exemple #7
0
        public void Start()
        {
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);
            if (HighLogic.LoadedSceneIsFlight)
            {
                SetupResourceRatios();
            }
            else
            {
                SetupResourceRatios();
            }
            if (SystemHeatSettings.DebugModules)
            {
                Utils.Log("[ModuleSystemHeatConverter] Setup completed");
            }

            Events["ToggleEditorThermalSim"].guiName = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_SimulateEditor", base.ConverterName);
            Fields["ConverterEfficiency"].guiName    = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency", base.ConverterName);
        }
        public void Start()
        {
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

            if (HighLogic.LoadedSceneIsFlight)
            {
                SetupResourceRatios();
            }
            else
            {
                SetupResourceRatios();

                //this.CurrentSafetyOverride = this.NominalTemperature;
            }

            Utils.Log("[ModuleSystemHeatAsteroidHarvester] Setup completed", LogType.Modules);

            Fields["HarvesterEfficiency"].guiName = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatHarvester_Field_Efficiency", base.ConverterName);
        }
Exemple #9
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);
            if (HighLogic.LoadedSceneIsFlight)
            {
                SetupResourceRatios();
            }
            else
            {
                SetupResourceRatios();

                //this.CurrentSafetyOverride = this.NominalTemperature;
            }
            if (SystemHeatSettings.DebugModules)
            {
                Utils.Log("[ModuleSystemHeatConverter] Setup completed");
            }

            Events["ToggleEditorThermalSim"].guiName = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_SimulateEditor", base.ConverterName);
            Fields["ConverterEfficiency"].guiName    = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency", base.ConverterName);
        }
        public virtual void Start()
        {
            if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
            {
                if (inputs == null || inputs.Count == 0)
                {
                    ConfigNode node = ModuleUtils.GetModuleConfigNode(part, moduleName);
                    if (node != null)
                    {
                        OnLoad(node);
                    }
                }

                heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

                var range = (UI_FloatRange)this.Fields["CurrentSafetyOverride"].uiControlEditor;
                range.minValue = 0f;
                range.maxValue = MaximumTemperature;

                range          = (UI_FloatRange)this.Fields["CurrentSafetyOverride"].uiControlFlight;
                range.minValue = 0f;
                range.maxValue = MaximumTemperature;

                range          = (UI_FloatRange)this.Fields["CurrentReactorThrottle"].uiControlEditor;
                range.minValue = MinimumThrottle;

                range          = (UI_FloatRange)this.Fields["CurrentReactorThrottle"].uiControlFlight;
                range.minValue = MinimumThrottle;


                foreach (BaseField field in this.Fields)
                {
                    if (!string.IsNullOrEmpty(field.group.name))
                    {
                        continue;
                    }

                    if (field.group.name == uiGroupName)
                    {
                        field.group.displayName = Localizer.Format(uiGroupDisplayName);
                    }
                }

                foreach (BaseEvent baseEvent in this.Events)
                {
                    if (!string.IsNullOrEmpty(baseEvent.group.name))
                    {
                        continue;
                    }

                    if (baseEvent.group.name == uiGroupName)
                    {
                        baseEvent.group.displayName = Localizer.Format(uiGroupDisplayName);
                    }
                }

                if (!GeneratesElectricity)
                {
                    if (Efficiency == -1f)
                    {
                        Efficiency = 0f;
                    }
                    Fields["GeneratorStatus"].guiActive = false;
                }
                else
                {
                    if (Efficiency == -1f)
                    {
                        Efficiency = ElectricalGeneration.Evaluate(100f) / HeatGeneration.Evaluate(100f);
                    }
                }

                if (FirstLoad)
                {
                    if (HighLogic.LoadedSceneIsFlight)
                    {
                        CurrentThrottle            = 0f;
                        CurrentReactorThrottle     = 0f;
                        InternalCoreTemperature    = 0f;
                        this.CurrentSafetyOverride = this.CriticalTemperature;
                        FirstLoad = false;
                    }
                }
            }
            if (HighLogic.LoadedSceneIsEditor)
            {
                Fields["CurrentSafetyOverride"].guiActiveEditor = allowManualShutdownTemperatureControl;
                Fields["CurrentReactorThrottle"].guiActive      = true;
                CurrentReactorThrottle = 100f;
            }

            if (HighLogic.LoadedSceneIsFlight)
            {
                DoCatchup();
                SetManualControl(ManualControl);
            }
        }
Exemple #11
0
        public virtual void Start()
        {
            if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
            {
                if (inputs == null || inputs.Count == 0)
                {
                    ConfigNode node = ModuleUtils.GetModuleConfigNode(part, moduleName);
                    if (node != null)
                    {
                        OnLoad(node);
                    }
                }

                heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID);

                var range = (UI_FloatRange)this.Fields["CurrentSafetyOverride"].uiControlEditor;
                range.minValue = 0f;
                range.maxValue = MaximumTemperature;

                range          = (UI_FloatRange)this.Fields["CurrentSafetyOverride"].uiControlFlight;
                range.minValue = 0f;
                range.maxValue = MaximumTemperature;

                foreach (BaseField field in this.Fields)
                {
                    if (!string.IsNullOrEmpty(field.group.name))
                    {
                        continue;
                    }

                    if (field.group.name == uiGroupName)
                    {
                        field.group.displayName = Localizer.Format(uiGroupDisplayName);
                    }
                }

                foreach (BaseEvent baseEvent in this.Events)
                {
                    if (!string.IsNullOrEmpty(baseEvent.group.name))
                    {
                        continue;
                    }

                    if (baseEvent.group.name == uiGroupName)
                    {
                        baseEvent.group.displayName = Localizer.Format(uiGroupDisplayName);
                    }
                }

                if (!GeneratesElectricity)
                {
                    Fields["GeneratorStatus"].guiActive = false;
                }
                //Actions["TogglePanelAction"].guiName = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatFissionReactor_Action_TogglePanelAction");
                if (FirstLoad)
                {
                    this.CurrentSafetyOverride = this.CriticalTemperature;
                    FirstLoad = false;
                }
            }


            if (HighLogic.LoadedSceneIsFlight)
            {
                DoCatchup();
                SetManualControl(ManualControl);
            }
        }