1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 03:33:29 +08:00
This commit is contained in:
2024-09-18 01:41:08 +08:00
parent fb916b3813
commit bd512a6b78
17 changed files with 232 additions and 207 deletions

View File

@@ -9,7 +9,7 @@ using UXAssist.Common;
namespace UXAssist.Patches;
public static class GamePatch
public class GamePatch: PatchImpl<GamePatch>
{
private const string GameWindowClass = "UnityWndClass";
private static string _gameWindowTitle = "Dyson Sphere Program";
@@ -50,8 +50,6 @@ public static class GamePatch
}
}
private static Harmony _gamePatch;
public static void Init()
{
// Get profile name from command line arguments, and set window title accordingly
@@ -104,19 +102,18 @@ public static class GamePatch
MouseCursorScaleUp.Enable(MouseCursorScaleUpMultiplier.Value > 1);
// AutoSaveOpt.Enable(AutoSaveOptEnabled.Value);
ConvertSavesFromPeace.Enable(ConvertSavesFromPeaceEnabled.Value);
_gamePatch ??= Harmony.CreateAndPatchAll(typeof(GamePatch));
Enable(true);
}
public static void Uninit()
{
Enable(false);
LoadLastWindowRect.Enable(false);
EnableWindowResize.Enable(false);
MouseCursorScaleUp.reload = false;
MouseCursorScaleUp.Enable(false);
// AutoSaveOpt.Enable(false);
ConvertSavesFromPeace.Enable(false);
_gamePatch?.UnpatchSelf();
_gamePatch = null;
}
private static void RefreshSavePath()
@@ -341,21 +338,11 @@ public static class GamePatch
}
/*
private static class AutoSaveOpt
private class AutoSaveOpt: PatchImpl<AutoSaveOpt>
{
private static Harmony _patch;
public static void Enable(bool on)
protected override void OnEnable()
{
if (on)
{
Directory.CreateDirectory(GameConfig.gameSaveFolder + "AutoSaves/");
_patch ??= Harmony.CreateAndPatchAll(typeof(AutoSaveOpt));
return;
}
_patch?.UnpatchSelf();
_patch = null;
Directory.CreateDirectory(GameConfig.gameSaveFolder + "AutoSaves/");
}
[HarmonyPrefix]