Пример #1
0
        public void Start()
        {
            heatModule = this.GetComponents <ModuleSystemHeat>().ToList().Find(x => x.moduleID == systemHeatModuleID);
            if (heatModule == null)
            {
                heatModule.GetComponent <ModuleSystemHeat>();
            }

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

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

            multiModule = this.GetComponent <MultiModeEngine>();

            if (SystemHeatSettings.DebugModules)
            {
                Utils.Log("[ModuleSystemHeatEngine] Setup completed");
            }
        }
Пример #2
0
        public void Start()
        {
            heatModule = this.GetComponents <ModuleSystemHeat>().ToList().Find(x => x.moduleID == systemHeatModuleID);
            if (heatModule == null)
            {
                heatModule.GetComponent <ModuleSystemHeat>();
            }

            Utils.Log("[ModuleSystemHeatTemperatureAdjuster] Setup completed", LogType.Modules);
        }
        public void Start()
        {
            heatModule = this.GetComponents <ModuleSystemHeat>().ToList().Find(x => x.moduleID == systemHeatModuleID);
            if (heatModule == null)
            {
                heatModule.GetComponent <ModuleSystemHeat>();
            }

            if (SystemHeatSettings.DebugModules)
            {
                Utils.Log("[ModuleSystemHeatSink] Setup completed");
            }
        }
    public void Start()
    {
      heatModule = this.GetComponents<ModuleSystemHeat>().ToList().Find(x => x.moduleID == systemHeatModuleID);
      if (heatModule == null)
        heatModule.GetComponent<ModuleSystemHeat>();

      if (SystemHeatSettings.DebugModules)
      {
        Utils.Log("[ModuleSystemHeatSink] Setup completed");
      }

      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();
    }
Пример #5
0
        public virtual void Start()
        {
            if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
            {
                if (inputs == null || inputs.Count == 0)
                {
                    ConfigNode node = GameDatabase.Instance.GetConfigs("PART").
                                      Single(c => part.partInfo.name == c.name).config.
                                      GetNodes("MODULE").Single(n => n.GetValue("name") == moduleName);
                    OnLoad(node);
                }

                heatModule = this.GetComponents <ModuleSystemHeat>().ToList().Find(x => x.moduleID == systemHeatModuleID);
                if (heatModule == null)
                {
                    heatModule.GetComponent <ModuleSystemHeat>();
                }

                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)
            {
                GameEvents.OnVesselRollout.Add(new EventData <ShipConstruct> .OnEvent(OnVesselRollout));
                DoCatchup();
                SetManualControl(ManualControl);
            }
        }