0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/Aki.Custom/Patches/SettingsLocationPatch.cs
chomp 1e238c426e 0.13.5.0 (!33)
Co-authored-by: Dev <dev@dev.sp-tarkov.com>
Co-authored-by: CWX <CWX@noreply.dev.sp-tarkov.com>
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-authored-by: RaiRaiTheRaichu <rairaitheraichu@noreply.dev.sp-tarkov.com>
Co-authored-by: CWX <cwx@noreply.dev.sp-tarkov.com>
Co-authored-by: Kaeno <e>
Reviewed-on: SPT-AKI/Modules#33
2023-10-10 10:58:33 +00:00

31 lines
800 B
C#

using Aki.Reflection.Patching;
using HarmonyLib;
using System;
using System.IO;
using System.Reflection;
namespace Aki.Custom.Patches
{
public class SettingsLocationPatch : ModulePatch
{
private static string _sptPath = Path.Combine(Environment.CurrentDirectory, "user", "sptSettings");
protected override MethodBase GetTargetMethod()
{
return AccessTools.Constructor(typeof(SharedGameSettingsClass));
}
[PatchPrefix]
internal static void PatchPrefix(ref string ___string_0, ref string ___string_1)
{
if (!Directory.Exists(_sptPath))
{
Directory.CreateDirectory(_sptPath);
}
___string_0 = _sptPath;
___string_1 = _sptPath;
}
}
}