Skip to content

Commit

Permalink
Make OpenLinkedDynamicVariableSpace toggleable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Sep 5, 2024
1 parent b007235 commit 058f90f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ internal sealed class OpenLinkedDynamicVariableSpace
{
public override int Priority => HarmonyLib.Priority.First;

public override bool CanBeDisabled => true;

public OpenLinkedDynamicVariableSpace() : base(typeof(DynamicVariableBase<>))
{ }

Expand All @@ -23,6 +25,8 @@ public OpenLinkedDynamicVariableSpace() : base(typeof(DynamicVariableBase<>))

protected override void Handle(BuildInspectorHeaderEvent eventData)
{
if (!Enabled) return;

if (Traverse.Create(eventData.Worker).Field("handler").Field("_currentSpace").GetValue() is not DynamicVariableSpace space)
return;

Expand Down

0 comments on commit 058f90f

Please sign in to comment.