public override void OnStart(PartModule.StartState state) { 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; throttleCurve = new FloatCurve(); throttleCurve.Add(0, 0, 0, 0); throttleCurve.Add(50, 20, 0, 0); throttleCurve.Add(100, 100, 0, 0); if (UseStagingIcon) { //this.part.stackIcon.CreateIcon(); //this.part.stackIcon.SetIcon(DefaultIcons.FUEL_TANK); } else { Utils.LogWarn("Fission Reactor: Staging Icon Disabled!"); } if (FirstLoad) { this.CurrentSafetyOverride = this.CriticalTemperature; FirstLoad = false; } if (state != StartState.Editor) { core = this.GetComponent <ModuleCoreHeat>(); if (core == null) { Utils.LogError("Fission Reactor: Could not find core heat module!"); } SetupResourceRatios(); // Set up staging icon heat bar if (UseStagingIcon) { infoBox = this.part.stackIcon.DisplayInfo(); } if (OverheatAnimation != "") { overheatStates = Utils.SetUpAnimation(OverheatAnimation, this.part); } if (FollowThrottle) { reactorEngine = this.GetComponent <FissionEngine>(); } if (UseForcedActivation) { this.part.force_activate(); } } else { //this.CurrentSafetyOverride = this.NominalTemperature; } base.OnStart(state); }
public void OverriddenStart() { 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; throttleCurve = new FloatCurve(); throttleCurve.Add(0, 0, 0, 0); throttleCurve.Add(50, 20, 0, 0); throttleCurve.Add(100, 100, 0, 0); Actions["TogglePanelAction"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Action_TogglePanelAction"); Events["ShowReactorControl"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Event_ShowReactorControl"); Events["RepairReactor"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Event_RepairReactor"); Fields["CurrentSafetyOverride"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_CurrentSafetyOverride"); Fields["CurrentPowerPercent"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_CurrentPowerPercent"); Fields["ReactorOutput"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_ReactorOutput"); Fields["ThermalTransfer"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_ThermalTransfer"); Fields["CoreTemp"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_CoreTemp"); Fields["CoreStatus"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_CoreStatus"); Fields["FuelStatus"].guiName = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_FuelStatus"); if (FirstLoad) { this.CurrentSafetyOverride = this.CriticalTemperature; FirstLoad = false; } if (HighLogic.LoadedScene != GameScenes.EDITOR) { core = this.GetComponent <ModuleCoreHeat>(); if (core == null) { Utils.LogError("Fission Reactor: Could not find core heat module!"); } SetupResourceRatios(); if (OverheatAnimation != "") { overheatStates = Utils.SetUpAnimation(OverheatAnimation, this.part); } if (FollowThrottle) { reactorEngine = this.GetComponent <FissionEngine>(); } } else { //this.CurrentSafetyOverride = this.NominalTemperature; } }
public override void OnStart(PartModule.StartState state) { 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; throttleCurve = new FloatCurve(); throttleCurve.Add(0, 0, 0, 0); throttleCurve.Add(50, 20, 0, 0); throttleCurve.Add(100, 100, 0, 0); if (UseStagingIcon) { //this.part.stackIcon.CreateIcon(); //this.part.stackIcon.SetIcon(DefaultIcons.FUEL_TANK); } else Utils.LogWarn("Fission Reactor: Staging Icon Disabled!"); if (FirstLoad) { this.CurrentSafetyOverride = this.CriticalTemperature; FirstLoad = false; } if (state != StartState.Editor) { core = this.GetComponent<ModuleCoreHeat>(); if (core == null) Utils.LogError("Fission Reactor: Could not find core heat module!"); SetupResourceRatios(); // Set up staging icon heat bar if (UseStagingIcon) { infoBox = this.part.stackIcon.DisplayInfo(); } if (OverheatAnimation != "") overheatStates = Utils.SetUpAnimation(OverheatAnimation, this.part); if (FollowThrottle) reactorEngine = this.GetComponent<FissionEngine>(); if (UseForcedActivation) this.part.force_activate(); } else { //this.CurrentSafetyOverride = this.NominalTemperature; } base.OnStart(state); }