diff --git a/FinalFrontier.csproj b/FinalFrontier.csproj index 5cac079..dd7527a 100644 --- a/FinalFrontier.csproj +++ b/FinalFrontier.csproj @@ -1,6 +1,13 @@  - + + + + C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program + Debug AnyCPU @@ -9,13 +16,13 @@ Properties Nereid.FinalFrontier FinalFrontier - v3.5 + v4.5 512 true - full + portable false bin\Debug\ DEBUG;TRACE @@ -24,35 +31,14 @@ false - pdbonly + portable true bin\Release\ TRACE prompt 4 - false false - - - False - ..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\Assembly-CSharp.dll - - - - - - - - - False - ..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\UnityEngine.dll - - - False - ..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\UnityEngine.UI.dll - - @@ -114,6 +100,43 @@ + + + False + $(KSPDIR)\KSP_x64_Data\Managed\Assembly-CSharp.dll + False + + + + False + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.ImageConversionModule.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll + False + + + $(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + + + + + $(SolutionDir)..\..\KSP_Dev + + + + + $(KSPDIR) + true + + + + + Program + $(KSPDIR)\KSP_x64.exe + $(KSPDIR) + + \ No newline at end of file diff --git a/src/FinalFrontier.cs b/src/FinalFrontier.cs index 13aeb74..22355a2 100644 --- a/src/FinalFrontier.cs +++ b/src/FinalFrontier.cs @@ -16,19 +16,22 @@ public class FinalFrontier : MonoBehaviour public static readonly String RESOURCE_PATH = "Nereid/FinalFrontier/Resource/"; - public static readonly Configuration configuration = new Configuration(); + // Must initialize in Awake() + private static Configuration _configuration = null; + public static Configuration configuration { get { return _configuration; } } - public static readonly FARAdapter farAdapter = new FARAdapter(); + // Must initialize in Awake() + private static FARAdapter _farAdapter = null; + public static FARAdapter farAdapter { get { return _farAdapter; } } private volatile IButton toolbarButton; private volatile HallOfFameBrowser browser; private volatile ApplicationLauncherButton stockToolbarButton = null; - // just to make sure that all pool instances exists - private ActivityPool activities = ActivityPool.Instance(); - private RibbonPool ribbons = RibbonPool.Instance(); - private ActionPool actions = ActionPool.Instance(); + private ActivityPool activities = null; + private RibbonPool ribbons = null; + private ActionPool actions = null; private volatile bool destroyed = false; @@ -41,15 +44,18 @@ public FinalFrontier() public void Awake() { Log.Info("awakening Final Frontier"); - configuration.Load(); - Log.SetLevel(configuration.GetLogLevel()); - Log.Info("log level is " + configuration.GetLogLevel()); + _configuration = new Configuration(); + _configuration.Load(); + Log.SetLevel(_configuration.GetLogLevel()); + Log.Info("log level is " + _configuration.GetLogLevel()); + // // plugin adapters - farAdapter.Plugin(); + _farAdapter = new FARAdapter(); + _farAdapter.Plugin(); // // log installed plugins - Log.Info("FAR installed: " + farAdapter.IsInstalled()); + Log.Info("FAR installed: " + _farAdapter.IsInstalled()); // // masterTextureLimit should not be 1 if (QualitySettings.masterTextureLimit!=0) @@ -58,6 +64,11 @@ public void Awake() QualitySettings.masterTextureLimit = 0; } + // make sure that all pool instances exists + activities = ActivityPool.Instance(); + ribbons = RibbonPool.Instance(); + actions = ActionPool.Instance(); + DontDestroyOnLoad(this); } diff --git a/src/window/AbstractWindow.cs b/src/window/AbstractWindow.cs index ea9bdac..342bb11 100644 --- a/src/window/AbstractWindow.cs +++ b/src/window/AbstractWindow.cs @@ -80,7 +80,7 @@ public void OnGUI() protected void UseLeftMouseButtonEvent() { Event e = Event.current; - if(e !=null && e.type != EventType.used) + if(e !=null && e.type != EventType.Used) { if ((e.type == EventType.MouseDown || e.type == EventType.MouseUp) && e.button == 0) {