public override void OnAwake() { Instance = this; if (userSettings == null) { userSettings = new UserSettings("../settings.cfg"); } if (bodySettings == null) { bodySettings = new BodySettings("../settings_bodies.cfg"); } if (userSettings.FileExists) { userSettings.Load(); } else { userSettings.Save(); } InitDataStore(); // TODO // The bodySettings don't currently work anyway, so commenting this out for now // if (bodySettings.FileExists) // bodySettings.Load(); // else // { // bodySettings.bodyAliases.Add("moho", "Moho"); // bodySettings.bodyAliases.Add("eve", "Eve"); // bodySettings.bodyAliases.Add("gilly", "Gilly"); // bodySettings.bodyAliases.Add("kerbin", "Kerbin"); // bodySettings.bodyAliases.Add("mun", "Mun"); // bodySettings.bodyAliases.Add("minmus", "Minmus"); // bodySettings.bodyAliases.Add("duna", "Duna"); // bodySettings.bodyAliases.Add("ike", "Ike"); // bodySettings.bodyAliases.Add("dres", "Dres"); // bodySettings.bodyAliases.Add("jool", "Jool"); // bodySettings.bodyAliases.Add("laythe", "Laythe"); // bodySettings.bodyAliases.Add("vall", "Vall"); // bodySettings.bodyAliases.Add("tylo", "Tylo"); // bodySettings.bodyAliases.Add("bop", "Bop"); // bodySettings.bodyAliases.Add("pol", "Pol"); // bodySettings.bodyAliases.Add("eeloo", "Eeloo"); // bodySettings.Save(); // } base.OnAwake(); }
public override void OnAwake() { Instance = this; // v1.5.4 moved settings to PluginData but to avoid screwing over existing installs we want to migrate existing settings string pdSettingsFile = System.IO.Path.Combine(_AssemblyFolder, "PluginData/settings.cfg"); string settingsFile = System.IO.Path.Combine(_AssemblyFolder, "../settings.cfg"); string pdDir = System.IO.Path.Combine(_AssemblyFolder, "PluginData"); if (!System.IO.File.Exists(pdSettingsFile) && System.IO.File.Exists(settingsFile)) { userSettings = new UserSettings("../settings.cfg"); userSettings.Load(); System.IO.Directory.CreateDirectory(pdDir); userSettings.Save(pdSettingsFile); System.IO.File.Delete(settingsFile); } if (!System.IO.Directory.Exists(pdDir)) { System.IO.Directory.CreateDirectory(pdDir); } if (userSettings == null) { userSettings = new UserSettings("PluginData/settings.cfg"); } if (userSettings.FileExists) { userSettings.Load(); } else { userSettings.Save(); } InitDataStore(); base.OnAwake(); }
public override void OnAwake() { Instance = this; // v1.5.4 moved settings to PluginData but to avoid screwing over existing installs we want to migrate existing settings string pdSettingsFile = System.IO.Path.Combine(_AssemblyFolder, "PluginData/settings.cfg"); string settingsFile = System.IO.Path.Combine(_AssemblyFolder, "../settings.cfg"); string pdDir = System.IO.Path.Combine(_AssemblyFolder, "PluginData"); if (!System.IO.File.Exists(pdSettingsFile) && System.IO.File.Exists(settingsFile)) { userSettings = new UserSettings("../settings.cfg"); userSettings.Load(); System.IO.Directory.CreateDirectory(pdDir); userSettings.Save(pdSettingsFile); System.IO.File.Delete(settingsFile); } if (!System.IO.Directory.Exists(pdDir)) { System.IO.Directory.CreateDirectory(pdDir); } if (userSettings == null) userSettings = new UserSettings("PluginData/settings.cfg"); if (userSettings.FileExists) userSettings.Load(); else userSettings.Save(); InitDataStore(); base.OnAwake(); }
public override void OnAwake() { Instance = this; if (userSettings == null) { userSettings = new UserSettings("../settings.cfg"); } if (bodySettings == null) { bodySettings = new BodySettings("../settings_bodies.cfg"); } if (userSettings.FileExists) { userSettings.Load(); } else { userSettings.Save(); } if (bodySettings.FileExists) { bodySettings.Load(); } else { bodySettings.bodyAliases.Add("moho", "Moho"); bodySettings.bodyAliases.Add("eve", "Eve"); bodySettings.bodyAliases.Add("gilly", "Gilly"); bodySettings.bodyAliases.Add("kerbin", "Kerbin"); bodySettings.bodyAliases.Add("mun", "Mun"); bodySettings.bodyAliases.Add("minmus", "Minmus"); bodySettings.bodyAliases.Add("duna", "Duna"); bodySettings.bodyAliases.Add("ike", "Ike"); bodySettings.bodyAliases.Add("dres", "Dres"); bodySettings.bodyAliases.Add("jool", "Jool"); bodySettings.bodyAliases.Add("laythe", "Laythe"); bodySettings.bodyAliases.Add("vall", "Vall"); bodySettings.bodyAliases.Add("tylo", "Tylo"); bodySettings.bodyAliases.Add("bop", "Bop"); bodySettings.bodyAliases.Add("pol", "Pol"); bodySettings.bodyAliases.Add("eeloo", "Eeloo"); bodySettings.Save(); } if (partsFlightData == null) { partsFlightData = new List <PartFlightData>(); if (partsPackedStrings != null) { foreach (string packedString in partsPackedStrings) { Log(packedString); PartFlightData data = PartFlightData.FromString(packedString); partsFlightData.Add(data); } } } if (partsPackedStrings == null) { partsPackedStrings = new List <string>(); } base.OnAwake(); }