mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
Force Reloaded hook option
This commit is contained in:
parent
9c27212d37
commit
8a58782e86
2 changed files with 7 additions and 2 deletions
|
|
@ -22,10 +22,15 @@ namespace Dalamud.Configuration.Internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool DalamudNoPlugins { get; } = GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS");
|
public static bool DalamudNoPlugins { get; } = GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the DalamudForceReloaded setting has been enabled.
|
||||||
|
/// </summary>
|
||||||
|
public static bool DalamudForceReloaded { get; } = GetEnvironmentVariable("DALAMUD_FORCE_RELOADED");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the DalamudForceCoreHook setting has been enabled.
|
/// Gets a value indicating whether the DalamudForceCoreHook setting has been enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool DalamudForceMinHook { get; } = GetEnvironmentVariable("DALAMUD_FORCE_COREHOOK");
|
public static bool DalamudForceMinHook { get; } = GetEnvironmentVariable("DALAMUD_FORCE_MINHOOK");
|
||||||
|
|
||||||
private static bool GetEnvironmentVariable(string name)
|
private static bool GetEnvironmentVariable(string name)
|
||||||
=> bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false");
|
=> bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false");
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Dalamud.Hooking
|
||||||
private Hook(IntPtr address, T detour, bool useMinHook, Assembly callingAssembly)
|
private Hook(IntPtr address, T detour, bool useMinHook, Assembly callingAssembly)
|
||||||
{
|
{
|
||||||
address = HookManager.FollowJmp(address);
|
address = HookManager.FollowJmp(address);
|
||||||
this.isMinHook = EnvironmentConfiguration.DalamudForceMinHook || useMinHook;
|
this.isMinHook = !EnvironmentConfiguration.DalamudForceReloaded && (EnvironmentConfiguration.DalamudForceMinHook || useMinHook);
|
||||||
|
|
||||||
var hasOtherHooks = HookManager.Originals.ContainsKey(address);
|
var hasOtherHooks = HookManager.Originals.ContainsKey(address);
|
||||||
if (!hasOtherHooks)
|
if (!hasOtherHooks)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue