diff --git a/.gitignore b/.gitignore index ae32bcc..6065efd 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,6 @@ $RECYCLE.BIN/ # Mac crap .DS_Store + +# Other *.svg diff --git a/GameData/LTech/Changelog.txt b/GameData/LTech/Changelog.txt index e630967..459cf53 100644 --- a/GameData/LTech/Changelog.txt +++ b/GameData/LTech/Changelog.txt @@ -1,3 +1,11 @@ +v4.4 - 11 Apr 2017 +------------------ +* Performance updates +* Removed unnecessary saving +* Settings icon wasn't correctly updated in flight scene +* Updated ToolbarWrapper (again) +* Switched tech level of cameras with each other + v4.3 - 15 Dec 2016 ------------------ * Fixed windows not always closing on scene changes @@ -9,6 +17,7 @@ v4.2 - 26 Oct 2016 v4.1 - 12 Oct 2016 ------------------ * Updated for KSP 1.2 +* Performance updates * Added abbreviation and hsp to resources * Fixed TweakScale for airbrake * Fixed loading RPM modules when not installed diff --git a/GameData/LTech/LTech.version b/GameData/LTech/LTech.version index 82f70ab..e43cce6 100644 --- a/GameData/LTech/LTech.version +++ b/GameData/LTech/LTech.version @@ -12,7 +12,7 @@ { "MAJOR":0, "MINOR":4, - "PATCH":3, + "PATCH":4, "BUILD":0 }, "KSP_VERSION": diff --git a/GameData/LTech/Parts/Science/ExtCamera/ExtCam1.cfg b/GameData/LTech/Parts/Science/ExtCamera/ExtCam1.cfg index 96da028..a9df4f0 100644 --- a/GameData/LTech/Parts/Science/ExtCamera/ExtCam1.cfg +++ b/GameData/LTech/Parts/Science/ExtCamera/ExtCam1.cfg @@ -12,9 +12,9 @@ PART node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0 - TechRequired = scienceTech + TechRequired = electrics entryCost = 1000 - cost = 500 + cost = 1500 category = Science subcategory = 0 title = Kerb-I External Camera diff --git a/GameData/LTech/Parts/Science/ExtCamera/ExtCam2.cfg b/GameData/LTech/Parts/Science/ExtCamera/ExtCam2.cfg index 64f3ce5..750b8d5 100644 --- a/GameData/LTech/Parts/Science/ExtCamera/ExtCam2.cfg +++ b/GameData/LTech/Parts/Science/ExtCamera/ExtCam2.cfg @@ -12,9 +12,9 @@ PART node_attach = 0.0, 0.0, 0.0, 0.0, -2.0, 0.0 - TechRequired = electrics + TechRequired = scienceTech entryCost = 1000 - cost = 1500 + cost = 500 category = Science subcategory = 0 title = I-C External Camera diff --git a/GameData/LTech/Plugins/LtScience.dll b/GameData/LTech/Plugins/LtScience.dll index bf90d3b..527ec57 100644 Binary files a/GameData/LTech/Plugins/LtScience.dll and b/GameData/LTech/Plugins/LtScience.dll differ diff --git a/LTechContinued.netkan b/LTechContinued.netkan index 5c5c821..51e13f5 100644 --- a/LTechContinued.netkan +++ b/LTechContinued.netkan @@ -23,7 +23,7 @@ ], "depends" : [ - { "name" : "ModuleManager", "min_version" : "2.7.0" } + { "name" : "ModuleManager", "min_version" : "2.7.5" } ], "suggests" : [ diff --git a/README.md b/README.md index 3e7c087..bb57fa1 100644 --- a/README.md +++ b/README.md @@ -3,68 +3,76 @@ L-Tech Sciencific Industries is a mod designed to add to the career mode of Kerbal Space Program by providing new ways to generate science, aswell as experimenting with new device types. -[![][shield:ksp]][KSP:website] +[![][shield:ksp]][site:ksp] [![][shield:ckan]][thread:ckan] -[![][shield:mit]][link:license] +[![][shield:mit]][file:license] [![][logo:ltech]][thread:ltech] -#### Creators +### Creators * [ludsoe](http://forum.kerbalspaceprogram.com/index.php?/profile/6624-ludsoe/) (Code) * [Dungchunker](http://forum.kerbalspaceprogram.com/index.php?/profile/67255-dungchunker/) (Models) -#### Maintainers +### Maintainers * [Olympic1](http://forum.kerbalspaceprogram.com/index.php?/profile/79730-olympic1/) * [linuxgurugamer](http://forum.kerbalspaceprogram.com/index.php?/profile/129964-linuxgurugamer/) -#### Required Mods +### Required Mods * [Module Manager](http://forum.kerbalspaceprogram.com/index.php?/topic/50533-mm) -#### Supported Mods +### Supported Mods +* [Alternate Resource Panel](http://forum.kerbalspaceprogram.com/index.php?/topic/54876-arp/) * [Connected Living Space](http://forum.kerbalspaceprogram.com/index.php?/topic/109972-cls) * [HullCam VDS](http://forum.kerbalspaceprogram.com/index.php?/topic/145633-vds) * [Kerbal Inventory System](http://forum.kerbalspaceprogram.com/index.php?/topic/101928-kis) * [RasterPropMonitor](http://forum.kerbalspaceprogram.com/index.php?/topic/105821-rpm) -* [Snacks](https://github.com/Angel-125/Snacks/releases) +* [Snacks](https://github.com/Angel-125/Snacks) -#### Incompatible Mods +### Incompatible Mods * [[x] Science!](http://forum.kerbalspaceprogram.com/index.php?/topic/107661-science) * [KEI](http://forum.kerbalspaceprogram.com/index.php?/topic/143433-kei) -#### New in v0.4.3 -* Fixed windows not always closing on scene changes - -#### Downloads -* [![][GH:logo]][GH:url] -* [![][DB:logo]][DB:url] -* [![][OD:logo]][OD:url] -* [![][BX:logo]][BX:url] -* [![][SD:logo]][SD:url] +### New in v0.4.4 +* Performance updates +* Removed unnecessary saving +* Settings icon wasn't correctly updated in flight scene +* Updated ToolbarWrapper (again) +* Switched tech level of cameras with each other + +### Downloads +* [![][image:dropbox]][release:dropbox] +* [![][image:onedrive]][release:onedrive] +* [![][image:box]][release:box] +* [![][image:github]][release:github] +* [![][image:spacedock]][release:spacedock] +* [![][image:ckan]][release:ckan] ### License This work is licensed under the MIT License. -[KSP:website]: https://kerbalspaceprogram.com/ -[thread:ckan]: http://forum.kerbalspaceprogram.com/index.php?/topic/143140-ckan -[link:license]: https://github.com/Olympic1/L-Tech/blob/master/LICENSE.txt +[site:ksp]: https://kerbalspaceprogram.com/ +[thread:ckan]: http://forum.kerbalspaceprogram.com/index.php?/topic/154922-ckan/ +[file:license]: https://github.com/Olympic1/L-Tech/blob/master/LICENSE.txt -[shield:ksp]: https://img.shields.io/badge/KSP-v1.2.2-green.svg +[shield:ksp]: https://img.shields.io/badge/KSP-v1.2.x-green.svg [shield:ckan]: https://img.shields.io/badge/CKAN-Indexed-brightgreen.svg [shield:mit]: https://img.shields.io/badge/License-MIT-blue.svg [logo:ltech]: https://github.com/Olympic1/L-Tech/blob/master/GameData/LTech/Flags/LTechScience.png [thread:ltech]: http://forum.kerbalspaceprogram.com/index.php?/topic/49319-ltech -[GH:url]: https://github.com/Olympic1/L-Tech/releases -[GH:logo]: http://i59.tinypic.com/2i11u2d.jpg -[DB:url]: https://www.dropbox.com/s/fub7gk0z6i3uw8q/L-Tech_Scientific_Industries_Continued-v0.4.3.0.zip?dl=0 -[DB:logo]: http://i60.tinypic.com/70jj43.jpg -[OD:url]: https://1drv.ms/u/s!AlH25jPUX2gF2mY-Qq4cCu8-g-Ih -[OD:logo]: http://i67.tinypic.com/169lvds.png -[BX:url]: https://app.box.com/s/7k0wnubhektrwdg8yh2rcojviboqeca5 -[BX:logo]: http://i68.tinypic.com/2zxur92.png - -[SD:url]: https://spacedock.info/mod/227 -[SD:logo]: http://i65.tinypic.com/ot0ks9.jpg \ No newline at end of file +[release:dropbox]: https://www.dropbox.com/s/pi18d81k59eean5/L-Tech_Scientific_Industries_Continued-v0.4.4.0.zip?dl=0 +[release:onedrive]: https://1drv.ms/u/s!AlH25jPUX2gF5DDRDbVwl9lHwjgd +[release:box]: https://app.box.com/s/zu04fx49iabbf1ibttng19ig98mf8cys +[release:github]: https://github.com/Olympic1/L-Tech/releases/latest +[release:spacedock]: https://spacedock.info/mod/227 +[release:ckan]: http://forum.kerbalspaceprogram.com/index.php?/topic/154922-ckan/ + +[image:dropbox]: http://i60.tinypic.com/70jj43.jpg +[image:onedrive]: http://i67.tinypic.com/169lvds.png +[image:box]: http://i68.tinypic.com/2zxur92.png +[image:github]: http://i59.tinypic.com/2i11u2d.jpg +[image:spacedock]: http://i65.tinypic.com/ot0ks9.jpg +[image:ckan]: http://i59.tinypic.com/jidcvk.jpg diff --git a/Source/LtScience/APIClients/ToolbarWrapper.cs b/Source/LtScience/APIClients/ToolbarWrapper.cs index 748afe0..e2be652 100644 --- a/Source/LtScience/APIClients/ToolbarWrapper.cs +++ b/Source/LtScience/APIClients/ToolbarWrapper.cs @@ -830,11 +830,7 @@ internal static Type getType(string name) type = t; }); - if (type != null) - { - return type; - } - return null; + return type; } internal static PropertyInfo getProperty(Type type, string name) diff --git a/Source/LtScience/InternalObjects/LtToolTips.cs b/Source/LtScience/InternalObjects/LtToolTips.cs index 5adfc15..a631f47 100644 --- a/Source/LtScience/InternalObjects/LtToolTips.cs +++ b/Source/LtScience/InternalObjects/LtToolTips.cs @@ -41,10 +41,10 @@ private static void ShowToolTip(Vector2 toolTipPos, string toolTip) { if (LtSettings.showToolTips && (toolTip != null) && (toolTip.Trim().Length > 0)) { - Vector2 size = LtAddon.ToolTipStyle.CalcSize(new GUIContent(toolTip)); + Vector2 size = LtStyle.ToolTipStyle.CalcSize(new GUIContent(toolTip)); _position = new Rect(toolTipPos.x, toolTipPos.y, size.x, size.y); RepositionToolTip(); - GUI.Window(0, _position, EmptyWindow, toolTip, LtAddon.ToolTipStyle); + GUI.Window(0, _position, EmptyWindow, toolTip, LtStyle.ToolTipStyle); GUI.BringWindowToFront(0); } } diff --git a/Source/LtScience/LTSettings.cs b/Source/LtScience/LTSettings.cs index edabc71..3d823ad 100644 --- a/Source/LtScience/LTSettings.cs +++ b/Source/LtScience/LTSettings.cs @@ -97,7 +97,7 @@ internal static void LoadSettings() } // Force styles to refresh/load - LtAddon.WindowStyle = null; + LtStyle.WindowStyle = null; // Lets make sure that the windows can be seen on the screen LtAddon.RepositionWindows(); diff --git a/Source/LtScience/LtAddon.cs b/Source/LtScience/LtAddon.cs index 8085417..0f300d4 100644 --- a/Source/LtScience/LtAddon.cs +++ b/Source/LtScience/LtAddon.cs @@ -28,17 +28,6 @@ public class LtAddon : MonoBehaviour { #region Properties - // GUI styles - internal static GUIStyle WindowStyle; - internal static GUIStyle ButtonStyle; - internal static GUIStyle ButtonToggledStyle; - internal static GUIStyle ToggleStyleHeader; - internal static GUIStyle LabelStyle; - internal static GUIStyle LabelTabHeader; - internal static GUIStyle LabelStyleHardRule; - internal static GUIStyle ScrollStyle; - internal static GUIStyle ToolTipStyle; - // Toolbar integration private static IButton _blizzyButton; private static ApplicationLauncherButton _stockButton; @@ -87,22 +76,7 @@ internal void Awake() LtSettings.LoadSettings(); // Added support for Blizzy toolbar and hot switching between Stock and Blizzy - if (LtSettings.enableBlizzyToolbar) - { - // Let't try to use Blizzy's toolbar - if (ActivateBlizzyToolBar()) - return; - - // We failed to activate the toolbar, so revert to Stock - GameEvents.onGUIApplicationLauncherReady.Add(OnGuiAppLauncherReady); - GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGuiAppLauncherDestroyed); - } - else - { - // Use Stock toolbar - GameEvents.onGUIApplicationLauncherReady.Add(OnGuiAppLauncherReady); - GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGuiAppLauncherDestroyed); - } + CreateAppIcons(); } catch (Exception ex) { @@ -114,9 +88,6 @@ internal void Start() { try { - if (HighLogic.LoadedScene == GameScenes.SPACECENTER) - LtSettings.SaveSettings(); - // Instantiate Event Handlers GameEvents.onGameSceneSwitchRequested.Add(OnGameSceneSwitchRequested); @@ -148,28 +119,53 @@ internal void OnDestroy() GameEvents.onHideUI.Remove(OnHideUi); // Handle toolbars - if (_blizzyButton == null) - { - if (_stockButton != null) - { - ApplicationLauncher.Instance.RemoveModApplication(_stockButton); - _stockButton = null; - } + DestroyAppIcons(); + } + catch (Exception ex) + { + Util.LogMessage("LTAddon.OnDestroy. Error: " + ex, Util.LogType.Error); + } + } - if (_stockButton == null) - { - // Remove the Stock toolbar button - GameEvents.onGUIApplicationLauncherReady.Remove(OnGuiAppLauncherReady); - } + private void CreateAppIcons() + { + if (LtSettings.enableBlizzyToolbar) + { + // Let't try to use Blizzy's toolbar + if (ActivateBlizzyToolBar()) + return; + + // We failed to activate the toolbar, so revert to Stock + GameEvents.onGUIApplicationLauncherReady.Add(OnGuiAppLauncherReady); + GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGuiAppLauncherDestroyed); + } + else + { + // Use Stock toolbar + GameEvents.onGUIApplicationLauncherReady.Add(OnGuiAppLauncherReady); + GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGuiAppLauncherDestroyed); + } + } + + private void DestroyAppIcons() + { + if (_blizzyButton == null) + { + if (_stockButton != null) + { + ApplicationLauncher.Instance.RemoveModApplication(_stockButton); + _stockButton = null; } - else + + if (_stockButton == null) { - _blizzyButton?.Destroy(); + // Remove the Stock toolbar button + GameEvents.onGUIApplicationLauncherReady.Remove(OnGuiAppLauncherReady); } } - catch (Exception ex) + else { - Util.LogMessage("LTAddon.OnDestroy. Error: " + ex, Util.LogType.Error); + _blizzyButton?.Destroy(); } } @@ -179,7 +175,7 @@ internal void OnGUI() { GUI.skin = HighLogic.Skin; - SetupGuiStyles(); + LtStyle.SetupGuiStyles(); Display(); LtToolTips.ShowToolTips(); } @@ -211,6 +207,10 @@ private void OnGameSceneLoadRequested(GameScenes requestedScene) private void OnGameSceneSwitchRequested(GameEvents.FromToAction sceneData) { WindowSettings.showWindow = WindowSkyLab.showWindow = false; + + // Since the changes to Startup options, ON destroy is not being called when a scene change occurs. Startup is being called when the proper scene is loaded. + // Let's do some cleanup of the app icons here as well, to be sure we have only the icons we want. + DestroyAppIcons(); } // Camera UI toggle handlers @@ -371,104 +371,6 @@ internal static void RepositionWindow(ref Rect position) position.y = Screen.height - position.height; } - private static void SetupGuiStyles() - { - if (WindowStyle != null) - return; - - WindowStyle = new GUIStyle(GUI.skin.window); - - ButtonStyle = new GUIStyle(GUI.skin.button) - { - normal = { textColor = Color.white }, - hover = { textColor = Color.blue }, - fontSize = 12, - padding = - { - top = 0, - bottom = 0 - }, - fontStyle = FontStyle.Normal, - alignment = TextAnchor.MiddleCenter, - clipping = TextClipping.Clip - }; - - ButtonToggledStyle = new GUIStyle(GUI.skin.button) - { - normal = { textColor = Color.green }, - hover = { textColor = Color.blue }, - fontSize = 12, - padding = - { - top = 0, - bottom = 0 - }, - fontStyle = FontStyle.Normal, - alignment = TextAnchor.MiddleCenter, - clipping = TextClipping.Clip - }; - ButtonToggledStyle.normal.background = ButtonToggledStyle.onActive.background; - - ToggleStyleHeader = new GUIStyle(GUI.skin.toggle) - { - padding = - { - top = 10, - bottom = 6 - }, - wordWrap = false, - fontStyle = FontStyle.Bold, - margin = new RectOffset(0, 0, 0, 0), - alignment = TextAnchor.LowerLeft - }; - - LabelStyle = new GUIStyle(GUI.skin.label); - - LabelTabHeader = new GUIStyle(GUI.skin.label) - { - padding = - { - top = 10, - bottom = 6 - }, - wordWrap = false, - fontStyle = FontStyle.Bold, - margin = new RectOffset(0, 0, 0, 0) - }; - - LabelStyleHardRule = new GUIStyle(GUI.skin.label) - { - padding = - { - top = 0, - bottom = 6 - }, - wordWrap = false, - fontStyle = FontStyle.Bold, - margin = new RectOffset(0, 0, 0, 0), - alignment = TextAnchor.LowerLeft - }; - - ScrollStyle = new GUIStyle(GUI.skin.box); - - if (GUI.skin != null) - GUI.skin = null; - - ToolTipStyle = new GUIStyle(GUI.tooltip) - { - border = new RectOffset(4, 4, 4, 4), - padding = new RectOffset(5, 5, 5, 5), - alignment = TextAnchor.MiddleLeft, - fontStyle = FontStyle.Italic, - wordWrap = false, - normal = { textColor = Color.green }, - hover = { textColor = Color.green } - }; - ToolTipStyle.hover.background = ToolTipStyle.normal.background; - - GUI.skin = HighLogic.Skin; - } - #endregion #region Action Methods diff --git a/Source/LtScience/LtScience.csproj b/Source/LtScience/LtScience.csproj index 0a94d87..2f2007c 100644 --- a/Source/LtScience/LtScience.csproj +++ b/Source/LtScience/LtScience.csproj @@ -57,6 +57,7 @@ + @@ -64,31 +65,9 @@ - - - - - - - - - - - $(PostBuildEventDependsOn); - PostBuildMacros; - - - - @echo Writing version number to file -@echo @(VersionNumber)>C:\Games\KSP\DirPaths\version.txt -@echo: -call C:\Games\KSP\KSP_win\Copy_LTech.bat + @echo: +@echo Distributing LtScience files... +copy /y "$(TargetDir)LtScience.dll" "..\..\..\..\GameData\LTech\Plugins" \ No newline at end of file diff --git a/Source/LtScience/Properties/AssemblyInfo.cs b/Source/LtScience/Properties/AssemblyInfo.cs index e5e4619..4c84fc6 100644 --- a/Source/LtScience/Properties/AssemblyInfo.cs +++ b/Source/LtScience/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")] [assembly: KSPAssembly("LtScience", 0, 4)] diff --git a/Source/LtScience/Windows/GuiUtils.cs b/Source/LtScience/Windows/GuiUtils.cs new file mode 100644 index 0000000..8f200d7 --- /dev/null +++ b/Source/LtScience/Windows/GuiUtils.cs @@ -0,0 +1,136 @@ +/* + * L-Tech Scientific Industries Continued + * Copyright © 2015-2017, Arne Peirs (Olympic1) + * Copyright © 2016-2017, linuxgurugamer + * + * Kerbal Space Program is Copyright © 2011-2017 Squad. See http://kerbalspaceprogram.com/. + * This project is in no way associated with nor endorsed by Squad. + * + * This file is part of Olympic1's L-Tech (Continued). Original author of L-Tech is 'ludsoe' on the KSP Forums. + * This file was not part of the original L-Tech but was written by Arne Peirs. + * Copyright © 2015-2017, Arne Peirs (Olympic1) + * + * Continues to be licensed under the MIT License. + * See for full details. + */ + +using UnityEngine; + +namespace LtScience.Windows +{ + internal static class LtStyle + { + internal static GUIStyle WindowStyle; + internal static GUIStyle ButtonStyle; + internal static GUIStyle ButtonToggledStyle; + internal static GUIStyle ToggleStyleHeader; + internal static GUIStyle LabelStyle; + internal static GUIStyle LabelTabHeader; + internal static GUIStyle LabelStyleHardRule; + internal static GUIStyle ToolTipStyle; + internal static GUIStyle ScrollStyle; + + internal static void SetupGuiStyles() + { + if (WindowStyle != null) + return; + + SetStyles(); + } + + private static void SetStyles() + { + WindowStyle = new GUIStyle(GUI.skin.window); + + ButtonStyle = new GUIStyle(GUI.skin.button) + { + normal = { textColor = Color.white }, + hover = { textColor = Color.blue }, + fontSize = 12, + padding = + { + top = 0, + bottom = 0 + }, + fontStyle = FontStyle.Normal, + alignment = TextAnchor.MiddleCenter, + clipping = TextClipping.Clip + }; + + ButtonToggledStyle = new GUIStyle(GUI.skin.button) + { + normal = { textColor = Color.green }, + hover = { textColor = Color.blue }, + fontSize = 12, + padding = + { + top = 0, + bottom = 0 + }, + fontStyle = FontStyle.Normal, + alignment = TextAnchor.MiddleCenter, + clipping = TextClipping.Clip + }; + ButtonToggledStyle.normal.background = ButtonToggledStyle.onActive.background; + + ToggleStyleHeader = new GUIStyle(GUI.skin.toggle) + { + padding = + { + top = 10, + bottom = 6 + }, + fontStyle = FontStyle.Bold, + alignment = TextAnchor.LowerLeft, + wordWrap = false, + margin = new RectOffset(0, 0, 0, 0) + }; + + LabelStyle = new GUIStyle(GUI.skin.label); + + LabelTabHeader = new GUIStyle(GUI.skin.label) + { + padding = + { + top = 10, + bottom = 6 + }, + fontStyle = FontStyle.Bold, + wordWrap = false, + margin = new RectOffset(0, 0, 0, 0) + }; + + LabelStyleHardRule = new GUIStyle(GUI.skin.label) + { + padding = + { + top = 0, + bottom = 6 + }, + fontStyle = FontStyle.Bold, + alignment = TextAnchor.LowerLeft, + wordWrap = false, + margin = new RectOffset(0, 0, 0, 0) + }; + + ToolTipStyle = new GUIStyle(GUI.skin.textArea) + { + normal = { textColor = Color.green }, + hover = { textColor = Color.green }, + fontStyle = FontStyle.Italic, + alignment = TextAnchor.MiddleLeft, + wordWrap = false, + border = new RectOffset(4, 4, 4, 4), + padding = new RectOffset(5, 5, 5, 5) + }; + ToolTipStyle.hover.background = ToolTipStyle.normal.background; + + ScrollStyle = new GUIStyle(GUI.skin.box); + + if (GUI.skin != null) + GUI.skin = null; + + GUI.skin = HighLogic.Skin; + } + } +} diff --git a/Source/LtScience/Windows/WindowSettings.cs b/Source/LtScience/Windows/WindowSettings.cs index d216333..c213ab7 100644 --- a/Source/LtScience/Windows/WindowSettings.cs +++ b/Source/LtScience/Windows/WindowSettings.cs @@ -52,7 +52,7 @@ internal static void Display(int windowId) if (GUI.Button(rect, new GUIContent("X", "Close Window.\r\nSettings will not be saved."))) { toolTip = ""; - if (HighLogic.LoadedScene == GameScenes.SPACECENTER) + if (HighLogic.LoadedScene == GameScenes.SPACECENTER || HighLogic.LoadedSceneIsFlight) LtAddon.OnToolbarButtonToggle(); else showWindow = false; @@ -114,8 +114,8 @@ private static void DisplaySettings() const int scrollX = 20; - GUILayout.Label("L-Tech v" + LtSettings.curVersion, LtAddon.LabelTabHeader); - GUILayout.Label("\r\n___________________________________", LtAddon.LabelStyleHardRule, GUILayout.Width(280), GUILayout.Height(10)); + GUILayout.Label("L-Tech v" + LtSettings.curVersion, LtStyle.LabelTabHeader, GUILayout.Width(280)); + GUILayout.Label("\r\n___________________________________", LtStyle.LabelStyleHardRule, GUILayout.Width(280), GUILayout.Height(10)); // Blizzy Toolbar if (!ToolbarManager.ToolbarAvailable) @@ -128,7 +128,7 @@ private static void DisplaySettings() GUI.enabled = true; _label = "Enable Blizzy Toolbar"; - _toolTip = "Switches the toolbar Icons over to Blizzy's toolbar, if installed."; + _toolTip = "Switches the toolbar icon over to Blizzy's toolbar, if installed."; _toolTip += "\r\nIf Blizzy's toolbar is not installed, option is not selectable."; _guiLabel = new GUIContent(_label, _toolTip); LtSettings.enableBlizzyToolbar = GUILayout.Toggle(LtSettings.enableBlizzyToolbar, _guiLabel, GUILayout.Width(280)); @@ -138,7 +138,7 @@ private static void DisplaySettings() GUI.enabled = true; // Tooltips - _label = "Enable Tool Tips"; + _label = "Enable Tooltips"; _toolTip = "Turns tooltips On or Off."; _toolTip += "\r\nThis is a global setting for all windows."; _guiLabel = new GUIContent(_label, _toolTip); @@ -147,7 +147,6 @@ private static void DisplaySettings() if (Event.current.type == EventType.Repaint && _canShowToolTips) toolTip = LtToolTips.SetActiveToolTip(_rect, GUI.tooltip, ref toolTipActive, scrollX); - GUI.enabled = true; GUILayout.Label("", GUILayout.Height(10)); GUILayout.Label("Screenshot Settings:", GUILayout.Height(20)); diff --git a/Source/LtScience/Windows/WindowSkyLab.cs b/Source/LtScience/Windows/WindowSkyLab.cs index 5f32eeb..90c3f13 100644 --- a/Source/LtScience/Windows/WindowSkyLab.cs +++ b/Source/LtScience/Windows/WindowSkyLab.cs @@ -46,7 +46,7 @@ public void DrawGui() if (ValidLab()) { step = "3 - Show SkyLab"; - position = GUILayout.Window(5234628, position, Display, title, LtAddon.WindowStyle, GUILayout.MinHeight(20)); + position = GUILayout.Window(5234628, position, Display, title, LtStyle.WindowStyle, GUILayout.MinHeight(20)); } else {