From 41c6bed90ce6821157a8f918d97a6ce4ecf66201 Mon Sep 17 00:00:00 2001 From: Jackson <9527380+Jaksuhn@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:59:50 +0100 Subject: [PATCH] add snipes/ipc for liza --- Automaton/Features/AutoSnipeQuests.cs | 11 +++++++++++ Automaton/IPC/Provider.cs | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Automaton/Features/AutoSnipeQuests.cs create mode 100644 Automaton/IPC/Provider.cs diff --git a/Automaton/Features/AutoSnipeQuests.cs b/Automaton/Features/AutoSnipeQuests.cs new file mode 100644 index 0000000..47cdd88 --- /dev/null +++ b/Automaton/Features/AutoSnipeQuests.cs @@ -0,0 +1,11 @@ +namespace Automaton.Features; + +[Tweak] +internal class AutoSnipeQuests : Tweak +{ + public override string Name => "Sniper no sniping"; + public override string Description => "Automatically completes snipe quests."; + + public override void Enable() => P.Memory.SnipeHook.Enable(); + public override void Disable() => P.Memory.SnipeHook.Disable(); +} diff --git a/Automaton/IPC/Provider.cs b/Automaton/IPC/Provider.cs new file mode 100644 index 0000000..013d664 --- /dev/null +++ b/Automaton/IPC/Provider.cs @@ -0,0 +1,19 @@ +using ECommons.EzIpcManager; + +namespace Automaton.IPC; +internal class Provider +{ + public Provider() => EzIPC.Init(this); + + [EzIPC] + public bool IsTweakEnabled(string assemblyName) => C.EnabledTweaks.Contains(assemblyName); + + [EzIPC] + public void SetTweakState(string assemblyName, bool state) + { + if (state) + C.EnabledTweaks.Add(assemblyName); + else + C.EnabledTweaks.Remove(assemblyName); + } +}