From da1da9de5bec06d70d7cbaa0194320ed9e89263d Mon Sep 17 00:00:00 2001 From: Jonathan Bayer Date: Tue, 16 Feb 2021 19:57:10 -0500 Subject: [PATCH] Fixed Nullref when moving cursor over BG icon inventory spaces which didn't have any parts in them, also fixes nullref when trying to pull the breaking ground parts, and they don't pulled into the container --- Changelog.txt | 5 ++- .../JanitorsCloset/JanitorsCloset.version | 2 +- JanitorsCloset.version | 2 +- JanitorsCloset/AssemblyVersion.cs | 2 +- JanitorsCloset/JanitorsCloset.cs | 2 + JanitorsCloset/Settings.cs | 37 ------------------- 6 files changed, 9 insertions(+), 41 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index d39d647..a3ae698 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -299,4 +299,7 @@ ChangeLog Removed unnecessary message about missing WinPos.cfg file 0.3.7.3 - Added check for part already added. PlumeParty has a part: pp.vvmach, which apparently has been included in other mods (ChrayolDesign is one) and was causing errors because of duplicate parts \ No newline at end of file + Added check for part already added. PlumeParty has a part: pp.vvmach, which apparently has been included in other mods (ChrayolDesign is one) and was causing errors because of duplicate parts + +0.3.7.4 + Fixed Nullref when moving cursor over BG icon inventory spaces which didn't have any parts in them, also fixes nullref when trying to pull the breaking ground parts, and they don't pulled into the container \ No newline at end of file diff --git a/GameData/JanitorsCloset/JanitorsCloset.version b/GameData/JanitorsCloset/JanitorsCloset.version index da2de11..9c4f9e7 100644 --- a/GameData/JanitorsCloset/JanitorsCloset.version +++ b/GameData/JanitorsCloset/JanitorsCloset.version @@ -10,7 +10,7 @@ "MAJOR": 0, "MINOR": 3, "PATCH": 7, - "BUILD": 2 + "BUILD": 3 }, "KSP_VERSION_MIN": { "MAJOR": 1, diff --git a/JanitorsCloset.version b/JanitorsCloset.version index 9c4f9e7..d591117 100644 --- a/JanitorsCloset.version +++ b/JanitorsCloset.version @@ -10,7 +10,7 @@ "MAJOR": 0, "MINOR": 3, "PATCH": 7, - "BUILD": 3 + "BUILD": 4 }, "KSP_VERSION_MIN": { "MAJOR": 1, diff --git a/JanitorsCloset/AssemblyVersion.cs b/JanitorsCloset/AssemblyVersion.cs index 855651e..c1b433b 100644 --- a/JanitorsCloset/AssemblyVersion.cs +++ b/JanitorsCloset/AssemblyVersion.cs @@ -10,5 +10,5 @@ using System.Reflection; - [assembly: AssemblyVersion("0.3.7.2")] + [assembly: AssemblyVersion("0.3.7.3")] [assembly: AssemblyDescription("$(ProjectDir)")] \ No newline at end of file diff --git a/JanitorsCloset/JanitorsCloset.cs b/JanitorsCloset/JanitorsCloset.cs index dbdb18b..b5749dc 100644 --- a/JanitorsCloset/JanitorsCloset.cs +++ b/JanitorsCloset/JanitorsCloset.cs @@ -205,6 +205,8 @@ private void IconClicked(EditorPartIcon icon, EditorIconEvents.EditorIconClickEv private void IconHover(EditorPartIcon icon, bool hover) { + if (icon == null || icon.partInfo == null) + return; Log.Info("IconHover, ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary): " + ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary).ToString()); if (HighLogic.CurrentGame.Parameters.CustomParams().showMod || ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.primary) || ExtendedInput.GetKey(GameSettings.MODIFIER_KEY.secondary)) diff --git a/JanitorsCloset/Settings.cs b/JanitorsCloset/Settings.cs index 248df85..77c9a13 100644 --- a/JanitorsCloset/Settings.cs +++ b/JanitorsCloset/Settings.cs @@ -57,43 +57,6 @@ public class JanitorsClosetSettings : GameParameters.CustomParameterNode [GameParameters.CustomParameterUI("Debug mode (spams the log file")] public bool debug = false; - -#if false - public override void SetDifficultyPreset(GameParameters.Preset preset) - { - switch (preset) - { - case GameParameters.Preset.Easy: - toolbarEnabled = true; - toolbarPopupsEnabled = true; - editorMenuPopupEnabled = true; - hoverTimeout = 0.5f; - break; - - case GameParameters.Preset.Normal: - toolbarEnabled = true; - toolbarPopupsEnabled = true; - editorMenuPopupEnabled = true; - hoverTimeout = 0.5f; - break; - - case GameParameters.Preset.Moderate: - toolbarEnabled = true; - toolbarPopupsEnabled = true; - editorMenuPopupEnabled = true; - hoverTimeout = 0.5f; - break; - - case GameParameters.Preset.Hard: - toolbarEnabled = true; - toolbarPopupsEnabled = true; - editorMenuPopupEnabled = true; - hoverTimeout = 0.5f; - break; - } - } -#endif - public override bool Enabled(MemberInfo member, GameParameters parameters) { if (member.Name == "toolbarPopupsEnabled")