-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using BepInEx; | ||
using MijuTools; | ||
using BepInEx.Configuration; | ||
using SpaceCraft; | ||
using UnityEngine.InputSystem; | ||
using HarmonyLib; | ||
using UnityEngine.EventSystems; | ||
using System.Collections.Generic; | ||
|
||
namespace UISaveOnQuit | ||
{ | ||
[BepInPlugin("akarnokd.theplanetcraftermods.saveonquit", "(UI) Save When Quitting", "1.0.0.0")] | ||
public class Plugin : BaseUnityPlugin | ||
{ | ||
|
||
private void Awake() | ||
{ | ||
// Plugin startup logic | ||
Logger.LogInfo($"Plugin is loaded!"); | ||
|
||
Harmony.CreateAndPatchAll(typeof(Plugin)); | ||
} | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(UiWindowPause), nameof(UiWindowPause.OnQuit))] | ||
static void UiWindowPause_OnQuit(UiWindowPause __instance) | ||
{ | ||
__instance.OnSave(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net462</TargetFramework> | ||
<AssemblyName>UISaveOnQuit</AssemblyName> | ||
<Description>(UI) Save When Quitting</Description> | ||
<Version>1.0.0.0</Version> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<LangVersion>latest</LangVersion> | ||
<Platforms>AnyCPU</Platforms> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="Exists('c:\Program Files (x86)\Steam\steamapps\common\The Planet Crafter')"> | ||
<GameDir>c:\Program Files (x86)\Steam\steamapps\common\The Planet Crafter\</GameDir> | ||
<GameManaged>$(GameDir)Planet Crafter_Data\Managed\</GameManaged> | ||
<PluginsFolder>$(GameDir)\BepInEx\plugins</PluginsFolder> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="Exists('e:\Steam\steamapps\common\The Planet Crafter')"> | ||
<GameDir>e:\Steam\steamapps\common\The Planet Crafter\</GameDir> | ||
<GameManaged>$(GameDir)Planet Crafter_Data\Managed\</GameManaged> | ||
<PluginsFolder>$(GameDir)\BepInEx\plugins</PluginsFolder> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" /> | ||
<PackageReference Include="BepInEx.Core" Version="5.*" /> | ||
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" /> | ||
<PackageReference Include="UnityEngine.Modules" Version="2020.3.26" IncludeAssets="compile" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'"> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>$(GameManaged)\Assembly-CSharp.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="com.mijugames.miju-tools"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>$(GameManaged)com.mijugames.miju-tools.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Unity.InputSystem"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>$(GameManaged)unity.inputsystem.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.UI"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>$(GameManaged)unityengine.ui.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
<Target Name="CopyDLLs" AfterTargets="Build"> | ||
<Copy SourceFiles="$(TargetDir)$(AssemblyName).dll" DestinationFolder="$(PluginsFolder)\akarnokd - $(Description)" /> | ||
<Copy SourceFiles="$(TargetDir)$(AssemblyName).dll" DestinationFolder="$(TargetDir)\$(AssemblyName)\akarnokd - $(Description)" /> | ||
<ZipDirectory | ||
SourceDirectory="$(TargetDir)\$(AssemblyName)" | ||
DestinationFile="$(OutputPath)\..\..\..\..\akarnokd-$(AssemblyName).zip" | ||
Overwrite="true" /> | ||
</Target> | ||
</Project> |