Skip to content

Commit 828cdc1

Browse files
committed
Better KSP 1.2.2 handling...
1 parent 3e9825c commit 828cdc1

File tree

6 files changed

+217
-38
lines changed

6 files changed

+217
-38
lines changed

ModuleManager.sln

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.26730.12
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleManager", "Source\ModuleManager\ModuleManager.csproj", "{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleManager.12", "Source\ModuleManager\ModuleManager.12.csproj", "{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleManagerTests", "Source\ModuleManagerTests\ModuleManagerTests.csproj", "{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}"
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils", "Source\TestUtils\TestUtils.csproj", "{20EAAFE6-510D-4374-8D2F-6B52D0178E85}"
1111
EndProject
1212
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtilsTests", "Source\TestUtilsTests\TestUtilsTests.csproj", "{E695C11F-4217-4014-9B51-7232A654C205}"
1313
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleManager", "Source\ModuleManager\ModuleManager.csproj", "{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}"
15+
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1618
Debug|Any CPU = Debug|Any CPU
@@ -23,31 +25,19 @@ Global
2325
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
2426
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
2527
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.Release|Any CPU.Build.0 = Release|Any CPU
26-
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.122.Release|Any CPU.ActiveCfg = 122.Release|Any CPU
27-
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.122.Release|Any CPU.Build.0 = 122.Release|Any CPU
28-
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.122.Debug|Any CPU.ActiveCfg = 122.Debug|Any CPU
29-
{02C8E3AF-69F9-4102-AB60-DD6DE60662D3}.122.Debug|Any CPU.Build.0 = 122.Debug|Any CPU
3028
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3129
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.Debug|Any CPU.Build.0 = Debug|Any CPU
3230
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.Release|Any CPU.ActiveCfg = Release|Any CPU
33-
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.122.Release|Any CPU.ActiveCfg = 122.Release|Any CPU
34-
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.122.Release|Any CPU.Build.0 = 122.Release|Any CPU
35-
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.122.Debug|Any CPU.ActiveCfg = 122.Debug|Any CPU
36-
{BC2A08C8-64EF-4823-A40B-8889C1CCFD75}.122.Debug|Any CPU.Build.0 = 122.Debug|Any CPU
3731
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3832
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.Debug|Any CPU.Build.0 = Debug|Any CPU
3933
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.122.Release|Any CPU.ActiveCfg = 122.Release|Any CPU
41-
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.122.Release|Any CPU.Build.0 = 122.Release|Any CPU
42-
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.122.Debug|Any CPU.ActiveCfg = 122.Debug|Any CPU
43-
{20EAAFE6-510D-4374-8D2F-6B52D0178E85}.122.Debug|Any CPU.Build.0 = 122.Debug|Any CPU
4434
{E695C11F-4217-4014-9B51-7232A654C205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4535
{E695C11F-4217-4014-9B51-7232A654C205}.Debug|Any CPU.Build.0 = Debug|Any CPU
4636
{E695C11F-4217-4014-9B51-7232A654C205}.Release|Any CPU.ActiveCfg = Release|Any CPU
47-
{E695C11F-4217-4014-9B51-7232A654C205}.122.Release|Any CPU.ActiveCfg = 122.Release|Any CPU
48-
{E695C11F-4217-4014-9B51-7232A654C205}.122.Release|Any CPU.Build.0 = 122.Release|Any CPU
49-
{E695C11F-4217-4014-9B51-7232A654C205}.122.Debug|Any CPU.ActiveCfg = 122.Debug|Any CPU
50-
{E695C11F-4217-4014-9B51-7232A654C205}.122.Debug|Any CPU.Build.0 = 122.Debug|Any CPU
37+
{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
38+
{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}.Release|Any CPU.Build.0 = Release|Any CPU
39+
{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40+
{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
5141
EndGlobalSection
5242
GlobalSection(SolutionProperties) = preSolution
5343
HideSolutionNode = FALSE

Source/ModuleManager/FatalErrorHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public static void HandleFatalError(string message)
1313
PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f),
1414
new Vector2(0.5f, 0.5f),
1515
new MultiOptionDialog(
16+
#if !KSP12
1617
"ModuleManagerFatalError",
18+
#endif
1719
$"ModuleManager has encountered a fatal error and KSP needs to close.\n\n{message}\n\nPlease see KSP's log for addtional details",
1820
"ModuleManager - Fatal Error",
1921
HighLogic.UISkin,

Source/ModuleManager/MMPatchLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@ public IEnumerable<IProtoUrlConfig> Run()
223223
logger.Error("Patch log does not exist: " + patchLogPath);
224224
}
225225

226+
#if !KSP12
226227
if (KSP.Localization.Localizer.Instance != null)
227228
KSP.Localization.Localizer.SwitchToLanguage(KSP.Localization.Localizer.CurrentLanguage);
229+
#endif
228230

229231
logger.Info(status + "\n" + errors);
230232

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.0</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{02C8E3AF-69F9-4102-AB60-DD6DE60662D4}</ProjectGuid>
9+
<BaseIntermediateOutputPath>..\..\obj\12</BaseIntermediateOutputPath>
10+
<OutputType>Library</OutputType>
11+
<RootNamespace>ModuleManager</RootNamespace>
12+
<AssemblyName>ModuleManager</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>True</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>False</Optimize>
19+
<OutputPath>..\..\bin\Debug12\</OutputPath>
20+
<DefineConstants>KSP12;DEBUG;LOGSPAM</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
<ConsolePause>False</ConsolePause>
24+
<LangVersion>default</LangVersion>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>none</DebugType>
28+
<Optimize>True</Optimize>
29+
<OutputPath>..\..\bin\Release12\</OutputPath>
30+
<DefineConstants>KSP12</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
<ConsolePause>False</ConsolePause>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Compile Include="Extensions\UrlDirExtensions.cs" />
37+
<Compile Include="Extensions\UrlFileExtensions.cs" />
38+
<Compile Include="Fix16.cs" />
39+
<Compile Include="Cats\CatAnimator.cs" />
40+
<Compile Include="Cats\CatManager.cs" />
41+
<Compile Include="Cats\CatMover.cs" />
42+
<Compile Include="Cats\CatOrbiter.cs" />
43+
<Compile Include="Collections\ArrayEnumerator.cs" />
44+
<Compile Include="Collections\ImmutableStack.cs" />
45+
<Compile Include="Collections\KeyValueCache.cs" />
46+
<Compile Include="Command.cs" />
47+
<Compile Include="CommandParser.cs" />
48+
<Compile Include="Extensions\ByteArrayExtensions.cs" />
49+
<Compile Include="Extensions\ConfigNodeExtensions.cs" />
50+
<Compile Include="Extensions\IBasicLoggerExtensions.cs" />
51+
<Compile Include="Extensions\NodeStackExtensions.cs" />
52+
<Compile Include="Extensions\StringExtensions.cs" />
53+
<Compile Include="Extensions\UrlConfigExtensions.cs" />
54+
<Compile Include="FatalErrorHandler.cs" />
55+
<Compile Include="Logging\IBasicLogger.cs" />
56+
<Compile Include="Logging\ModLogger.cs" />
57+
<Compile Include="Collections\MessageQueue.cs" />
58+
<Compile Include="MMPatchLoader.cs" />
59+
<Compile Include="MMPatchRunner.cs" />
60+
<Compile Include="ModuleManager.cs" />
61+
<Compile Include="ModListGenerator.cs" />
62+
<Compile Include="FilePathRepository.cs" />
63+
<Compile Include="PostPatchLoader.cs" />
64+
<Compile Include="ModuleManagerTestRunner.cs" />
65+
<Compile Include="NeedsChecker.cs" />
66+
<Compile Include="NodeMatcher.cs" />
67+
<Compile Include="Operator.cs" />
68+
<Compile Include="OperatorParser.cs" />
69+
<Compile Include="Pass.cs" />
70+
<Compile Include="PatchApplier.cs" />
71+
<Compile Include="PatchContext.cs" />
72+
<Compile Include="Patches\InsertPatch.cs" />
73+
<Compile Include="Patches\PassSpecifiers\AfterPassSpecifier.cs" />
74+
<Compile Include="Patches\PassSpecifiers\BeforePassSpecifier.cs" />
75+
<Compile Include="Patches\PassSpecifiers\FinalPassSpecifier.cs" />
76+
<Compile Include="Patches\PassSpecifiers\FirstPassSpecifier.cs" />
77+
<Compile Include="Patches\PassSpecifiers\ForPassSpecifier.cs" />
78+
<Compile Include="Patches\PassSpecifiers\InsertPassSpecifier.cs" />
79+
<Compile Include="Patches\PassSpecifiers\IPassSpecifier.cs" />
80+
<Compile Include="Patches\PassSpecifiers\LegacyPassSpecifier.cs" />
81+
<Compile Include="Patches\CopyPatch.cs" />
82+
<Compile Include="Patches\DeletePatch.cs" />
83+
<Compile Include="Patches\EditPatch.cs" />
84+
<Compile Include="Patches\IPatch.cs" />
85+
<Compile Include="Patches\PatchCompiler.cs" />
86+
<Compile Include="Patches\ProtoPatch.cs" />
87+
<Compile Include="Patches\ProtoPatchBuilder.cs" />
88+
<Compile Include="PatchExtractor.cs" />
89+
<Compile Include="PatchList.cs" />
90+
<Compile Include="Progress\ProgressCounter.cs" />
91+
<Compile Include="Properties\AssemblyInfo.cs" />
92+
<Compile Include="Properties\Resources.Designer.cs" />
93+
<Compile Include="Progress\IPatchProgress.cs" />
94+
<Compile Include="Progress\PatchProgress.cs" />
95+
<Compile Include="ProtoUrlConfig.cs" />
96+
<Compile Include="Tags\Tag.cs" />
97+
<Compile Include="Tags\TagList.cs" />
98+
<Compile Include="Tags\TagListParser.cs" />
99+
<Compile Include="Threading\ITaskStatus.cs" />
100+
<Compile Include="Threading\TaskStatus.cs" />
101+
<Compile Include="Threading\TaskStatusWrapper.cs" />
102+
<Compile Include="Utils\Counter.cs" />
103+
<Compile Include="Utils\FileUtils.cs" />
104+
<Compile Include="CustomConfigsManager.cs" />
105+
<Compile Include="Threading\BackgroundTask.cs" />
106+
<Compile Include="Properties\Version.cs">
107+
<DependentUpon>Version.tt</DependentUpon>
108+
</Compile>
109+
<Compile Include="Patches\PassSpecifiers\LastPassSpecifier.cs" />
110+
<Compile Include="Startup.cs" />
111+
<Compile Include="ExceptionIntercept\InterceptLogHandler.cs" />
112+
<Compile Include="GUI\ShowStopperAlertBox.cs" />
113+
<Compile Include="GUI\UnsupportedKSPAlertBox.cs" />
114+
<Compile Include="GUI\Menu.cs" />
115+
<Compile Include="GUI\ReloadingDatabase.cs" />
116+
<Compile Include="GUI\Menu.12.cs" />
117+
<Compile Include="GUI\ReloadingDatabase.12.cs" />
118+
<Compile Include="Utils\PerformanceMetrics.cs" />
119+
<Compile Include="Logging\PatchLogger.cs" />
120+
<Compile Include="Properties\LegalMamboJambo.cs" />
121+
<Compile Include="Progress\Timings.cs" />
122+
<Compile Include="Utils\Stopwatch.cs" />
123+
<Compile Include="Utils\ConfigNodeEditUtils.cs" />
124+
</ItemGroup>
125+
<ItemGroup>
126+
<Reference Include="System" />
127+
<Reference Include="System.Drawing" />
128+
<Reference Include="KSPe">
129+
<HintPath>..\..\..\..\..\..\LIB\plugins\KSPe.dll</HintPath>
130+
<Private>False</Private>
131+
</Reference>
132+
<Reference Include="Assembly-CSharp">
133+
<HintPath>..\..\..\..\..\..\LIB\managed\1.2.2\Assembly-CSharp.dll</HintPath>
134+
<Private>False</Private>
135+
</Reference>
136+
<Reference Include="UnityEngine.UI">
137+
<HintPath>..\..\..\..\..\..\LIB\managed\1.2.2\UnityEngine.UI.dll</HintPath>
138+
<Private>False</Private>
139+
</Reference>
140+
<Reference Include="UnityEngine">
141+
<HintPath>..\..\..\..\..\..\LIB\managed\1.2.2\UnityEngine.dll</HintPath>
142+
<Private>False</Private>
143+
</Reference>
144+
<Reference Include="KSPe.UI">
145+
<HintPath>..\..\..\..\..\..\LIB\plugins\KSPe.UI.dll</HintPath>
146+
<Private>False</Private>
147+
</Reference>
148+
</ItemGroup>
149+
<ItemGroup>
150+
<EmbeddedResource Include="Properties\Resources.resx" />
151+
</ItemGroup>
152+
<ItemGroup>
153+
<None Include="packages.config" />
154+
<None Include="Properties\Version.tt">
155+
<Generator>TextTemplatingFileGenerator</Generator>
156+
<LastGenOutput>Version.cs</LastGenOutput>
157+
</None>
158+
</ItemGroup>
159+
<ItemGroup>
160+
<None Include="Properties\cat-1.png" />
161+
</ItemGroup>
162+
<ItemGroup>
163+
<None Include="Properties\cat-10.png" />
164+
</ItemGroup>
165+
<ItemGroup>
166+
<None Include="Properties\cat-11.png" />
167+
</ItemGroup>
168+
<ItemGroup>
169+
<None Include="Properties\cat-12.png" />
170+
</ItemGroup>
171+
<ItemGroup>
172+
<None Include="Properties\cat-2.png" />
173+
</ItemGroup>
174+
<ItemGroup>
175+
<None Include="Properties\cat-3.png" />
176+
</ItemGroup>
177+
<ItemGroup>
178+
<None Include="Properties\cat-4.png" />
179+
</ItemGroup>
180+
<ItemGroup>
181+
<None Include="Properties\cat-5.png" />
182+
</ItemGroup>
183+
<ItemGroup>
184+
<None Include="Properties\cat-6.png" />
185+
</ItemGroup>
186+
<ItemGroup>
187+
<None Include="Properties\cat-7.png" />
188+
</ItemGroup>
189+
<ItemGroup>
190+
<None Include="Properties\cat-8.png" />
191+
</ItemGroup>
192+
<ItemGroup>
193+
<None Include="Properties\cat-9.png" />
194+
</ItemGroup>
195+
<ItemGroup>
196+
<None Include="Properties\rainbow2.png" />
197+
</ItemGroup>
198+
<ItemGroup>
199+
<Folder Include="Cats\" />
200+
</ItemGroup>
201+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
202+
<PropertyGroup>
203+
<PostBuildEvent></PostBuildEvent>
204+
</PropertyGroup>
205+
</Project>

Source/ModuleManager/ModuleManager.csproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@
2323
<ConsolePause>False</ConsolePause>
2424
<LangVersion>default</LangVersion>
2525
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == '122.Debug|AnyCPU' ">
27-
<DebugSymbols>True</DebugSymbols>
28-
<DebugType>full</DebugType>
29-
<Optimize>False</Optimize>
30-
<OutputPath>..\..\bin\Debug122</OutputPath>
31-
<DefineConstants>KSP12;DEBUG;</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<ConsolePause>False</ConsolePause>
35-
<LangVersion>default</LangVersion>
36-
</PropertyGroup>
3726
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3827
<DebugType>none</DebugType>
3928
<Optimize>True</Optimize>
@@ -42,15 +31,6 @@
4231
<WarningLevel>4</WarningLevel>
4332
<ConsolePause>False</ConsolePause>
4433
</PropertyGroup>
45-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == '122.Release|AnyCPU' ">
46-
<DebugType>none</DebugType>
47-
<Optimize>True</Optimize>
48-
<OutputPath>..\..\bin\Release122</OutputPath>
49-
<DefineConstants>KSP12</DefineConstants>
50-
<ErrorReport>prompt</ErrorReport>
51-
<WarningLevel>4</WarningLevel>
52-
<ConsolePause>False</ConsolePause>
53-
</PropertyGroup>
5434
<ItemGroup>
5535
<Compile Include="Extensions\UrlDirExtensions.cs" />
5636
<Compile Include="Extensions\UrlFileExtensions.cs" />

Source/ModuleManagerTests/ModuleManagerTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
44
<Import Project="..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props" Condition="Exists('..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props')" />
55
<Import Project="..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" />

0 commit comments

Comments
 (0)