Пример #1
0
        /// <summary>
        /// Set up the appropriate PowerHandler component for a PartModule which polls the underlying PartModule for relevant properties
        /// </summary>
        protected override void SetupDataHandler(PartModule pm)
        {
            if (Settings.IsSupportedPartModule(pm.moduleName, ResourcesSupported.Power))
            {
                HandlerModuleData data = Settings.GetPartModuleData(pm.moduleName, ResourcesSupported.Power);
                if (Settings.DebugMode)
                {
                    Utils.Log(String.Format("[{0}]: Detected supported power handler for {1}: {2}", this.GetType().Name, pm.moduleName, data.handlerModuleName));
                }

                string typeName = this.GetType().AssemblyQualifiedName;
                typeName = typeName.Replace("VesselElectricalData", data.handlerModuleName);
                try
                {
                    ModuleDataHandler handler = (ModuleDataHandler)System.Activator.CreateInstance(Type.GetType(typeName), data);
                    if (handler.Initialize(pm))
                    {
                        handlers.Add(handler);
                    }
                }
                catch (ArgumentNullException)
                {
                    Utils.Log(String.Format("Failed to instantiate {0} (config as {1}) when trying to configure a handler for {2}", typeName, data.handlerModuleName, pm.moduleName));
                }
            }
        }
 public GenericFieldDataHandler(HandlerModuleData moduleData) : base(moduleData)
 {
     editorFieldName   = moduleData.config.editorFieldName;
     flightFieldName   = moduleData.config.flightFieldName;
     editorValueScalar = moduleData.config.editorValueScalar;
     flightValueScalar = moduleData.config.flightValueScalar;
 }
 public ModuleCoreHeatHeatHandler(HandlerModuleData moduleData) : base(moduleData)
 {
     solarEfficiencyEffects = false;
     visible            = true;
     simulated          = true;
     timewarpFunctional = true;
     producer           = true;
     consumer           = false;
 }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="data">The config-loaded data for this module type </param>
        public ModuleDataHandler(HandlerModuleData moduleData)
        {
            data = moduleData;

            solarEfficiencyEffects = moduleData.solarEfficiencyEffects;
            consumer           = moduleData.consumer;
            producer           = moduleData.producer;
            timewarpFunctional = moduleData.continuous;
            simulated          = moduleData.simulated;
            visible            = moduleData.visible;
        }
Пример #5
0
        /// <summary>
        /// Load data from configuration
        /// </summary>
        public static void Load()
        {
            ConfigNode settingsNode;

            Enabled = CheckForConflictingMods();

            Utils.Log("[Settings]: Started loading");
            if (GameDatabase.Instance.ExistsConfigNode("DynamicBatteryStorage/DYNAMICBATTERYSTORAGE"))
            {
                Utils.Log("[Settings]: Located settings file");

                settingsNode = GameDatabase.Instance.GetConfigNode("DynamicBatteryStorage/DYNAMICBATTERYSTORAGE");

                settingsNode.TryGetValue("MinimumWarpFactor", ref TimeWarpLimit);
                settingsNode.TryGetValue("DebugMode", ref DebugMode);
                settingsNode.TryGetValue("DebugSettings", ref DebugMode);
                settingsNode.TryGetValue("DebugUIMode", ref DebugUIMode);
                settingsNode.TryGetValue("DebugLoading", ref DebugLoading);

                settingsNode.TryGetValue("BufferScaling ", ref BufferScaling);
                settingsNode.TryGetValue("UIUpdateInterval ", ref UIUpdateInterval);
                settingsNode.TryGetValue("Enabled", ref Enabled);

                if (Settings.DebugLoading)
                {
                    Utils.Log("[Settings]: Loading handler categories");
                }
                HandlerCategoryData = new Dictionary <string, HandlerCategory>();
                ConfigNode[] categoryNodes = settingsNode.GetNodes("HANDLERCATEGORY");

                foreach (ConfigNode node in categoryNodes)
                {
                    HandlerCategory newCat = new HandlerCategory(node);
                    HandlerCategoryData.Add(newCat.name, newCat);
                }
                if (Settings.DebugLoading)
                {
                    Utils.Log("[Settings]: Loading handler modules");
                }
                HandlerPartModuleData = new List <HandlerModuleData>();
                ConfigNode[] partModuleNodes = settingsNode.GetNodes("PARTMODULEHANDLER");
                foreach (ConfigNode node in partModuleNodes)
                {
                    HandlerModuleData newDat = new HandlerModuleData(node);
                    HandlerPartModuleData.Add(newDat);
                }
            }
            else
            {
                Utils.Log("[Settings]: Couldn't find settings file, using defaults");
            }
            Utils.Log("[Settings]: Finished loading");
        }
Пример #6
0
 public ModuleLightPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #7
0
 public ModuleDataTransmitterPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #8
0
 public FissionReactorHeatHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #9
0
 public ModuleChargeableEnginePowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #10
0
 public ModuleResourceConverterPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #11
0
 public ModuleEnginesFXPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
 public RemoteTechPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #13
0
 public ModuleActiveRadiatorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #14
0
 public ModuleRadioisotopeGeneratorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #15
0
 public KopernicusSolarPanelPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #16
0
 public ModuleDeployableCentrifugePowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #17
0
 public FissionGeneratorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #18
0
 public DischargeCapacitorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #19
0
 public ModuleDeployableSolarPanelPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #20
0
 public ModuleCurvedSolarPanelPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #21
0
 public ModuleGeneratorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #22
0
 public ModuleCryoTankPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #23
0
 public ModuleResourceHarvesterPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #24
0
 public SCANsatPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #25
0
 public ModuleCommandPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
 public ModuleScienceLabPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #27
0
 public ModuleAlternatorPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
 public ModuleScienceConverterPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #29
0
 public FissionFlowRadiatorHeatHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }
Пример #30
0
 public ModuleAntimatterTankPowerHandler(HandlerModuleData moduleData) : base(moduleData)
 {
 }