Skip to content

Commit e23eb74

Browse files
authored
Merge pull request #1 from schlosrat/master
Fixed issue that was causing NREs
2 parents 8502928 + fd0f685 commit e23eb74

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

SkipSplashScreenProject/SkipSplashScreen.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@
1010
<Description>Skips the splashscreen</Description>
1111
<Version>1.0.0</Version>
1212
<RestoreAdditionalProjectSources>
13+
https://api.nuget.org/v3/index.json;
14+
https://nuget.bepinex.dev/v3/index.json;
1315
https://nuget.spacewarp.org/v3/index.json
1416
</RestoreAdditionalProjectSources>
1517
<RootNamespace>SkipSplashScreen</RootNamespace>
1618
<ModId Condition="'$(ModId)'==''">skip_splash_screen</ModId>
1719
</PropertyGroup>
20+
<ItemGroup>
21+
<Reference Include="Assembly-CSharp">
22+
<HintPath>..\external_dlls\Assembly-CSharp.dll</HintPath>
23+
<Publicize>true</Publicize>
24+
<Private>false</Private>
25+
</Reference>
26+
</ItemGroup>
1827
<ItemGroup>
1928
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
2029
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.0" PrivateAssets="all" />
@@ -24,12 +33,7 @@
2433
<PackageReference Include="SpaceWarp" Version="1.1.1" />
2534
<PackageReference Include="UnityEngine.Modules" Version="2020.3.33" IncludeAssets="compile" />
2635
</ItemGroup>
27-
<ItemGroup>
28-
<Reference Include="Assembly-CSharp">
29-
<HintPath>..\external_dlls\Assembly-CSharp.dll</HintPath>
30-
</Reference>
31-
</ItemGroup>
3236
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
33-
<Exec Command="echo d | xcopy /y /s &quot;$(ProjectDir)..\$(ModId)\&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).dll&quot;&#xA;if $(ConfigurationName) == Debug echo f | xcopy /y &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).pdb&quot;&#xA;xcopy /y &quot;$(ProjectDir)..\LICENSE&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(ProjectDir)..\README.md&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\README.txt&quot;&#xD;&#xA;&#xD;&#xA;echo Copying output .dll to &quot;..Kerbal Space Program 2 0.1.2.0 DEV\BepInEx\plugins\SkipSplashScreen\&quot;&#xD;&#xA;xcopy /y &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).dll&quot; &quot;D:\Steam\steamapps\common\Kerbal Space Program 2 0.1.2.0 DEV\BepInEx\plugins\SkipSplashScreen\&quot;&#xD;&#xA;&#xD;&#xA;echo Copying output .pdb to &quot;..Kerbal Space Program 2 0.1.2.0 DEV\BepInEx\plugins\SkipSplashScreen\&quot;&#xD;&#xA;xcopy /y &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).pdb&quot; &quot;D:\Steam\steamapps\common\Kerbal Space Program 2 0.1.2.0 DEV\BepInEx\plugins\SkipSplashScreen\&quot;&#xD;&#xA;&#xD;&#xA;echo Starting KSP2_x64.exe&#xD;&#xA;powershell &quot;start-process &quot;&quot;D:\Steam\steamapps\common\Kerbal Space Program 2 0.1.2.0 DEV\KSP2_x64.exe&quot;&quot;&quot;" />
37+
<Exec Command="echo d | xcopy /y /s &quot;$(ProjectDir)..\$(ModId)\&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).dll&quot;&#xA;if $(ConfigurationName) == Debug echo f | xcopy /y &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).pdb&quot;&#xA;xcopy /y &quot;$(ProjectDir)..\LICENSE&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(ProjectDir)..\README.md&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\README.txt&quot;" />
3438
</Target>
3539
</Project>

SkipSplashScreenProject/SkipSplashScreenPlugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public void Start()
2323

2424
public void Update()
2525
{
26-
var gameState = GameManager.Instance?.Game.GlobalGameState?.GetState();
26+
var gameState = GameManager.Instance?.Game?.GlobalGameState?.GetState();
2727

2828
if (gameState == null)
2929
return;
3030

31-
if (GameManager.Instance.Game.GlobalGameState.GetState() == GameState.MainMenu)
31+
if (GameManager.Instance?.Game?.GlobalGameState?.GetState() == GameState.MainMenu)
3232
Destroy(this);
3333
}
3434

external_dlls/COPY_Assembly-CSharp_dll_HERE

Whitespace-only changes.

0 commit comments

Comments
 (0)