Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 48 additions & 25 deletions FinalFrontier.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<!-- The default KSPDIR can be specified as an Environment Variable or
overridden via "FinalFrontier.csproj.user". This project file should
not be updated and committed except by the upstream developer.
-->
<KSPDIR Condition="'$(KSPDIR)' == ''">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</KSPDIR>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -9,13 +16,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nereid.FinalFrontier</RootNamespace>
<AssemblyName>FinalFrontier</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
Expand All @@ -24,35 +31,14 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\1.7.0-0_development\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="src\achievements\Achievement.cs" />
Expand Down Expand Up @@ -114,6 +100,43 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
31 changes: 31 additions & 0 deletions FinalFrontier.csproj.user.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copy (or merge) this file to "FinalFrontier.csproj.user, and edit the following
lines to suit your development environment.
See "Contributing.md" for more details.
-->
<PropertyGroup>
<!-- KSPDIR specifies the directory where your development install of KSP
is. The following line provides an override to the default in the
project file.
-->
<KSPDIR>$(SolutionDir)..\..\KSP_Dev</KSPDIR>
</PropertyGroup>
<!-- The following section exports the variable as an Environment Variable
so it can be used in Post-build scripts and commands.
-->
<ItemGroup>
<BuildMacro Include="KSPDIR">
<Value>$(KSPDIR)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
<!-- The following section sets up custom run commands so you can start
KSP directly from Visual Studio by pressing F5
-->
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>$(KSPDIR)\KSP_x64.exe</StartProgram>
<StartWorkingDirectory>$(KSPDIR)</StartWorkingDirectory>
</PropertyGroup>
</Project>
33 changes: 22 additions & 11 deletions src/FinalFrontier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/window/AbstractWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down