Fix a potential issue around list not refreshing/turning in ghost items

This commit is contained in:
Liza 2023-10-06 13:07:41 +02:00
parent e3fa4d3895
commit 72cf3ebe5c
Signed by: liza
GPG Key ID: 7199F8D727D55F67
4 changed files with 42 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Version>2.0</Version>
<Version>2.1</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -155,11 +155,37 @@ partial class DeliverooPlugin
{
addonSupplyReward->AtkUnitBase.FireCallbackInt(0);
_continueAt = DateTime.Now.AddSeconds(0.58);
CurrentStage = Stage.FinalizeTurnIn;
CurrentStage = Stage.FinalizeTurnIn1;
}
}
private unsafe void FinalizeTurnInItem()
private unsafe void FinalizeTurnInItem1()
{
if (TryGetAddonByName<AddonGrandCompanySupplyList>("GrandCompanySupplyList",
out var addonSupplyList) && IsAddonReady(&addonSupplyList->AtkUnitBase))
{
addonSupplyList->AtkUnitBase.FireCallbackInt(2);
CurrentStage = Stage.FinalizeTurnIn2;
}
}
private unsafe void FinalizeTurnInItem2()
{
if (TryGetAddonByName<AddonGrandCompanySupplyList>("GrandCompanySupplyList",
out var addonSupplyList) && IsAddonReady(&addonSupplyList->AtkUnitBase))
{
var updateUnknown = stackalloc AtkValue[]
{
new() { Type = ValueType.Int, Int = 4 },
new() { Type = ValueType.Int, Int = 0 },
new() { Type = 0, Int = 0 }
};
addonSupplyList->AtkUnitBase.FireCallback(3, updateUnknown);
CurrentStage = Stage.FinalizeTurnIn3;
}
}
private unsafe void FinalizeTurnInItem3()
{
if (TryGetAddonByName<AddonGrandCompanySupplyList>("GrandCompanySupplyList",
out var addonSupplyList) && IsAddonReady(&addonSupplyList->AtkUnitBase))

View File

@ -234,8 +234,16 @@ public sealed partial class DeliverooPlugin : IDalamudPlugin
TurnInSelectedItem();
break;
case Stage.FinalizeTurnIn:
FinalizeTurnInItem();
case Stage.FinalizeTurnIn1:
FinalizeTurnInItem1();
break;
case Stage.FinalizeTurnIn2:
FinalizeTurnInItem2();
break;
case Stage.FinalizeTurnIn3:
FinalizeTurnInItem3();
break;
case Stage.CloseGcSupply:

View File

@ -7,7 +7,9 @@ internal enum Stage
SelectExpertDeliveryTab,
SelectItemToTurnIn,
TurnInSelected,
FinalizeTurnIn,
FinalizeTurnIn1,
FinalizeTurnIn2,
FinalizeTurnIn3,
CloseGcSupply,
CloseGcSupplyThenStop,