From daa7c5bd3426746ac171f0dbe869d83fe568726d Mon Sep 17 00:00:00 2001 From: TriggerAu Date: Sun, 16 Oct 2016 14:42:18 +1100 Subject: [PATCH 1/2] Updates for 1.2 to work --- .../SharedStuff/ToolbarWrapper.cs | 24 +++++++++++----- TransferWindowPlanner/TWP.cs | 19 ++++++------- .../TransferWindowPlanner.csproj | 28 +++++++++---------- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/TransferWindowPlanner/SharedStuff/ToolbarWrapper.cs b/TransferWindowPlanner/SharedStuff/ToolbarWrapper.cs index 0a71bda..915ce13 100644 --- a/TransferWindowPlanner/SharedStuff/ToolbarWrapper.cs +++ b/TransferWindowPlanner/SharedStuff/ToolbarWrapper.cs @@ -725,13 +725,23 @@ internal ToolbarTypes() { button = new ButtonTypes(iButtonType); } - internal static Type getType(string name) { - return AssemblyLoader.loadedAssemblies - .SelectMany(a => a.assembly.GetExportedTypes()) - .SingleOrDefault(t => t.FullName == name); - } - - internal static PropertyInfo getProperty(Type type, string name) { + internal static Type getType(string name) + { + Type type = null; + AssemblyLoader.loadedAssemblies.TypeOperation(t => + { + if(t.FullName == name) + type = t; + } + ); + + if(type != null) { + return type; + } + return null; + } + + internal static PropertyInfo getProperty(Type type, string name) { return type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance); } diff --git a/TransferWindowPlanner/TWP.cs b/TransferWindowPlanner/TWP.cs index c91e784..3ad1de6 100644 --- a/TransferWindowPlanner/TWP.cs +++ b/TransferWindowPlanner/TWP.cs @@ -132,18 +132,17 @@ private void OnUnpause() internal override void Start() { - if (AssemblyLoader.loadedAssemblies - .Select(a => a.assembly.GetExportedTypes()) - .SelectMany(t => t) - .Any(t => t.FullName.ToLower().EndsWith(".realsolarsystem"))) + LogFormatted("Searching for RSS"); + AssemblyLoader.loadedAssemblies.TypeOperation(t => { - settings.RSSActive = true; - if (!settings.RSSShowCalendarToggled) - { - settings.ShowCalendarToggle = true; - settings.RSSShowCalendarToggled = true; + if(t.FullName == ("RealSolarSystem.RSSWatchDog")) { + settings.RSSActive = true; + if(!settings.RSSShowCalendarToggled) { + settings.ShowCalendarToggle = true; + settings.RSSShowCalendarToggled = true; + } } - } + }); //Init the KAC Integration KACWrapper.InitKACWrapper(); diff --git a/TransferWindowPlanner/TransferWindowPlanner.csproj b/TransferWindowPlanner/TransferWindowPlanner.csproj index 57f389f..b9b092a 100644 --- a/TransferWindowPlanner/TransferWindowPlanner.csproj +++ b/TransferWindowPlanner/TransferWindowPlanner.csproj @@ -31,20 +31,16 @@ 4 - + False - ..\..\..\..\~Games\KSP_win_PluginTest_Prerelease\KSP_Data\Managed\Assembly-CSharp.dll - - - False - ..\..\..\..\~Games\KSP_win_PluginTest_Minimal\KSP_Data\Managed\KSPUtil.dll + ..\..\_Versions\KSP_win_PluginTest_Minimal\KSP_Data\Managed\Assembly-CSharp.dll False - ..\..\..\..\~Games\KSP_win_PluginTest_Prerelease\KSP_Data\Managed\UnityEngine.dll + ..\..\_Versions\KSP_win_PluginTest_Minimal\KSP_Data\Managed\UnityEngine.dll @@ -83,14 +79,16 @@ rem Set the Variables we need echo Finding KSP -if exist "R:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( - set GAMEPATH="R:\~Games\KSP_Win_PlugInTest_Minimal" -) else if exist "D:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( - set GAMEPATH="D:\~Games\KSP_Win_PlugInTest_Minimal" -) else if exist "C:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( - set GAMEPATH="C:\~Games\KSP_Win_PlugInTest_Minimal -) else if exist "D:\~Games\KSP_Win_PlugInTest\KSP.exe" ( - set GAMEPATH="D:\~Games\KSP_Win_PlugInTest" +rem if exist "R:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( +rem set GAMEPATH="R:\~Games\KSP_Win_PlugInTest_Minimal" +rem ) else if exist "D:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( +rem set GAMEPATH="D:\~Games\KSP_Win_PlugInTest_Minimal" +rem ) else if exist "C:\~Games\KSP_Win_PlugInTest_Minimal\KSP.exe" ( +rem set GAMEPATH="C:\~Games\KSP_Win_PlugInTest_Minimal +rem ) else if exist "D:\~Games\KSP_Win_PlugInTest\KSP.exe" ( + +if exist "D:\Programming\KSP\_Versions\KSP_Win_PlugInTest\KSP.exe" ( + set GAMEPATH="D:\Programming\KSP\_Versions\KSP_Win_PlugInTest" ) else if exist "C:\~Games\KSP_Win_PlugInTest\KSP.exe" ( set GAMEPATH="C:\~Games\KSP_Win_PlugInTest" )else ( From 10fd3a8b0ea31e027ca82919b4ac7ffcf82fe8f5 Mon Sep 17 00:00:00 2001 From: TriggerAu Date: Sun, 16 Oct 2016 14:42:41 +1100 Subject: [PATCH 2/2] Version 1.6.0.0 ready --- PluginFiles/ReadMe-TransferWindowPlanner.txt | 3 +++ TransferWindowPlanner/Properties/AssemblyInfo.cs | 4 ++-- TransferWindowPlanner/TransferWindowPlanner.version | 12 ++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/PluginFiles/ReadMe-TransferWindowPlanner.txt b/PluginFiles/ReadMe-TransferWindowPlanner.txt index 8bf1bee..b0676a2 100644 --- a/PluginFiles/ReadMe-TransferWindowPlanner.txt +++ b/PluginFiles/ReadMe-TransferWindowPlanner.txt @@ -27,6 +27,9 @@ LICENSE This work is licensed under an MIT license as outlined at the OSI site. Visit the documentation site for more details and Attribution VERSION HISTORY +Version 1.6.0.0 - KSP Version: 1.2.0 +- Recompile for 1.2 + Version 1.5.1.0 - KSP Version: 1.1.2 - Adjusted code to handle UIToggle and flight Pause menu diff --git a/TransferWindowPlanner/Properties/AssemblyInfo.cs b/TransferWindowPlanner/Properties/AssemblyInfo.cs index 8181d48..0626f45 100644 --- a/TransferWindowPlanner/Properties/AssemblyInfo.cs +++ b/TransferWindowPlanner/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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("1.5.1.0")] -[assembly: AssemblyFileVersion("1.5.1.0")] +[assembly: AssemblyVersion("1.6.0.0")] +[assembly: AssemblyFileVersion("1.6.0.0")] diff --git a/TransferWindowPlanner/TransferWindowPlanner.version b/TransferWindowPlanner/TransferWindowPlanner.version index 1ffdf5e..e5261fc 100644 --- a/TransferWindowPlanner/TransferWindowPlanner.version +++ b/TransferWindowPlanner/TransferWindowPlanner.version @@ -4,23 +4,23 @@ "DOWNLOAD" : "https://github.com/TriggerAu/TransferWindowPlanner/releases", "VERSION": { "MAJOR": 1, - "MINOR": 5, - "PATCH": 1, + "MINOR": 6, + "PATCH": 0, "BUILD": 0 }, "KSP_VERSION": { "MAJOR": 1, - "MINOR": 1, - "PATCH": 2 + "MINOR": 2, + "PATCH": 0 }, "KSP_VERSION_MIN": { "MAJOR": 1, - "MINOR": 1, + "MINOR": 2, "PATCH": 0 }, "KSP_VERSION_MAX": { "MAJOR": 1, - "MINOR": 1, + "MINOR": 2, "PATCH": 99 } }