private void LoadState(ConfigNode configNode) { var s = settings.Deserialize(GetAbsoluteSettingsPath()); if (s != null) { settings = s; } m_Configuration = Configuration.Deserialize(GetAbsoluteConfigurationPath()); if (m_Configuration == null) { m_Configuration = new Configuration(); Configuration.Serialize(GetAbsoluteSettingsPath(), m_Configuration); } m_FlightManager.m_Configuration = m_Configuration; }
private void LoadState(ConfigNode configNode) { KSP.IO.PluginConfiguration pluginConfig = KSP.IO.PluginConfiguration.CreateForType <AdvancedFlyByWire>(); if (pluginConfig != null) { pluginConfig.load(); this.m_UseKSPSkin = pluginConfig.GetValue <bool>("useStockSkin", true); this.m_UseOldPresetsWindow = pluginConfig.GetValue <bool>("useOldPresetEditor", false); this.m_UsePrecisionModeFactor = pluginConfig.GetValue <bool>("usePrecisionModeFactor", false); this.m_PrecisionModeFactor = float.Parse(pluginConfig.GetValue <string>("precisionModeFactor", "0.5")); } m_Configuration = Configuration.Deserialize(GetAbsoluteConfigurationPath()); if (m_Configuration == null) { m_Configuration = new Configuration(); Configuration.Serialize(GetAbsoluteConfigurationPath(), m_Configuration); } m_FlightManager.m_Configuration = m_Configuration; }
private void LoadState(ConfigNode configNode) { if (configNode != null) { if (configNode.HasValue("useStockSkin")) { if (configNode.GetValue("useStockSkin") == "true") { configNode.SetValue("useStockSkin", "true"); } } } m_Configuration = Configuration.Deserialize(m_ConfigurationPath); if (m_Configuration == null) { m_Configuration = new Configuration(); Configuration.Serialize(m_ConfigurationPath, m_Configuration); } m_FlightManager.m_Configuration = m_Configuration; }
public void SaveState(ConfigNode configNode) { settings.Serialize(GetAbsoluteSettingsPath(), settings); Configuration.Serialize(GetAbsoluteConfigurationPath(), m_Configuration); }