Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AutoDuty/Helpers/ActiveHelperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,10 @@ protected void DebugLog(string s)
{
Svc.Log.Debug($"{this.Name}: {s}");
}

protected void InfoLog(string s)
{
Svc.Log.Info($"{this.Name}: {s}");
}
}
}
27 changes: 14 additions & 13 deletions AutoDuty/Helpers/GCTurninHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ internal class GCTurninHelper : ActiveHelperBase<GCTurninHelper>

internal override void Start()
{
if (!Deliveroo_IPCSubscriber.IsEnabled)
Svc.Log.Info("GC Turnin Requires Deliveroo plugin. Get @ https://puni.sh/api/repository/vera");
if (!AutoRetainer_IPCSubscriber.IsEnabled)
Svc.Log.Info("GC Turnin Requires AutoRetainer plugin. Get @ https://love.puni.sh/ment.json");
else
base.Start();
}

internal override void Stop()
{
_deliverooStarted = false;
this._turninStarted = false;
GotoHelper.ForceStop();
base.Stop();
}
Expand All @@ -40,7 +40,7 @@ internal override void Stop()
private IGameObject? _personnelOfficerGameObject => ObjectHelper.GetObjectByDataId(_personnelOfficerDataId);
private static uint _personnelOfficerDataId => PlayerHelper.GetGrandCompany() == 1 ? 1002388u : (PlayerHelper.GetGrandCompany() == 2 ? 1002394u : 1002391u);
private static uint _aetheryteTicketId = PlayerHelper.GetGrandCompany() == 1 ? 21069u : (PlayerHelper.GetGrandCompany() == 2 ? 21070u : 21071u);
private bool _deliverooStarted = false;
private bool _turninStarted = false;

protected override unsafe void HelperStopUpdate(IFramework framework)
{
Expand All @@ -64,15 +64,15 @@ protected override unsafe void HelperUpdate(IFramework framework)
Stop();
return;
}
if (!_deliverooStarted && Deliveroo_IPCSubscriber.IsTurnInRunning())
if (!this._turninStarted && AutoRetainer_IPCSubscriber.IsBusy())
{
Svc.Log.Info("Deliveroo has Started");
_deliverooStarted = true;
InfoLog("TurnIn has Started");
this._turninStarted = true;
return;
}
else if (_deliverooStarted && !Deliveroo_IPCSubscriber.IsTurnInRunning())
else if (this._turninStarted && !AutoRetainer_IPCSubscriber.IsBusy())
{
DebugLog("Deliveroo is Complete");
DebugLog("TurnIn is Complete");
Stop();
return;
}
Expand Down Expand Up @@ -117,8 +117,9 @@ protected override unsafe void HelperUpdate(IFramework framework)
VNavmesh_IPCSubscriber.Path_Stop();
return;
}
else if (ObjectHelper.GetDistanceToPlayer(GCSupplyLocation) <= 4 && VNavmesh_IPCSubscriber.Path_NumWaypoints() == 0 && !_deliverooStarted)
else if (ObjectHelper.GetDistanceToPlayer(GCSupplyLocation) <= 4 && VNavmesh_IPCSubscriber.Path_NumWaypoints() == 0 && !this._turninStarted)
{
/*
if (_personnelOfficerGameObject == null)
return;
if (Svc.Targets.Target?.DataId != _personnelOfficerGameObject.DataId)
Expand All @@ -139,10 +140,10 @@ protected override unsafe void HelperUpdate(IFramework framework)
ObjectHelper.InteractWithObjectUntilAddon(_personnelOfficerGameObject, "SelectString");
}
}
else
else*/
{
DebugLog("Sending Chat Command /deliveroo e");
Plugin.Chat.SendMessage("/deliveroo e");
DebugLog("Starting TurnIn proper");
AutoRetainer_IPCSubscriber.EnqueueGCInitiation();
}
return;
}
Expand Down
14 changes: 1 addition & 13 deletions AutoDuty/IPC/IPCSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal static class AutoRetainer_IPCSubscriber
[EzIPC] internal static readonly Action EnableMultiMode;
[EzIPC] internal static readonly Func<int> GetInventoryFreeSlotCount;
[EzIPC] internal static readonly Action EnqueueHET;
[EzIPC("AutoRetainer.GC.EnqueueInitiation", applyPrefix: false)] internal static readonly Action EnqueueGCInitiation;

