Skip to content

Commit

Permalink
add lifestream ipc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Aug 21, 2024
1 parent 2f798f2 commit 93f5413
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
20 changes: 20 additions & 0 deletions SomethingNeedDoing/IPC/LifestreamIPC.cs
Original file line number Diff line number Diff line change
@@ -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<string, bool> AethernetTeleport;
[EzIPC] public Func<uint, byte, bool> Teleport;
[EzIPC] public Func<bool> TeleportToHome;
[EzIPC] public Func<bool> TeleportToFC;
[EzIPC] public Func<bool> TeleportToApartment;
[EzIPC] public Func<bool> IsBusy;
[EzIPC] public Action<string> ExecuteCommand;
[EzIPC] public Action Abort;
}
13 changes: 12 additions & 1 deletion SomethingNeedDoing/Misc/Changelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 +" +
Expand Down
16 changes: 15 additions & 1 deletion SomethingNeedDoing/Misc/Commands/IpcCommands.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AutoRetainerAPI;
using Automaton.IPC;
using AutoRetainerAPI;
using SomethingNeedDoing.IPC;
using System;
using System.Collections.Generic;
Expand All @@ -11,6 +12,7 @@ public class IpcCommands
{
internal static IpcCommands Instance { get; } = new();
private readonly Dropbox dropbox;
private readonly LifestreamIPC lifestream;

public List<string> ListAllFunctions()
{
Expand All @@ -33,6 +35,7 @@ internal IpcCommands()
NavmeshIPC.Init();
DeliverooIPC.Init();
PandorasBoxIPC.Init();
lifestream = new();
dropbox = new();
}

Expand Down Expand Up @@ -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
}

0 comments on commit 93f5413

Please sign in to comment.