using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using SmartAction.Patch; namespace SmartAction; [BepInPlugin(PluginGuid, PluginName, PluginVersion)] [BepInDependency("com.SPT.core", "4.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.yox92.smartaction"; public const string PluginName = "SmartAction"; public const string PluginVersion = "2.0.0"; internal static ManualLogSource Log { get; private set; } private ConfigEntry _diagnostics; private void Awake() { Log = Logger; _diagnostics = Config.Bind( "Debug", "Diagnostics", true, "Log patch and guard activity. Counters are cheap, but this writes a summary line " + "every 30s while in raid. Turn off once the behaviour is trusted."); Diagnostics.Enabled = _diagnostics.Value; _diagnostics.SettingChanged += (_, _) => Diagnostics.Enabled = _diagnostics.Value; // Stage 1 is walk-only. CanSprintPatch is deferred to Stage 2/3 — see NOTES.md: // MovementContext.CanSprint does not gate sprinting, and patching it caused // EnableSprint() to call ForceStopInteractions()/RemoveLeftHandItem() mid-heal. new CanWalkPatch().Enable(); Log.LogInfo($"{PluginName} {PluginVersion} loaded (walk-while-healing active, " + $"diagnostics {(Diagnostics.Enabled ? "ON" : "off")})."); } }