From 4b4bd23895207518baa7ebad7a7c967525b0e8f6 Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Wed, 18 May 2016 12:16:44 -0400 Subject: [PATCH 1/6] Update version to 0.6.1-alpha --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5706180..dba21b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## v0.6.1-alpha + ## v0.6.0 ##### Added - Added core temperature as a new metric for applicable parts. From 8918440986987ff7119c79d47049960e5a274d13 Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Wed, 18 May 2016 12:21:16 -0400 Subject: [PATCH 2/6] Fix appveyor changelog build --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c34a05d..4ba27ec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ after_build: $env:BUILD_VERSION = (cat .build/meta/VERSION) $env:BUILD_PRERELEASE = (cat .build/meta/PRERELEASE) $changeLog = (cat .build/meta/CHANGELOG) - if ($chaneLog -eq $null) { + if ($changeLog -eq $null) { $env:BUILD_CHANGELOG = "" } else { $env:BUILD_CHANGELOG = [System.String]::Join("\n", $changeLog) From 0da81fccbe76cf64198f95824de60cd7d48dfc8b Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Wed, 18 May 2016 19:25:53 -0400 Subject: [PATCH 3/6] HotSpot 0.6.0 has only been tested with KSP 1.1.2 --- HotSpot.netkan | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/HotSpot.netkan b/HotSpot.netkan index 479e799..0a1dfdc 100644 --- a/HotSpot.netkan +++ b/HotSpot.netkan @@ -66,6 +66,17 @@ { "name": "Toolbar" } ] } + }, + { + "version": ">=0.6.0", + "override": { + "ksp_version_min": "1.1.2", + "ksp_version_max": "1.1.2", + "supports": [ + { "name": "KIS" }, + { "name": "Toolbar" } + ] + } } ] } From bf7443bf5f76b682cbd47aa368c197a63a154372 Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Sat, 28 May 2016 22:46:58 -0400 Subject: [PATCH 4/6] Store dynamic settings in PluginData subdirectory (#71) Fixes #70 --- CHANGELOG.md | 7 +- HotSpot.sln.DotSettings | 2 + src/HotSpot/Config.cs | 125 ++++++++++++------ .../Configuration/ContextMenu/MetricNode.cs | 17 ++- src/HotSpot/Configuration/ContextMenuNode.cs | 17 +-- src/HotSpot/Configuration/DiagnosticsNode.cs | 3 - .../Configuration/Gui/AppLauncherNode.cs | 1 - .../Configuration/Gui/ContextMenuNode.cs | 1 - src/HotSpot/Configuration/Gui/ToolbarNode.cs | 1 - src/HotSpot/Configuration/GuiNode.cs | 4 - .../Configuration/Overlay/GradientNode.cs | 2 +- .../Configuration/Overlay/MetricNode.cs | 7 +- .../Configuration/Overlay/SchemeNode.cs | 2 +- src/HotSpot/Configuration/Overlay/StopNode.cs | 4 +- src/HotSpot/Configuration/OverlayNode.cs | 16 +-- src/HotSpot/FileSystem.cs | 53 ++++++++ src/HotSpot/HotSpot.csproj | 1 + 17 files changed, 171 insertions(+), 92 deletions(-) create mode 100644 src/HotSpot/FileSystem.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index dba21b7..560fff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## v0.6.1-alpha +## v0.7.0-alpha +##### Changed +- *Incompatible:* "Dynamic" settings (anything changeable in the GUI) are now stored in + `HotSpot/PluginData/HotSpot.cfg` instead of `HotSpot/Configuration/HotSpotPlayer.cfg` and override any values in + "static" settings (anything loaded via the `GameDatabase`). This allows ModuleManager to ignore these settings for + caching purposes. ## v0.6.0 ##### Added diff --git a/HotSpot.sln.DotSettings b/HotSpot.sln.DotSettings index fcd2992..2a90f9b 100644 --- a/HotSpot.sln.DotSettings +++ b/HotSpot.sln.DotSettings @@ -1,8 +1,10 @@  + DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW + DO_NOT_SHOW DO_NOT_SHOW HINT DO_NOT_SHOW diff --git a/src/HotSpot/Config.cs b/src/HotSpot/Config.cs index ac85355..a38875c 100644 --- a/src/HotSpot/Config.cs +++ b/src/HotSpot/Config.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Linq; -using System.Text; using HotSpot.Configuration; namespace HotSpot @@ -23,15 +22,22 @@ public static Config Instance { if (_instance == null) { - - var node = GameDatabase - .Instance - .GetConfigNodes("HOT_SPOT") - .SingleOrDefault(); + Config staticConfig = null; + Config dynamicConfig = null; - _instance = TryParse(node) ?? new Config(); + var staticConfigNode = GetStaticConfigNode(); + if (staticConfigNode != null) + staticConfig = TryParse(staticConfigNode); - OnInitialLoad(node); + var dynamicConfigNode = GetDynamicConfigNode(); + if (dynamicConfigNode != null) + dynamicConfig = TryParse(dynamicConfigNode); + + var defaultConfig = new Config(); + + _instance = Merge(dynamicConfig ?? defaultConfig, staticConfig ?? defaultConfig); + + OnInitialLoad(staticConfigNode, dynamicConfigNode); } } } @@ -40,13 +46,18 @@ public static Config Instance } } - private static void OnInitialLoad(ConfigNode node) + private static void OnInitialLoad(ConfigNode staticNode, ConfigNode dynamicNode) { Log.Level = Instance.Diagnostics.LogLevel; - Log.Debug(node != null ? - $"Exploded Configuration:{Environment.NewLine}{node}" : - "No configuration found." + Log.Debug(staticNode != null ? + $"Static Configuration:{Environment.NewLine}{staticNode}" : + "No static configuration found." + ); + + Log.Debug(staticNode != null ? + $"Dynamic Configuration:{Environment.NewLine}{dynamicNode}" : + "No dynamic configuration found." ); GameEvents.onGameSceneSwitchRequested.Add(e => Instance.Save()); @@ -77,39 +88,19 @@ private Config(GuiNode gui, ContextMenuNode contextMenu, OverlayNode overlay, Di public void Save() { - // It appears the top-most node cannot use an edit-or-create operation (%) so use an edit operation (@) - var node = new ConfigNode("@HOT_SPOT:AFTER[HotSpot]"); + var node = new ConfigNode("HOT_SPOT"); - var guiNode = new ConfigNode("%GUI"); - var contextMenuNode = new ConfigNode("%CONTEXT_MENU"); - var overlayNode = new ConfigNode("%OVERLAY"); - var diagnosticsNode = new ConfigNode("%DIAGNOSTICS"); + var contextMenuNode = new ConfigNode("CONTEXT_MENU"); + var overlayNode = new ConfigNode("OVERLAY"); - if (Gui.Save(guiNode)) - { - node.AddNode(guiNode); - } + ContextMenu.Save(contextMenuNode); + node.AddNode(contextMenuNode); - if (ContextMenu.Save(contextMenuNode)) - { - node.AddNode(contextMenuNode); - } + Overlay.Save(overlayNode); + node.AddNode(overlayNode); - if (Overlay.Save(overlayNode)) - { - node.AddNode(overlayNode); - } - - if (Diagnostics.Save(diagnosticsNode)) - { - node.AddNode(diagnosticsNode); - } - - File.WriteAllText( - $"{KSPUtil.ApplicationRootPath}/GameData/HotSpot/Configuration/HotSpotPlayer.cfg", - node.ToString(), - new UTF8Encoding(encoderShouldEmitUTF8Identifier: false) - ); + FileSystem.WriteDynamicConfiguration(node); + FileSystem.EnsureLegacyPlayerConfigFileDoesNotExist(); } public static Config TryParse(ConfigNode node) @@ -131,8 +122,58 @@ public static Config TryParse(ConfigNode node) return new Config(gui, contextMenu, overlay, diagnostics); } - Log.Warning("Could not parse missing HOT_SPOT node"); + Log.Debug("Could not parse missing HOT_SPOT node"); + return null; + } + + public static ConfigNode GetStaticConfigNode() + { + return GameDatabase.Instance.GetConfigNodes("HOT_SPOT").SingleOrDefault(); + } + + public static ConfigNode GetDynamicConfigNode() + { + if (File.Exists(FileSystem.DynamicConfigFilePath)) + { + var hotSpotNode = ConfigNode.Load(FileSystem.DynamicConfigFilePath).GetNode("HOT_SPOT"); + if (hotSpotNode != null) + return hotSpotNode; + } + return null; } + + public static Config Merge(Config source, Config target) + { + // CONTEXT_MENU + + var targetContextMenuMetrics = target.ContextMenu.Metrics.ToDictionary(i => i.Name.Name); + foreach (var sourceMetric in source.ContextMenu.Metrics) + { + Configuration.ContextMenu.MetricNode targetMetric; + if (targetContextMenuMetrics.TryGetValue(sourceMetric.Name.Name, out targetMetric)) + { + targetMetric.Enable = sourceMetric.Enable; + targetMetric.Prefix = sourceMetric.Prefix; + targetMetric.Unit = sourceMetric.Unit; + } + } + + // OVERLAY + + target.Overlay.Metric = source.Overlay.Metric; + + var targetOverlayMetrics = target.Overlay.Metrics.ToDictionary(i => i.Name.Name); + foreach (var sourceMetric in source.Overlay.Metrics) + { + Configuration.Overlay.MetricNode targetMetric; + if (targetOverlayMetrics.TryGetValue(sourceMetric.Name.Name, out targetMetric)) + { + targetMetric.Scheme = sourceMetric.Scheme; + } + } + + return target; + } } } diff --git a/src/HotSpot/Configuration/ContextMenu/MetricNode.cs b/src/HotSpot/Configuration/ContextMenu/MetricNode.cs index 89ba8d6..d5144a7 100644 --- a/src/HotSpot/Configuration/ContextMenu/MetricNode.cs +++ b/src/HotSpot/Configuration/ContextMenu/MetricNode.cs @@ -14,21 +14,20 @@ private MetricNode(Metric name, bool enable, Unit unit, Prefix? prefix) { Name = name; Enable = enable; - // TODO: Legacy : Remove Kilowatt + // TODO: LEGACY: Remove Kilowatt Unit = unit == Unit.Kilowatt ? Unit.Watt : unit; Prefix = prefix; } - public bool Save(ConfigNode node) + public void Save(ConfigNode node) { - node.AddValue("%enable", Enable); - node.AddValue("%unit", Unit); + node.AddValue("name", Name.Name); + node.AddValue("enable", Enable); + node.AddValue("unit", Unit); if (Prefix != null) - node.AddValue("%prefix", Prefix.Value); + node.AddValue("prefix", Prefix.Value); else - node.AddValue("%prefix", "auto"); - - return true; + node.AddValue("prefix", "auto"); } public static MetricNode TryParse(ConfigNode node) @@ -52,7 +51,7 @@ public static MetricNode TryParse(ConfigNode node) } } - Log.Warning($"Could not parse config node:{Environment.NewLine}{node}"); + Log.Debug($"Could not parse config node:{Environment.NewLine}{node}"); return null; } } diff --git a/src/HotSpot/Configuration/ContextMenuNode.cs b/src/HotSpot/Configuration/ContextMenuNode.cs index b4a3eb4..5b7ab44 100644 --- a/src/HotSpot/Configuration/ContextMenuNode.cs +++ b/src/HotSpot/Configuration/ContextMenuNode.cs @@ -22,22 +22,16 @@ public MetricNode GetMetric(Metric metric) return _metricsDictionary[metric.Name]; } - public bool Save(ConfigNode node) + public void Save(ConfigNode node) { - var save = false; - foreach (var metric in Metrics) { - var metricNode = new ConfigNode($"%METRIC[{metric.Name.Name}]"); + var metricNode = new ConfigNode("METRIC"); - if (metric.Save(metricNode)) - { - node.AddNode(metricNode); - save = true; - } - } + metric.Save(metricNode); - return save; + node.AddNode(metricNode); + } } public static ContextMenuNode GetDefault() @@ -59,7 +53,6 @@ public static ContextMenuNode TryParse(ConfigNode node) return new ContextMenuNode(metrics); } - Log.Warning("Could not parse missing CONTEXT_MENU node"); return null; } } diff --git a/src/HotSpot/Configuration/DiagnosticsNode.cs b/src/HotSpot/Configuration/DiagnosticsNode.cs index f869e29..370e8d0 100644 --- a/src/HotSpot/Configuration/DiagnosticsNode.cs +++ b/src/HotSpot/Configuration/DiagnosticsNode.cs @@ -14,8 +14,6 @@ public static DiagnosticsNode GetDefault() return new DiagnosticsNode(LogLevel.Info); } - public bool Save(ConfigNode node) => false; - public static DiagnosticsNode TryParse(ConfigNode node) { if (node != null) @@ -25,7 +23,6 @@ public static DiagnosticsNode TryParse(ConfigNode node) return new DiagnosticsNode(logLevel); } - Log.Warning("Could not parse missing DIAGNOSTICS node"); return null; } } diff --git a/src/HotSpot/Configuration/Gui/AppLauncherNode.cs b/src/HotSpot/Configuration/Gui/AppLauncherNode.cs index fd1a6ea..c362f13 100644 --- a/src/HotSpot/Configuration/Gui/AppLauncherNode.cs +++ b/src/HotSpot/Configuration/Gui/AppLauncherNode.cs @@ -27,7 +27,6 @@ public static AppLauncherNode TryParse(ConfigNode node) return new AppLauncherNode(enable, texture); } - Log.Warning("Could not parse missing APPLAUNCHER node"); return null; } } diff --git a/src/HotSpot/Configuration/Gui/ContextMenuNode.cs b/src/HotSpot/Configuration/Gui/ContextMenuNode.cs index b53270f..dd8ae27 100644 --- a/src/HotSpot/Configuration/Gui/ContextMenuNode.cs +++ b/src/HotSpot/Configuration/Gui/ContextMenuNode.cs @@ -24,7 +24,6 @@ public static ContextMenuNode TryParse(ConfigNode node) return new ContextMenuNode(disableStockCoreTemp); } - Log.Warning("Could not parse missing CONTEXT_MENU node"); return null; } } diff --git a/src/HotSpot/Configuration/Gui/ToolbarNode.cs b/src/HotSpot/Configuration/Gui/ToolbarNode.cs index ca97a47..40fe343 100644 --- a/src/HotSpot/Configuration/Gui/ToolbarNode.cs +++ b/src/HotSpot/Configuration/Gui/ToolbarNode.cs @@ -27,7 +27,6 @@ public static ToolbarNode TryParse(ConfigNode node) return new ToolbarNode(enable, texture); } - Log.Warning("Could not parse missing TOOLBAR node"); return null; } } diff --git a/src/HotSpot/Configuration/GuiNode.cs b/src/HotSpot/Configuration/GuiNode.cs index 999bb61..26a526e 100644 --- a/src/HotSpot/Configuration/GuiNode.cs +++ b/src/HotSpot/Configuration/GuiNode.cs @@ -15,9 +15,6 @@ private GuiNode(AppLauncherNode appLauncher, ToolbarNode toolbar, Gui.ContextMen ContextMenu = contextMenu; } - public bool Save(ConfigNode node) - => false; - public static GuiNode GetDefault() => new GuiNode(AppLauncherNode.GetDefault(), ToolbarNode.GetDefault(), Gui.ContextMenuNode.GetDefault()); @@ -35,7 +32,6 @@ public static GuiNode TryParse(ConfigNode node) return new GuiNode(appLauncher, toolbar, contextMenu); } - Log.Warning("Could not parse missing GUI node"); return null; } } diff --git a/src/HotSpot/Configuration/Overlay/GradientNode.cs b/src/HotSpot/Configuration/Overlay/GradientNode.cs index 06da4e0..29707d1 100644 --- a/src/HotSpot/Configuration/Overlay/GradientNode.cs +++ b/src/HotSpot/Configuration/Overlay/GradientNode.cs @@ -48,7 +48,7 @@ public static GradientNode TryParse(ConfigNode node) } } - Log.Warning($"Could not parse config node:{Environment.NewLine}{node}"); + Log.Debug($"Could not parse config node:{Environment.NewLine}{node}"); return null; } } diff --git a/src/HotSpot/Configuration/Overlay/MetricNode.cs b/src/HotSpot/Configuration/Overlay/MetricNode.cs index 2f26bd4..fc280fd 100644 --- a/src/HotSpot/Configuration/Overlay/MetricNode.cs +++ b/src/HotSpot/Configuration/Overlay/MetricNode.cs @@ -26,11 +26,10 @@ public SchemeNode GetActiveScheme() return _schemesDictionary[Scheme]; } - public bool Save(ConfigNode node) + public void Save(ConfigNode node) { - node.AddValue("%scheme", Scheme); - - return true; + node.AddValue("name", Name.Name); + node.AddValue("scheme", Scheme); } public static MetricNode TryParse(ConfigNode node) diff --git a/src/HotSpot/Configuration/Overlay/SchemeNode.cs b/src/HotSpot/Configuration/Overlay/SchemeNode.cs index 22f7fbc..5c631bb 100644 --- a/src/HotSpot/Configuration/Overlay/SchemeNode.cs +++ b/src/HotSpot/Configuration/Overlay/SchemeNode.cs @@ -48,7 +48,7 @@ public static SchemeNode TryParse(ConfigNode node) } } - Log.Warning($"Could not parse config node:{Environment.NewLine}{node}"); + Log.Debug($"Could not parse config node:{Environment.NewLine}{node}"); return null; } } diff --git a/src/HotSpot/Configuration/Overlay/StopNode.cs b/src/HotSpot/Configuration/Overlay/StopNode.cs index a54cd0b..e13f652 100644 --- a/src/HotSpot/Configuration/Overlay/StopNode.cs +++ b/src/HotSpot/Configuration/Overlay/StopNode.cs @@ -48,7 +48,7 @@ public static StopNode TryParse(ConfigNode node) } } - Log.Warning($"Could not parse config node:{Environment.NewLine}{node}"); + Log.Debug($"Could not parse config node:{Environment.NewLine}{node}"); return null; } @@ -63,7 +63,7 @@ public static StopNode TryParse(ConfigNode node) return TryConvertColor(match.Groups["color"].Value); } - Log.Warning($"Could not parse `color` property: {str}"); + Log.Debug($"Could not parse `color` property: {str}"); return null; } diff --git a/src/HotSpot/Configuration/OverlayNode.cs b/src/HotSpot/Configuration/OverlayNode.cs index b7534f9..d1f137a 100644 --- a/src/HotSpot/Configuration/OverlayNode.cs +++ b/src/HotSpot/Configuration/OverlayNode.cs @@ -29,21 +29,17 @@ public MetricNode GetActiveMetric() return _metricsDictionary[Metric.Name]; } - public bool Save(ConfigNode node) + public void Save(ConfigNode node) { - node.AddValue("%metric", Metric.Name); + node.AddValue("metric", Metric.Name); foreach (var metric in Metrics) { - var metricNode = new ConfigNode($"%METRIC[{metric.Name.Name}]"); + var metricNode = new ConfigNode("METRIC"); - if (metric.Save(metricNode)) - { - node.AddNode(metricNode); - } + metric.Save(metricNode); + node.AddNode(metricNode); } - - return true; } public static OverlayNode GetDefault() @@ -71,7 +67,7 @@ public static OverlayNode TryParse(ConfigNode node) } } - Log.Warning($"Could not parse config node:{Environment.NewLine}{node}"); + Log.Debug($"Could not parse config node:{Environment.NewLine}{node}"); return null; } } diff --git a/src/HotSpot/FileSystem.cs b/src/HotSpot/FileSystem.cs new file mode 100644 index 0000000..8962b7e --- /dev/null +++ b/src/HotSpot/FileSystem.cs @@ -0,0 +1,53 @@ +using System; +using System.IO; +using System.Reflection; + +namespace HotSpot +{ + internal static class FileSystem + { + private static string _modDirectoryPath; + private static string _pluginDataDirectoryPath; + private static string _dynamicConfigFilePath; + + public static string ModDirectoryPath + { + get + { + if (_modDirectoryPath == null) + { + _modDirectoryPath = + Directory.GetParent(Assembly.GetExecutingAssembly().Location)?.Parent?.FullName; + + if (_modDirectoryPath == null) + throw new Exception("Unable to find HotSpot root directory."); + } + + return _modDirectoryPath; + } + } + + public static string PluginDataDirectoryPath => + _pluginDataDirectoryPath ?? (_pluginDataDirectoryPath = Path.Combine(ModDirectoryPath, "PluginData")); + + public static string DynamicConfigFilePath => + _dynamicConfigFilePath ?? (_dynamicConfigFilePath = Path.Combine(PluginDataDirectoryPath, "HotSpot.cfg")); + + public static void WriteDynamicConfiguration(ConfigNode config) + { + if (!Directory.Exists(PluginDataDirectoryPath)) + Directory.CreateDirectory(PluginDataDirectoryPath); + + File.WriteAllText(DynamicConfigFilePath, config.ToString()); + } + + // TODO: LEGACY: Remove + public static void EnsureLegacyPlayerConfigFileDoesNotExist() + { + var legacyDynamicFilePath = Path.Combine(ModDirectoryPath, "Configuration/HotSpotPlayer.cfg"); + + if (File.Exists(legacyDynamicFilePath)) + File.Delete(legacyDynamicFilePath); + } + } +} diff --git a/src/HotSpot/HotSpot.csproj b/src/HotSpot/HotSpot.csproj index 9c63e9c..d0115a2 100644 --- a/src/HotSpot/HotSpot.csproj +++ b/src/HotSpot/HotSpot.csproj @@ -72,6 +72,7 @@ + From d7964d8f8ee5598a56082725fbd9634b31c69049 Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Sun, 29 May 2016 09:08:39 -0400 Subject: [PATCH 5/6] Move array to static (#72) --- src/HotSpot/HotSpotGuiBehavior.cs | 59 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/HotSpot/HotSpotGuiBehavior.cs b/src/HotSpot/HotSpotGuiBehavior.cs index 0c6cc9d..ca5253b 100644 --- a/src/HotSpot/HotSpotGuiBehavior.cs +++ b/src/HotSpot/HotSpotGuiBehavior.cs @@ -18,6 +18,31 @@ public sealed class HotSpotGuiBehavior : MonoBehaviour private readonly ScreenMessage _screenMessage = new ScreenMessage(string.Empty, 4, ScreenMessageStyle.LOWER_CENTER); + private readonly string[] _prefixStrings = { + "Auto", + Prefix.None.ToString(), + Prefix.Yocto.ToString(), + Prefix.Zepto.ToString(), + Prefix.Atto.ToString(), + Prefix.Femto.ToString(), + Prefix.Pico.ToString(), + Prefix.Nano.ToString(), + Prefix.Micro.ToString(), + Prefix.Milli.ToString(), + Prefix.Centi.ToString(), + Prefix.Deci.ToString(), + Prefix.Deca.ToString(), + Prefix.Hecto.ToString(), + Prefix.Kilo.ToString(), + Prefix.Mega.ToString(), + Prefix.Giga.ToString(), + Prefix.Tera.ToString(), + Prefix.Peta.ToString(), + Prefix.Exa.ToString(), + Prefix.Zetta.ToString(), + Prefix.Yotta.ToString() + }; + private bool _lastThermalColorsDebug; private ApplicationLauncherButton _applicationLauncherButton; private IButton _toolbarButton; @@ -329,45 +354,19 @@ private void OnContextTab() { GUILayout.BeginVertical(); - var prefixes = new[] - { - "Auto", - Prefix.None.ToString(), - Prefix.Yocto.ToString(), - Prefix.Zepto.ToString(), - Prefix.Atto.ToString(), - Prefix.Femto.ToString(), - Prefix.Pico.ToString(), - Prefix.Nano.ToString(), - Prefix.Micro.ToString(), - Prefix.Milli.ToString(), - Prefix.Centi.ToString(), - Prefix.Deci.ToString(), - Prefix.Deca.ToString(), - Prefix.Hecto.ToString(), - Prefix.Kilo.ToString(), - Prefix.Mega.ToString(), - Prefix.Giga.ToString(), - Prefix.Tera.ToString(), - Prefix.Peta.ToString(), - Prefix.Exa.ToString(), - Prefix.Zetta.ToString(), - Prefix.Yotta.ToString() - }; - var unitIndex = 0; - for (var i = 0; i < prefixes.Length; i++) + for (var i = 0; i < _prefixStrings.Length; i++) { - if (prefixes[i] == (metricNode.Prefix?.ToString() ?? "Auto")) + if (_prefixStrings[i] == (metricNode.Prefix?.ToString() ?? "Auto")) { unitIndex = i; break; } } - var newUnitIndex = GUILayout.SelectionGrid(unitIndex, prefixes, 2); + var newUnitIndex = GUILayout.SelectionGrid(unitIndex, _prefixStrings, 2); - var selectedPrefixString = prefixes[newUnitIndex]; + var selectedPrefixString = _prefixStrings[newUnitIndex]; metricNode.Prefix = selectedPrefixString == "Auto" ? null : (Prefix?)Enum.Parse(typeof(Prefix), selectedPrefixString); From 4d7849cd7384e391e72b20128d7285456a670446 Mon Sep 17 00:00:00 2001 From: Dwayne Bent Date: Sun, 29 May 2016 09:14:12 -0400 Subject: [PATCH 6/6] Update version to 0.7.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 560fff3..ffeb2da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v0.7.0-alpha +## v0.7.0 ##### Changed - *Incompatible:* "Dynamic" settings (anything changeable in the GUI) are now stored in `HotSpot/PluginData/HotSpot.cfg` instead of `HotSpot/Configuration/HotSpotPlayer.cfg` and override any values in