From 93f5413f0388649c4c3e6260ce3d42d75fc3dafe Mon Sep 17 00:00:00 2001 From: Jackson <9527380+Jaksuhn@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:51:05 +0200 Subject: [PATCH] add lifestream ipc --- SomethingNeedDoing/IPC/LifestreamIPC.cs | 20 +++++++++++++++++++ SomethingNeedDoing/Misc/Changelog.cs | 13 +++++++++++- .../Misc/Commands/IpcCommands.cs | 16 ++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 SomethingNeedDoing/IPC/LifestreamIPC.cs diff --git a/SomethingNeedDoing/IPC/LifestreamIPC.cs b/SomethingNeedDoing/IPC/LifestreamIPC.cs new file mode 100644 index 00000000..bdea8c10 --- /dev/null +++ b/SomethingNeedDoing/IPC/LifestreamIPC.cs @@ -0,0 +1,20 @@ +using ECommons.EzIpcManager; +using System; + +namespace Automaton.IPC; + +#nullable disable +public class LifestreamIPC +{ + public const string Name = "Lifestream"; + public LifestreamIPC() => EzIPC.Init(this, Name, SafeWrapper.AnyException); + + [EzIPC] public Func AethernetTeleport; + [EzIPC] public Func Teleport; + [EzIPC] public Func TeleportToHome; + [EzIPC] public Func TeleportToFC; + [EzIPC] public Func TeleportToApartment; + [EzIPC] public Func IsBusy; + [EzIPC] public Action ExecuteCommand; + [EzIPC] public Action Abort; +} diff --git a/SomethingNeedDoing/Misc/Changelog.cs b/SomethingNeedDoing/Misc/Changelog.cs index 7aa56373..74ac2ff9 100644 --- a/SomethingNeedDoing/Misc/Changelog.cs +++ b/SomethingNeedDoing/Misc/Changelog.cs @@ -19,7 +19,18 @@ static void DisplayChangelog(string date, string changes, bool separator = true) using var font = ImRaii.PushFont(UiBuilder.MonoFont); DisplayChangelog( - "2024-08-24", + "2024-08-21", + "- Added LifestreamAethernetTeleport()\n" + + "- Added LifestreamTeleport()\n" + + "- Added LifestreamTeleportToHome()\n +" + + "- Added LifestreamTeleportToFC()\n" + + "- Added LifestreamTeleportToApartment()\n" + + "- Added LifestreamIsBusy()\n" + + "- Added LifestreamExecuteCommand()\n" + + "- Added LifestreamAbort()\n"); + + DisplayChangelog( + "2024-08-14", "- Added GetZoneInstance()\n" + "- Added IsPauseLoopSet()\n" + "- Added IsStopLoopSet()\n +" + diff --git a/SomethingNeedDoing/Misc/Commands/IpcCommands.cs b/SomethingNeedDoing/Misc/Commands/IpcCommands.cs index a8b91304..e5fd3e2e 100644 --- a/SomethingNeedDoing/Misc/Commands/IpcCommands.cs +++ b/SomethingNeedDoing/Misc/Commands/IpcCommands.cs @@ -1,4 +1,5 @@ -using AutoRetainerAPI; +using Automaton.IPC; +using AutoRetainerAPI; using SomethingNeedDoing.IPC; using System; using System.Collections.Generic; @@ -11,6 +12,7 @@ public class IpcCommands { internal static IpcCommands Instance { get; } = new(); private readonly Dropbox dropbox; + private readonly LifestreamIPC lifestream; public List ListAllFunctions() { @@ -33,6 +35,7 @@ internal IpcCommands() NavmeshIPC.Init(); DeliverooIPC.Init(); PandorasBoxIPC.Init(); + lifestream = new(); dropbox = new(); } @@ -184,4 +187,15 @@ internal static void RestoreTextAdvance() public int DropboxGetItemQuantity(uint id, bool hq) => dropbox.GetItemQuantity(id, hq); public void DropboxSetItemQuantity(uint id, bool hq, int quantity) => dropbox.SetItemQuantity(id, hq, quantity); #endregion + + #region Lifestream + public bool LifestreamAethernetTeleport(string aethernetName) => lifestream.AethernetTeleport(aethernetName); + public bool LifestreamTeleport(uint destination, byte subIndex) => lifestream.Teleport(destination, subIndex); + public bool LifestreamTeleportToHome() => lifestream.TeleportToHome(); + public bool LifestreamTeleportToFC() => lifestream.TeleportToFC(); + public bool LifestreamTeleportToApartment() => lifestream.TeleportToApartment(); + public bool LifestreamIsBusy() => lifestream.IsBusy(); + public void LifestreamExecuteCommand(string command) => lifestream.ExecuteCommand(command); + public void LifestreamAbort() => lifestream.Abort(); + #endregion }