internal static void Dispose() => IPCSubscriber_Common.DisposeAll(_disposalTokens);
}
Expand Down Expand Up @@ -196,19 +197,6 @@ public static void SetState(bool on) =>
SetPluginEnabled(on);
}

internal static class Deliveroo_IPCSubscriber
{
private static EzIPCDisposalToken[] _disposalTokens = EzIPC.Init(typeof(Deliveroo_IPCSubscriber), "Deliveroo", SafeWrapper.IPCException);

internal static bool IsEnabled => IPCSubscriber_Common.IsReady("Deliveroo");

[EzIPC] internal static readonly Func<bool> IsTurnInRunning;
//[EzIPC] internal static readonly Action TurnInStarted;
//[EzIPC] internal static readonly Action TurnInStopped;

internal static void Dispose() => IPCSubscriber_Common.DisposeAll(_disposalTokens);
}

internal static class Gearsetter_IPCSubscriber
{
private static EzIPCDisposalToken[] _disposalTokens = EzIPC.Init(typeof(Gearsetter_IPCSubscriber), "Gearsetter", SafeWrapper.IPCException);
Expand Down
8 changes: 4 additions & 4 deletions AutoDuty/Windows/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ public static void Draw()
}
ImGui.NextColumn();
//ImGui.SameLine(0, 5);
using (ImRaii.Disabled(!Deliveroo_IPCSubscriber.IsEnabled))
using (ImRaii.Disabled(!AutoRetainer_IPCSubscriber.IsEnabled))
{
if (ImGui.Checkbox("Auto GC Turnin", ref Configuration.autoGCTurnin))
{
Expand Down Expand Up @@ -1929,17 +1929,17 @@ public static void Draw()
}
ImGui.Columns(1);

if (!Deliveroo_IPCSubscriber.IsEnabled)
if (!AutoRetainer_IPCSubscriber.IsEnabled)
{
if (Configuration.AutoGCTurnin)
{
Configuration.AutoGCTurnin = false;
Configuration.Save();
}
ImGui.Text("* Auto GC Turnin Requires Deliveroo plugin");
ImGui.Text("* Auto GC Turnin Requires AutoRetainer plugin");
ImGui.Text("Get @ ");
ImGui.SameLine(0, 0);
ImGuiEx.TextCopy(ImGuiHelper.LinkColor, @"https://puni.sh/api/repository/vera");
ImGuiEx.TextCopy(ImGuiHelper.LinkColor, @"https://love.puni.sh/ment.json");
}

if(ImGui.Checkbox("Triple Triad", ref Configuration.TripleTriadEnabled))
Expand Down
10 changes: 5 additions & 5 deletions AutoDuty/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ internal static void GotoAndActions()
{
if (ImGui.Button("TurnIn"))
{
if (Deliveroo_IPCSubscriber.IsEnabled)
if (AutoRetainer_IPCSubscriber.IsEnabled)
GCTurninHelper.Invoke();
else
ShowPopup("Missing Plugin", "GC Turnin Requires Deliveroo plugin. Get @ https://puni.sh/api/repository/vera");
ShowPopup("Missing Plugin", "GC Turnin Requires AutoRetainer plugin. Get @ https://love.puni.sh/ment.json");
}
if (Deliveroo_IPCSubscriber.IsEnabled)
ToolTip("Click to Goto GC Turnin and Invoke Deliveroo");
if (AutoRetainer_IPCSubscriber.IsEnabled)
ToolTip("Click to Goto GC Turnin and Invoke AutoRetainer's GC Turnin");
else
ToolTip("GC Turnin Requires Deliveroo plugin. Get @ https://puni.sh/api/repository/vera");
ToolTip("GC Turnin Requires AutoRetainer plugin. Get @ https://love.puni.sh/ment.json");
}
}
}
Expand Down