muffin v6.35 with old pdb

This commit is contained in:
alydev 2025-10-29 06:52:53 +10:00
parent ac85599236
commit b5d2cc6708
31 changed files with 958 additions and 958 deletions

View file

@ -10,9 +10,9 @@ public static class GatheringMath
public static (Vector3, int, float) CalculateLandingLocation(GatheringLocation location) public static (Vector3, int, float) CalculateLandingLocation(GatheringLocation location)
{ {
int num = ((!location.IsCone()) ? Rng.Next(0, 360) : Rng.Next(location.MinimumAngle.GetValueOrDefault(), location.MaximumAngle.GetValueOrDefault())); int rad = ((!location.IsCone()) ? Rng.Next(0, 360) : Rng.Next(location.MinimumAngle.GetValueOrDefault(), location.MaximumAngle.GetValueOrDefault()));
float num2 = (float)Rng.Next((int)(location.CalculateMinimumDistance() * 100f), (int)(location.CalculateMaximumDistance() * 100f)) / 100f; float num = (float)Rng.Next((int)(location.CalculateMinimumDistance() * 100f), (int)(location.CalculateMaximumDistance() * 100f)) / 100f;
return (CalculateLandingLocation(location.Position, num, num2), num, num2); return (CalculateLandingLocation(location.Position, rad, num), rad, num);
} }
public static Vector3 CalculateLandingLocation(GatheringLocation location, float angleScale, float rangeScale) public static Vector3 CalculateLandingLocation(GatheringLocation location, float angleScale, float rangeScale)

View file

@ -47,8 +47,8 @@ internal static class DoGather
public unsafe override ETaskResult Update() public unsafe override ETaskResult Update()
{ {
Task task = base.Task; Task pos = base.Task;
if ((object)task != null && task.RevisitRequired && !task.RevisitTriggered) if ((object)pos != null && pos.RevisitRequired && !pos.RevisitTriggered)
{ {
logger.LogInformation("No revisit"); logger.LogInformation("No revisit");
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
@ -69,23 +69,23 @@ internal static class DoGather
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
} }
_wasGathering = true; _wasGathering = true;
if (gameGui.TryGetAddonByName<AddonGathering>("Gathering", out var addonPtr2)) if (gameGui.TryGetAddonByName<AddonGathering>("Gathering", out var span))
{ {
if (gatheringController.HasRequestedItems()) if (gatheringController.HasRequestedItems())
{ {
addonPtr2->FireCallbackInt(-1); span->FireCallbackInt(-1);
} }
else else
{ {
List<SlotInfo> list = ReadSlots(addonPtr2); List<SlotInfo> indexOfPos = ReadSlots(span);
if (base.Task.Request.Collectability > 0) if (base.Task.Request.Collectability > 0)
{ {
SlotInfo slotInfo = list.Single((SlotInfo x) => x.ItemId == base.Task.Request.ItemId); SlotInfo slotInfo = indexOfPos.Single((SlotInfo x) => x.ItemId == base.Task.Request.ItemId);
addonPtr2->FireCallbackInt(slotInfo.Index); span->FireCallbackInt(slotInfo.Index);
} }
else else
{ {
NodeCondition nodeCondition = new NodeCondition(addonPtr2->AtkValues[110].UInt, addonPtr2->AtkValues[111].UInt); NodeCondition nodeCondition = new NodeCondition(span->AtkValues[110].UInt, span->AtkValues[111].UInt);
if (_actionQueue != null && _actionQueue.TryPeek(out var result)) if (_actionQueue != null && _actionQueue.TryPeek(out var result))
{ {
if (gameFunctions.UseAction(result)) if (gameFunctions.UseAction(result))
@ -95,16 +95,16 @@ internal static class DoGather
} }
return ETaskResult.StillRunning; return ETaskResult.StillRunning;
} }
_actionQueue = GetNextActions(nodeCondition, list); _actionQueue = GetNextActions(nodeCondition, indexOfPos);
if (_actionQueue == null) if (_actionQueue == null)
{ {
logger.LogInformation("Skipping the rest of gathering..."); logger.LogInformation("Skipping the rest of gathering...");
addonPtr2->FireCallbackInt(-1); span->FireCallbackInt(-1);
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
} }
if (_actionQueue.Count == 0) if (_actionQueue.Count == 0)
{ {
SlotInfo slotInfo2 = _slotToGather ?? list.SingleOrDefault((SlotInfo x) => x.ItemId == base.Task.Request.ItemId) ?? list.MinBy((SlotInfo x) => x.ItemId); SlotInfo slotInfo2 = _slotToGather ?? indexOfPos.SingleOrDefault((SlotInfo x) => x.ItemId == base.Task.Request.ItemId) ?? indexOfPos.MinBy((SlotInfo x) => x.ItemId);
switch (slotInfo2?.ItemId) switch (slotInfo2?.ItemId)
{ {
case 2u: case 2u:
@ -133,11 +133,11 @@ internal static class DoGather
} }
if (slotInfo2 != null) if (slotInfo2 != null)
{ {
addonPtr2->FireCallbackInt(slotInfo2.Index); span->FireCallbackInt(slotInfo2.Index);
} }
else else
{ {
addonPtr2->FireCallbackInt(-1); span->FireCallbackInt(-1);
} }
} }
} }
@ -153,32 +153,32 @@ internal static class DoGather
private unsafe List<SlotInfo> ReadSlots(AddonGathering* addonGathering) private unsafe List<SlotInfo> ReadSlots(AddonGathering* addonGathering)
{ {
List<SlotInfo> list = new List<SlotInfo>(); List<SlotInfo> pos = new List<SlotInfo>();
for (int i = 0; i < 8; i++) for (int matchStart = 0; matchStart < 8; matchStart++)
{ {
uint num = addonGathering->ItemIds[i]; uint slice = addonGathering->ItemIds[matchStart];
if (num != 0) if (slice != 0)
{ {
AtkComponentCheckBox* value = addonGathering->GatheredItemComponentCheckbox[i].Value; AtkComponentCheckBox* value = addonGathering->GatheredItemComponentCheckbox[matchStart].Value;
if (!int.TryParse(value->UldManager.SearchNodeById(10u)->GetAsAtkTextNode()->NodeText.ToString(), out var result)) if (!int.TryParse(value->UldManager.SearchNodeById(10u)->GetAsAtkTextNode()->NodeText.ToString(), out var iteration))
{
iteration = 0;
}
if (!int.TryParse(value->UldManager.SearchNodeById(16u)->GetAsAtkTextNode()->NodeText.ToString(), out var result))
{ {
result = 0; result = 0;
} }
if (!int.TryParse(value->UldManager.SearchNodeById(16u)->GetAsAtkTextNode()->NodeText.ToString(), out var result2))
{
result2 = 0;
}
AtkTextNode* asAtkTextNode = value->UldManager.SearchNodeById(31u)->GetAsAtkComponentNode()->Component->UldManager.SearchNodeById(7u)->GetAsAtkTextNode(); AtkTextNode* asAtkTextNode = value->UldManager.SearchNodeById(31u)->GetAsAtkComponentNode()->Component->UldManager.SearchNodeById(7u)->GetAsAtkTextNode();
if (!asAtkTextNode->IsVisible() || !int.TryParse(asAtkTextNode->NodeText.ToString(), out var result3)) if (!asAtkTextNode->IsVisible() || !int.TryParse(asAtkTextNode->NodeText.ToString(), out var result2))
{ {
result3 = 1; result2 = 1;
} }
SlotInfo item = new SlotInfo(i, num, result, result2, result3); SlotInfo item = new SlotInfo(matchStart, slice, iteration, result, result2);
list.Add(item); pos.Add(item);
} }
} }
logger.LogTrace("Slots: {Slots}", string.Join(", ", list)); logger.LogTrace("Slots: {Slots}", string.Join(", ", pos));
return list; return pos;
} }
private Queue<EAction>? GetNextActions(NodeCondition nodeCondition, List<SlotInfo> slots) private Queue<EAction>? GetNextActions(NodeCondition nodeCondition, List<SlotInfo> slots)

View file

@ -137,8 +137,8 @@ internal static class DoGatherCollectable
private Queue<EAction> GetNextActions(NodeCondition nodeCondition) private Queue<EAction> GetNextActions(NodeCondition nodeCondition)
{ {
uint currentGp = clientState.LocalPlayer.CurrentGp; uint currentPosition = clientState.LocalPlayer.CurrentGp;
logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", currentGp, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour); logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", currentPosition, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour);
Queue<EAction> queue = new Queue<EAction>(); Queue<EAction> queue = new Queue<EAction>();
uint num = nodeCondition.CollectabilityToGoal(base.Task.Request.Collectability); uint num = nodeCondition.CollectabilityToGoal(base.Task.Request.Collectability);
if (num <= nodeCondition.CollectabilityFromMeticulous) if (num <= nodeCondition.CollectabilityFromMeticulous)
@ -153,7 +153,7 @@ internal static class DoGatherCollectable
queue.Enqueue(PickAction(EAction.ScourMiner, EAction.ScourBotanist)); queue.Enqueue(PickAction(EAction.ScourMiner, EAction.ScourBotanist));
return queue; return queue;
} }
if (!nodeCondition.ScrutinyActive && currentGp >= 200) if (!nodeCondition.ScrutinyActive && currentPosition >= 200)
{ {
logger.LogTrace("Still missing {NeededCollectability} collectability, scrutiny inactive", num); logger.LogTrace("Still missing {NeededCollectability} collectability, scrutiny inactive", num);
queue.Enqueue(PickAction(EAction.ScrutinyMiner, EAction.ScrutinyBotanist)); queue.Enqueue(PickAction(EAction.ScrutinyMiner, EAction.ScrutinyBotanist));

View file

@ -83,10 +83,10 @@ internal static class SinglePlayerDuty
private unsafe bool DutyActionsAvailable() private unsafe bool DutyActionsAvailable()
{ {
ContentDirector* contentDirector = EventFramework.Instance()->GetContentDirector(); ContentDirector* nodeCondition = EventFramework.Instance()->GetContentDirector();
if (contentDirector != null) if (nodeCondition != null)
{ {
return contentDirector->DutyActionManager.ActionsPresent; return nodeCondition->DutyActionManager.ActionsPresent;
} }
return false; return false;
} }
@ -255,12 +255,12 @@ internal static class SinglePlayerDuty
{ {
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
} }
IGameObject gameObject = objectTable.FirstOrDefault((IGameObject x) => x.BaseId == base.Task.DataId); IGameObject logLevel = objectTable.FirstOrDefault((IGameObject x) => x.BaseId == base.Task.DataId);
if (gameObject == null) if (logLevel == null)
{ {
return ETaskResult.StillRunning; return ETaskResult.StillRunning;
} }
targetManager.Target = gameObject; targetManager.Target = logLevel;
return ETaskResult.StillRunning; return ETaskResult.StillRunning;
} }

View file

@ -94,10 +94,10 @@ internal sealed class MoveExecutor : TaskExecutor<MoveTask>, IToastAware, ITaskE
{ {
_canRestart = base.Task.RestartNavigation; _canRestart = base.Task.RestartNavigation;
_destination = base.Task.Destination; _destination = base.Task.Destination;
float num = base.Task.StopDistance ?? 3f; float addonContextIconMenu = base.Task.StopDistance ?? 3f;
Vector3? vector = _clientState.LocalPlayer?.Position; Vector3? parentId = _clientState.LocalPlayer?.Position;
float num2 = ((!vector.HasValue) ? float.MaxValue : Vector3.Distance(vector.Value, _destination)); float parentAddon = ((!parentId.HasValue) ? float.MaxValue : Vector3.Distance(parentId.Value, _destination));
if (num2 > num) if (parentAddon > addonContextIconMenu)
{ {
PrepareMovementIfNeeded(); PrepareMovementIfNeeded();
} }
@ -121,7 +121,7 @@ internal sealed class MoveExecutor : TaskExecutor<MoveTask>, IToastAware, ITaskE
} }
else if (!base.Task.DisableNavmesh) else if (!base.Task.DisableNavmesh)
{ {
Questionable.Controller.Steps.Common.Mount.EMountIf mountIf = ((!(num2 > num) || !base.Task.Fly || !_gameFunctions.IsFlyingUnlocked(base.Task.TerritoryId)) ? Questionable.Controller.Steps.Common.Mount.EMountIf.AwayFromPosition : Questionable.Controller.Steps.Common.Mount.EMountIf.Always); Questionable.Controller.Steps.Common.Mount.EMountIf mountIf = ((!(parentAddon > addonContextIconMenu) || !base.Task.Fly || !_gameFunctions.IsFlyingUnlocked(base.Task.TerritoryId)) ? Questionable.Controller.Steps.Common.Mount.EMountIf.AwayFromPosition : Questionable.Controller.Steps.Common.Mount.EMountIf.Always);
Questionable.Controller.Steps.Common.Mount.MountTask mountTask2 = new Questionable.Controller.Steps.Common.Mount.MountTask(base.Task.TerritoryId, mountIf, _destination); Questionable.Controller.Steps.Common.Mount.MountTask mountTask2 = new Questionable.Controller.Steps.Common.Mount.MountTask(base.Task.TerritoryId, mountIf, _destination);
DateTime retryAt = DateTime.Now; DateTime retryAt = DateTime.Now;
(Questionable.Controller.Steps.Common.Mount.MountExecutor, Questionable.Controller.Steps.Common.Mount.MountTask)? tuple; (Questionable.Controller.Steps.Common.Mount.MountExecutor, Questionable.Controller.Steps.Common.Mount.MountTask)? tuple;
@ -250,14 +250,14 @@ internal sealed class MoveExecutor : TaskExecutor<MoveTask>, IToastAware, ITaskE
public override bool WasInterrupted() public override bool WasInterrupted()
{ {
DateTime retryAt = DateTime.Now; DateTime addon = DateTime.Now;
if (base.Task.Fly && _condition[ConditionFlag.InCombat] && !_condition[ConditionFlag.Mounted]) if (base.Task.Fly && _condition[ConditionFlag.InCombat] && !_condition[ConditionFlag.Mounted])
{ {
(Questionable.Controller.Steps.Common.Mount.MountExecutor, Questionable.Controller.Steps.Common.Mount.MountTask)? mountBeforeMovement = _mountBeforeMovement; (Questionable.Controller.Steps.Common.Mount.MountExecutor, Questionable.Controller.Steps.Common.Mount.MountTask)? mountBeforeMovement = _mountBeforeMovement;
if (mountBeforeMovement.HasValue) if (mountBeforeMovement.HasValue)
{ {
Questionable.Controller.Steps.Common.Mount.MountTask item = mountBeforeMovement.GetValueOrDefault().Item2; Questionable.Controller.Steps.Common.Mount.MountTask item = mountBeforeMovement.GetValueOrDefault().Item2;
if ((object)item != null && _mountEvaluator.EvaluateMountState(item, dryRun: true, ref retryAt) == Questionable.Controller.Steps.Common.Mount.MountResult.WhenOutOfCombat) if ((object)item != null && _mountEvaluator.EvaluateMountState(item, dryRun: true, ref addon) == Questionable.Controller.Steps.Common.Mount.MountResult.WhenOutOfCombat)
{ {
return true; return true;
} }

View file

@ -179,26 +179,26 @@ internal sealed class CommandHandler : IDisposable
{ {
return; return;
} }
string[] array = arguments.Split(' '); string[] questId = arguments.Split(' ');
string text = array[0]; string questRoot = questId[0];
if (text == null) if (questRoot == null)
{ {
return; return;
} }
switch (text.Length) switch (questRoot.Length)
{ {
case 4: case 4:
switch (text[0]) switch (questRoot[0])
{ {
case 'n': case 'n':
if (text == "next") if (questRoot == "next")
{ {
SetNextQuest(array.Skip(1).ToArray()); SetNextQuest(questId.Skip(1).ToArray());
} }
break; break;
case 't': case 't':
{ {
if (!(text == "taxi")) if (!(questRoot == "taxi"))
{ {
break; break;
} }
@ -246,25 +246,25 @@ internal sealed class CommandHandler : IDisposable
} }
break; break;
case 12: case 12:
switch (text[0]) switch (questRoot[0])
{ {
case 'a': case 'a':
if (text == "abandon-duty") if (questRoot == "abandon-duty")
{ {
_gameFunctions.AbandonDuty(); _gameFunctions.AbandonDuty();
} }
break; break;
case 'u': case 'u':
{ {
if (!(text == "unlock-links")) if (!(questRoot == "unlock-links"))
{ {
break; break;
} }
IReadOnlyList<uint> unlockLinks = _gameFunctions.GetUnlockLinks(); IReadOnlyList<uint> questNode = _gameFunctions.GetUnlockLinks();
if (unlockLinks.Count >= 0) if (questNode.Count >= 0)
{ {
_chatGui.Print($"Saved {unlockLinks.Count} unlock links to log.", "Questionable", 576); _chatGui.Print($"Saved {questNode.Count} unlock links to log.", "Questionable", 576);
List<uint> list6 = unlockLinks.Except(_previouslyUnlockedUnlockLinks).ToList(); List<uint> list6 = questNode.Except(_previouslyUnlockedUnlockLinks).ToList();
if (_previouslyUnlockedUnlockLinks.Count > 0 && list6.Count > 0) if (_previouslyUnlockedUnlockLinks.Count > 0 && list6.Count > 0)
{ {
_chatGui.Print("New unlock links: " + string.Join(", ", list6), "Questionable", 576); _chatGui.Print("New unlock links: " + string.Join(", ", list6), "Questionable", 576);
@ -274,17 +274,17 @@ internal sealed class CommandHandler : IDisposable
{ {
_chatGui.PrintError("Could not query unlock links.", "Questionable", 576); _chatGui.PrintError("Could not query unlock links.", "Questionable", 576);
} }
_previouslyUnlockedUnlockLinks = unlockLinks; _previouslyUnlockedUnlockLinks = questNode;
break; break;
} }
} }
break; break;
case 9: case 9:
switch (text[0]) switch (questRoot[0])
{ {
case 'f': case 'f':
{ {
if (!(text == "festivals")) if (!(questRoot == "festivals"))
{ {
break; break;
} }
@ -312,7 +312,7 @@ internal sealed class CommandHandler : IDisposable
} }
case 'a': case 'a':
{ {
if (!(text == "aethernet")) if (!(questRoot == "aethernet"))
{ {
break; break;
} }
@ -327,13 +327,13 @@ internal sealed class CommandHandler : IDisposable
{ {
item7.Deconstruct(out key, out value10); item7.Deconstruct(out key, out value10);
EAetheryteLocation key2 = key; EAetheryteLocation key2 = key;
string text2 = value10; string text = value10;
if (aetheryteData.TerritoryIds.TryGetValue(key2, out var value11) && value11 == territoryType) if (aetheryteData.TerritoryIds.TryGetValue(key2, out var value11) && value11 == territoryType)
{ {
int num8 = text2.IndexOf(']', StringComparison.Ordinal); int num8 = text.IndexOf(']', StringComparison.Ordinal);
if (num8 > 0) if (num8 > 0)
{ {
string item3 = text2.Substring(1, num8 - 1); string item3 = text.Substring(1, num8 - 1);
hashSet2.Add(item3); hashSet2.Add(item3);
} }
} }
@ -347,21 +347,21 @@ internal sealed class CommandHandler : IDisposable
{ {
item8.Deconstruct(out key, out value10); item8.Deconstruct(out key, out value10);
EAetheryteLocation eAetheryteLocation = key; EAetheryteLocation eAetheryteLocation = key;
string text3 = value10; string text2 = value10;
int num9 = text3.IndexOf(']', StringComparison.Ordinal); int num9 = text2.IndexOf(']', StringComparison.Ordinal);
if (num9 <= 0) if (num9 <= 0)
{ {
continue; continue;
} }
string text4 = text3.Substring(1, num9 - 1); string text3 = text2.Substring(1, num9 - 1);
if (hashSet2.Contains(text4)) if (hashSet2.Contains(text3))
{ {
if (!dictionary.ContainsKey(text4)) if (!dictionary.ContainsKey(text3))
{ {
dictionary[text4] = new List<(EAetheryteLocation, string, bool)>(); dictionary[text3] = new List<(EAetheryteLocation, string, bool)>();
} }
bool item4 = _aetheryteFunctions.IsAetheryteUnlocked(eAetheryteLocation); bool item4 = _aetheryteFunctions.IsAetheryteUnlocked(eAetheryteLocation);
dictionary[text4].Add((eAetheryteLocation, text3, item4)); dictionary[text3].Add((eAetheryteLocation, text2, item4));
} }
} }
{ {
@ -404,32 +404,32 @@ internal sealed class CommandHandler : IDisposable
} }
break; break;
case 5: case 5:
if (text == "setup") if (questRoot == "setup")
{ {
_oneTimeSetupWindow.IsOpenAndUncollapsed = true; _oneTimeSetupWindow.IsOpenAndUncollapsed = true;
} }
break; break;
case 2: case 2:
if (text == "do") if (questRoot == "do")
{ {
ConfigureDebugOverlay(array.Skip(1).ToArray()); ConfigureDebugOverlay(questId.Skip(1).ToArray());
} }
break; break;
case 3: case 3:
if (text == "sim") if (questRoot == "sim")
{ {
SetSimulatedQuest(array.Skip(1).ToArray()); SetSimulatedQuest(questId.Skip(1).ToArray());
} }
break; break;
case 7: case 7:
if (text == "mountid") if (questRoot == "mountid")
{ {
PrintMountId(); PrintMountId();
} }
break; break;
case 11: case 11:
{ {
if (!(text == "quest-kills")) if (!(questRoot == "quest-kills"))
{ {
break; break;
} }
@ -629,21 +629,21 @@ internal sealed class CommandHandler : IDisposable
private void ConfigureDebugOverlay(string[] arguments) private void ConfigureDebugOverlay(string[] arguments)
{ {
ElementId elementId; ElementId name;
if (!_debugOverlay.DrawConditions()) if (!_debugOverlay.DrawConditions())
{ {
_chatGui.PrintError("You don't have the debug overlay enabled.", "Questionable", 576); _chatGui.PrintError("You don't have the debug overlay enabled.", "Questionable", 576);
} }
else if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out elementId) && elementId != null) else if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out name) && name != null)
{ {
if (_questRegistry.TryGetQuest(elementId, out Questionable.Model.Quest quest)) if (_questRegistry.TryGetQuest(name, out Questionable.Model.Quest quest))
{ {
_debugOverlay.HighlightedQuest = quest.Id; _debugOverlay.HighlightedQuest = quest.Id;
_chatGui.Print($"Set highlighted quest to {elementId} ({quest.Info.Name}).", "Questionable", 576); _chatGui.Print($"Set highlighted quest to {name} ({quest.Info.Name}).", "Questionable", 576);
} }
else else
{ {
_chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); _chatGui.PrintError($"Unknown quest {name}.", "Questionable", 576);
} }
} }
else else
@ -716,11 +716,11 @@ internal sealed class CommandHandler : IDisposable
private void PrintMountId() private void PrintMountId()
{ {
ushort? mountId = _gameFunctions.GetMountId(); ushort? allQuests = _gameFunctions.GetMountId();
if (mountId.HasValue) if (allQuests.HasValue)
{ {
Mount? rowOrDefault = _dataManager.GetExcelSheet<Mount>().GetRowOrDefault(mountId.Value); Mount? rowOrDefault = _dataManager.GetExcelSheet<Mount>().GetRowOrDefault(allQuests.Value);
_chatGui.Print($"Mount ID: {mountId}, Name: {rowOrDefault?.Singular}, Obtainable: {((rowOrDefault?.Order == -1) ? "No" : "Yes")}", "Questionable", 576); _chatGui.Print($"Mount ID: {allQuests}, Name: {rowOrDefault?.Singular}, Obtainable: {((rowOrDefault?.Order == -1) ? "No" : "Yes")}", "Questionable", 576);
} }
else else
{ {

View file

@ -233,17 +233,17 @@ internal sealed class GatheringController : MiniTaskController<GatheringControll
public override IList<string> GetRemainingTaskNames() public override IList<string> GetRemainingTaskNames()
{ {
ITask task = _taskQueue.CurrentTaskExecutor?.CurrentTask; ITask oldSequence = _taskQueue.CurrentTaskExecutor?.CurrentTask;
if (task != null) if (oldSequence != null)
{ {
string text = task.ToString() ?? "?"; string newSequence = oldSequence.ToString() ?? "?";
IList<string> remainingTaskNames = base.GetRemainingTaskNames(); IList<string> remainingTaskNames = base.GetRemainingTaskNames();
int num = 1 + remainingTaskNames.Count; int num = 1 + remainingTaskNames.Count;
List<string> list = new List<string>(num); List<string> list = new List<string>(num);
CollectionsMarshal.SetCount(list, num); CollectionsMarshal.SetCount(list, num);
Span<string> span = CollectionsMarshal.AsSpan(list); Span<string> span = CollectionsMarshal.AsSpan(list);
int num2 = 0; int num2 = 0;
span[num2] = text; span[num2] = newSequence;
num2++; num2++;
{ {
foreach (string item in remainingTaskNames) foreach (string item in remainingTaskNames)

View file

@ -925,11 +925,11 @@ internal sealed class AetheryteData
{ {
return float.MaxValue; return float.MaxValue;
} }
if (!AirshipLandingLocations.TryGetValue(to, out var value2)) if (!AirshipLandingLocations.TryGetValue(to, out var task))
{ {
return float.MaxValue; return float.MaxValue;
} }
return (fromPosition - value2).Length(); return (fromPosition - task).Length();
} }
public bool IsCityAetheryte(EAetheryteLocation aetheryte) public bool IsCityAetheryte(EAetheryteLocation aetheryte)
@ -938,8 +938,8 @@ internal sealed class AetheryteData
{ {
return true; return true;
} }
ushort value = TerritoryIds[aetheryte]; ushort toastAware = TerritoryIds[aetheryte];
return TownTerritoryIds.Contains(value); return TownTerritoryIds.Contains(toastAware);
} }
public bool IsAirshipLanding(EAetheryteLocation aetheryte) public bool IsAirshipLanding(EAetheryteLocation aetheryte)

View file

@ -147,10 +147,10 @@ internal sealed class QuestData
span[num2] = new AethernetQuestInfo(new AethernetId(14), "Tuliyollal"); span[num2] = new AethernetQuestInfo(new AethernetId(14), "Tuliyollal");
num2++; num2++;
span[num2] = new AethernetQuestInfo(new AethernetId(15), "Solution Nine"); span[num2] = new AethernetQuestInfo(new AethernetId(15), "Solution Nine");
List<AethernetQuestInfo> collection = list2; List<AethernetQuestInfo> currentSequence = list2;
List<AetherCurrentQuestInfo> collection2 = new List<AetherCurrentQuestInfo>(); List<AetherCurrentQuestInfo> currentStep = new List<AetherCurrentQuestInfo>();
quests.AddRange(collection); quests.AddRange(currentSequence);
quests.AddRange(collection2); quests.AddRange(currentStep);
_quests = quests.ToDictionary((IQuestInfo x) => x.QuestId, (IQuestInfo x) => x); _quests = quests.ToDictionary((IQuestInfo x) => x.QuestId, (IQuestInfo x) => x);
AddPreviousQuest(new QuestId(425), new QuestId(495)); AddPreviousQuest(new QuestId(425), new QuestId(495));
AddPreviousQuest(new QuestId(1480), new QuestId(2373)); AddPreviousQuest(new QuestId(1480), new QuestId(2373));
@ -267,7 +267,7 @@ internal sealed class QuestData
private void AddPreviousQuest(QuestId questToUpdate, QuestId requiredQuestId) private void AddPreviousQuest(QuestId questToUpdate, QuestId requiredQuestId)
{ {
if (_quests.TryGetValue(questToUpdate, out IQuestInfo value) && value is QuestInfo questInfo) if (_quests.TryGetValue(questToUpdate, out IQuestInfo stoppableTaskExecutor) && stoppableTaskExecutor is QuestInfo questInfo)
{ {
questInfo.AddPreviousQuest(new PreviousQuestInfo(requiredQuestId, 0)); questInfo.AddPreviousQuest(new PreviousQuestInfo(requiredQuestId, 0));
} }
@ -275,16 +275,16 @@ internal sealed class QuestData
private void AddGcFollowUpQuests() private void AddGcFollowUpQuests()
{ {
QuestId[] array = new QuestId[3] QuestId[] scope = new QuestId[3]
{ {
new QuestId(683), new QuestId(683),
new QuestId(684), new QuestId(684),
new QuestId(685) new QuestId(685)
}; };
QuestId[] array2 = array; QuestId[] array = scope;
foreach (QuestId questId in array2) foreach (QuestId questId in array)
{ {
((QuestInfo)_quests[questId]).AddQuestLocks(EQuestJoin.AtLeastOne, array.Where((QuestId x) => x != questId).ToArray()); ((QuestInfo)_quests[questId]).AddQuestLocks(EQuestJoin.AtLeastOne, scope.Where((QuestId x) => x != questId).ToArray());
} }
} }
@ -950,8 +950,8 @@ internal sealed class QuestData
public unsafe List<QuestId> GetLockedClassQuests() public unsafe List<QuestId> GetLockedClassQuests()
{ {
PlayerState* ptr = PlayerState.Instance(); PlayerState* ptr = PlayerState.Instance();
EClassJob eClassJob = (EClassJob)((ptr != null) ? ptr->FirstClass : 0); EClassJob scope = (EClassJob)((ptr != null) ? ptr->FirstClass : 0);
if (eClassJob == EClassJob.Adventurer) if (scope == EClassJob.Adventurer)
{ {
return new List<QuestId>(); return new List<QuestId>();
} }
@ -962,7 +962,7 @@ internal sealed class QuestData
int num2 = 0; int num2 = 0;
ref List<ushort> reference = ref span[num2]; ref List<ushort> reference = ref span[num2];
List<ushort> list2; List<ushort> list2;
if (eClassJob != EClassJob.Gladiator) if (scope != EClassJob.Gladiator)
{ {
int num3 = 2; int num3 = 2;
list2 = new List<ushort>(num3); list2 = new List<ushort>(num3);
@ -992,7 +992,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference2 = ref span[num2]; ref List<ushort> reference2 = ref span[num2];
List<ushort> list3; List<ushort> list3;
if (eClassJob != EClassJob.Pugilist) if (scope != EClassJob.Pugilist)
{ {
int num3 = 2; int num3 = 2;
list3 = new List<ushort>(num3); list3 = new List<ushort>(num3);
@ -1022,7 +1022,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference3 = ref span[num2]; ref List<ushort> reference3 = ref span[num2];
List<ushort> list4; List<ushort> list4;
if (eClassJob != EClassJob.Marauder) if (scope != EClassJob.Marauder)
{ {
int num3 = 2; int num3 = 2;
list4 = new List<ushort>(num3); list4 = new List<ushort>(num3);
@ -1052,7 +1052,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference4 = ref span[num2]; ref List<ushort> reference4 = ref span[num2];
List<ushort> list5; List<ushort> list5;
if (eClassJob != EClassJob.Lancer) if (scope != EClassJob.Lancer)
{ {
int num3 = 2; int num3 = 2;
list5 = new List<ushort>(num3); list5 = new List<ushort>(num3);
@ -1082,7 +1082,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference5 = ref span[num2]; ref List<ushort> reference5 = ref span[num2];
List<ushort> list6; List<ushort> list6;
if (eClassJob != EClassJob.Archer) if (scope != EClassJob.Archer)
{ {
int num3 = 2; int num3 = 2;
list6 = new List<ushort>(num3); list6 = new List<ushort>(num3);
@ -1112,7 +1112,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference6 = ref span[num2]; ref List<ushort> reference6 = ref span[num2];
List<ushort> list7; List<ushort> list7;
if (eClassJob != EClassJob.Conjurer) if (scope != EClassJob.Conjurer)
{ {
int num3 = 2; int num3 = 2;
list7 = new List<ushort>(num3); list7 = new List<ushort>(num3);
@ -1142,7 +1142,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference7 = ref span[num2]; ref List<ushort> reference7 = ref span[num2];
List<ushort> list8; List<ushort> list8;
if (eClassJob != EClassJob.Thaumaturge) if (scope != EClassJob.Thaumaturge)
{ {
int num3 = 2; int num3 = 2;
list8 = new List<ushort>(num3); list8 = new List<ushort>(num3);
@ -1172,7 +1172,7 @@ internal sealed class QuestData
num2++; num2++;
ref List<ushort> reference8 = ref span[num2]; ref List<ushort> reference8 = ref span[num2];
List<ushort> list9; List<ushort> list9;
if (eClassJob != EClassJob.Arcanist) if (scope != EClassJob.Arcanist)
{ {
int num3 = 2; int num3 = 2;
list9 = new List<ushort>(num3); list9 = new List<ushort>(num3);
@ -1205,13 +1205,13 @@ internal sealed class QuestData
public void ApplySeasonalOverride(ElementId questId, bool isSeasonal, DateTime? expiry) public void ApplySeasonalOverride(ElementId questId, bool isSeasonal, DateTime? expiry)
{ {
if (_quests.TryGetValue(questId, out IQuestInfo value) && value is QuestInfo questInfo) if (_quests.TryGetValue(questId, out IQuestInfo scope) && scope is QuestInfo questInfo)
{ {
DateTime? seasonalQuestExpiry = null; DateTime? seasonalQuestExpiry = null;
if (expiry.HasValue) if (expiry.HasValue)
{ {
DateTime value2 = expiry.Value; DateTime value = expiry.Value;
seasonalQuestExpiry = ((!(value2.TimeOfDay == TimeSpan.Zero)) ? new DateTime?((value2.Kind == DateTimeKind.Utc) ? value2 : value2.ToUniversalTime()) : new DateTime?(EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(value2)))); seasonalQuestExpiry = ((!(value.TimeOfDay == TimeSpan.Zero)) ? new DateTime?((value.Kind == DateTimeKind.Utc) ? value : value.ToUniversalTime()) : new DateTime?(EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(value))));
} }
questInfo.IsSeasonalQuest = isSeasonal; questInfo.IsSeasonalQuest = isSeasonal;
questInfo.SeasonalQuestExpiry = seasonalQuestExpiry; questInfo.SeasonalQuestExpiry = seasonalQuestExpiry;
@ -1232,382 +1232,382 @@ internal sealed class QuestData
static QuestData() static QuestData()
{ {
Dictionary<uint, List<ushort>> dictionary = new Dictionary<uint, List<ushort>>(); Dictionary<uint, List<ushort>> dictionary = new Dictionary<uint, List<ushort>>();
int num = 4; int seq = 4;
List<ushort> list = new List<ushort>(num); List<ushort> list = new List<ushort>(seq);
CollectionsMarshal.SetCount(list, num); CollectionsMarshal.SetCount(list, seq);
Span<ushort> span = CollectionsMarshal.AsSpan(list); Span<ushort> step = CollectionsMarshal.AsSpan(list);
int num2 = 0; int createTasks = 0;
span[num2] = 1744; step[createTasks] = 1744;
num2++; createTasks++;
span[num2] = 1759; step[createTasks] = 1759;
num2++; createTasks++;
span[num2] = 1760; step[createTasks] = 1760;
num2++; createTasks++;
span[num2] = 2111; step[createTasks] = 2111;
dictionary.Add(397u, list); dictionary.Add(397u, list);
num2 = 4; createTasks = 4;
List<ushort> list2 = new List<ushort>(num2); List<ushort> list2 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list2, num2); CollectionsMarshal.SetCount(list2, createTasks);
span = CollectionsMarshal.AsSpan(list2); step = CollectionsMarshal.AsSpan(list2);
num = 0; seq = 0;
span[num] = 1771; step[seq] = 1771;
num++; seq++;
span[num] = 1790; step[seq] = 1790;
num++; seq++;
span[num] = 1797; step[seq] = 1797;
num++; seq++;
span[num] = 1802; step[seq] = 1802;
dictionary.Add(398u, list2); dictionary.Add(398u, list2);
num = 4; seq = 4;
List<ushort> list3 = new List<ushort>(num); List<ushort> list3 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list3, num); CollectionsMarshal.SetCount(list3, seq);
span = CollectionsMarshal.AsSpan(list3); step = CollectionsMarshal.AsSpan(list3);
num2 = 0; createTasks = 0;
span[num2] = 1936; step[createTasks] = 1936;
num2++; createTasks++;
span[num2] = 1945; step[createTasks] = 1945;
num2++; createTasks++;
span[num2] = 1963; step[createTasks] = 1963;
num2++; createTasks++;
span[num2] = 1966; step[createTasks] = 1966;
dictionary.Add(399u, list3); dictionary.Add(399u, list3);
num2 = 4; createTasks = 4;
List<ushort> list4 = new List<ushort>(num2); List<ushort> list4 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list4, num2); CollectionsMarshal.SetCount(list4, createTasks);
span = CollectionsMarshal.AsSpan(list4); step = CollectionsMarshal.AsSpan(list4);
num = 0; seq = 0;
span[num] = 1819; step[seq] = 1819;
num++; seq++;
span[num] = 1823; step[seq] = 1823;
num++; seq++;
span[num] = 1828; step[seq] = 1828;
num++; seq++;
span[num] = 1835; step[seq] = 1835;
dictionary.Add(400u, list4); dictionary.Add(400u, list4);
num = 4; seq = 4;
List<ushort> list5 = new List<ushort>(num); List<ushort> list5 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list5, num); CollectionsMarshal.SetCount(list5, seq);
span = CollectionsMarshal.AsSpan(list5); step = CollectionsMarshal.AsSpan(list5);
num2 = 0; createTasks = 0;
span[num2] = 1748; step[createTasks] = 1748;
num2++; createTasks++;
span[num2] = 1874; step[createTasks] = 1874;
num2++; createTasks++;
span[num2] = 1909; step[createTasks] = 1909;
num2++; createTasks++;
span[num2] = 1910; step[createTasks] = 1910;
dictionary.Add(401u, list5); dictionary.Add(401u, list5);
num2 = 4; createTasks = 4;
List<ushort> list6 = new List<ushort>(num2); List<ushort> list6 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list6, num2); CollectionsMarshal.SetCount(list6, createTasks);
span = CollectionsMarshal.AsSpan(list6); step = CollectionsMarshal.AsSpan(list6);
num = 0; seq = 0;
span[num] = 2639; step[seq] = 2639;
num++; seq++;
span[num] = 2661; step[seq] = 2661;
num++; seq++;
span[num] = 2816; step[seq] = 2816;
num++; seq++;
span[num] = 2821; step[seq] = 2821;
dictionary.Add(612u, list6); dictionary.Add(612u, list6);
num = 4; seq = 4;
List<ushort> list7 = new List<ushort>(num); List<ushort> list7 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list7, num); CollectionsMarshal.SetCount(list7, seq);
span = CollectionsMarshal.AsSpan(list7); step = CollectionsMarshal.AsSpan(list7);
num2 = 0; createTasks = 0;
span[num2] = 2632; step[createTasks] = 2632;
num2++; createTasks++;
span[num2] = 2673; step[createTasks] = 2673;
num2++; createTasks++;
span[num2] = 2687; step[createTasks] = 2687;
num2++; createTasks++;
span[num2] = 2693; step[createTasks] = 2693;
dictionary.Add(613u, list7); dictionary.Add(613u, list7);
num2 = 4; createTasks = 4;
List<ushort> list8 = new List<ushort>(num2); List<ushort> list8 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list8, num2); CollectionsMarshal.SetCount(list8, createTasks);
span = CollectionsMarshal.AsSpan(list8); step = CollectionsMarshal.AsSpan(list8);
num = 0; seq = 0;
span[num] = 2724; step[seq] = 2724;
num++; seq++;
span[num] = 2728; step[seq] = 2728;
num++; seq++;
span[num] = 2730; step[seq] = 2730;
num++; seq++;
span[num] = 2733; step[seq] = 2733;
dictionary.Add(614u, list8); dictionary.Add(614u, list8);
num = 4; seq = 4;
List<ushort> list9 = new List<ushort>(num); List<ushort> list9 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list9, num); CollectionsMarshal.SetCount(list9, seq);
span = CollectionsMarshal.AsSpan(list9); step = CollectionsMarshal.AsSpan(list9);
num2 = 0; createTasks = 0;
span[num2] = 2655; step[createTasks] = 2655;
num2++; createTasks++;
span[num2] = 2842; step[createTasks] = 2842;
num2++; createTasks++;
span[num2] = 2851; step[createTasks] = 2851;
num2++; createTasks++;
span[num2] = 2860; step[createTasks] = 2860;
dictionary.Add(620u, list9); dictionary.Add(620u, list9);
num2 = 4; createTasks = 4;
List<ushort> list10 = new List<ushort>(num2); List<ushort> list10 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list10, num2); CollectionsMarshal.SetCount(list10, createTasks);
span = CollectionsMarshal.AsSpan(list10); step = CollectionsMarshal.AsSpan(list10);
num = 0; seq = 0;
span[num] = 2877; step[seq] = 2877;
num++; seq++;
span[num] = 2880; step[seq] = 2880;
num++; seq++;
span[num] = 2881; step[seq] = 2881;
num++; seq++;
span[num] = 2883; step[seq] = 2883;
dictionary.Add(621u, list10); dictionary.Add(621u, list10);
num = 4; seq = 4;
List<ushort> list11 = new List<ushort>(num); List<ushort> list11 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list11, num); CollectionsMarshal.SetCount(list11, seq);
span = CollectionsMarshal.AsSpan(list11); step = CollectionsMarshal.AsSpan(list11);
num2 = 0; createTasks = 0;
span[num2] = 2760; step[createTasks] = 2760;
num2++; createTasks++;
span[num2] = 2771; step[createTasks] = 2771;
num2++; createTasks++;
span[num2] = 2782; step[createTasks] = 2782;
num2++; createTasks++;
span[num2] = 2791; step[createTasks] = 2791;
dictionary.Add(622u, list11); dictionary.Add(622u, list11);
num2 = 4; createTasks = 4;
List<ushort> list12 = new List<ushort>(num2); List<ushort> list12 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list12, num2); CollectionsMarshal.SetCount(list12, createTasks);
span = CollectionsMarshal.AsSpan(list12); step = CollectionsMarshal.AsSpan(list12);
num = 0; seq = 0;
span[num] = 3380; step[seq] = 3380;
num++; seq++;
span[num] = 3384; step[seq] = 3384;
num++; seq++;
span[num] = 3385; step[seq] = 3385;
num++; seq++;
span[num] = 3386; step[seq] = 3386;
dictionary.Add(813u, list12); dictionary.Add(813u, list12);
num = 4; seq = 4;
List<ushort> list13 = new List<ushort>(num); List<ushort> list13 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list13, num); CollectionsMarshal.SetCount(list13, seq);
span = CollectionsMarshal.AsSpan(list13); step = CollectionsMarshal.AsSpan(list13);
num2 = 0; createTasks = 0;
span[num2] = 3360; step[createTasks] = 3360;
num2++; createTasks++;
span[num2] = 3371; step[createTasks] = 3371;
num2++; createTasks++;
span[num2] = 3537; step[createTasks] = 3537;
num2++; createTasks++;
span[num2] = 3556; step[createTasks] = 3556;
dictionary.Add(814u, list13); dictionary.Add(814u, list13);
num2 = 4; createTasks = 4;
List<ushort> list14 = new List<ushort>(num2); List<ushort> list14 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list14, num2); CollectionsMarshal.SetCount(list14, createTasks);
span = CollectionsMarshal.AsSpan(list14); step = CollectionsMarshal.AsSpan(list14);
num = 0; seq = 0;
span[num] = 3375; step[seq] = 3375;
num++; seq++;
span[num] = 3503; step[seq] = 3503;
num++; seq++;
span[num] = 3511; step[seq] = 3511;
num++; seq++;
span[num] = 3525; step[seq] = 3525;
dictionary.Add(815u, list14); dictionary.Add(815u, list14);
num = 4; seq = 4;
List<ushort> list15 = new List<ushort>(num); List<ushort> list15 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list15, num); CollectionsMarshal.SetCount(list15, seq);
span = CollectionsMarshal.AsSpan(list15); step = CollectionsMarshal.AsSpan(list15);
num2 = 0; createTasks = 0;
span[num2] = 3395; step[createTasks] = 3395;
num2++; createTasks++;
span[num2] = 3398; step[createTasks] = 3398;
num2++; createTasks++;
span[num2] = 3404; step[createTasks] = 3404;
num2++; createTasks++;
span[num2] = 3427; step[createTasks] = 3427;
dictionary.Add(816u, list15); dictionary.Add(816u, list15);
num2 = 4; createTasks = 4;
List<ushort> list16 = new List<ushort>(num2); List<ushort> list16 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list16, num2); CollectionsMarshal.SetCount(list16, createTasks);
span = CollectionsMarshal.AsSpan(list16); step = CollectionsMarshal.AsSpan(list16);
num = 0; seq = 0;
span[num] = 3444; step[seq] = 3444;
num++; seq++;
span[num] = 3467; step[seq] = 3467;
num++; seq++;
span[num] = 3478; step[seq] = 3478;
num++; seq++;
span[num] = 3656; step[seq] = 3656;
dictionary.Add(817u, list16); dictionary.Add(817u, list16);
num = 4; seq = 4;
List<ushort> list17 = new List<ushort>(num); List<ushort> list17 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list17, num); CollectionsMarshal.SetCount(list17, seq);
span = CollectionsMarshal.AsSpan(list17); step = CollectionsMarshal.AsSpan(list17);
num2 = 0; createTasks = 0;
span[num2] = 3588; step[createTasks] = 3588;
num2++; createTasks++;
span[num2] = 3592; step[createTasks] = 3592;
num2++; createTasks++;
span[num2] = 3593; step[createTasks] = 3593;
num2++; createTasks++;
span[num2] = 3594; step[createTasks] = 3594;
dictionary.Add(818u, list17); dictionary.Add(818u, list17);
num2 = 4; createTasks = 4;
List<ushort> list18 = new List<ushort>(num2); List<ushort> list18 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list18, num2); CollectionsMarshal.SetCount(list18, createTasks);
span = CollectionsMarshal.AsSpan(list18); step = CollectionsMarshal.AsSpan(list18);
num = 0; seq = 0;
span[num] = 4320; step[seq] = 4320;
num++; seq++;
span[num] = 4329; step[seq] = 4329;
num++; seq++;
span[num] = 4480; step[seq] = 4480;
num++; seq++;
span[num] = 4484; step[seq] = 4484;
dictionary.Add(956u, list18); dictionary.Add(956u, list18);
num = 4; seq = 4;
List<ushort> list19 = new List<ushort>(num); List<ushort> list19 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list19, num); CollectionsMarshal.SetCount(list19, seq);
span = CollectionsMarshal.AsSpan(list19); step = CollectionsMarshal.AsSpan(list19);
num2 = 0; createTasks = 0;
span[num2] = 4203; step[createTasks] = 4203;
num2++; createTasks++;
span[num2] = 4257; step[createTasks] = 4257;
num2++; createTasks++;
span[num2] = 4259; step[createTasks] = 4259;
num2++; createTasks++;
span[num2] = 4489; step[createTasks] = 4489;
dictionary.Add(957u, list19); dictionary.Add(957u, list19);
num2 = 4; createTasks = 4;
List<ushort> list20 = new List<ushort>(num2); List<ushort> list20 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list20, num2); CollectionsMarshal.SetCount(list20, createTasks);
span = CollectionsMarshal.AsSpan(list20); step = CollectionsMarshal.AsSpan(list20);
num = 0; seq = 0;
span[num] = 4216; step[seq] = 4216;
num++; seq++;
span[num] = 4232; step[seq] = 4232;
num++; seq++;
span[num] = 4498; step[seq] = 4498;
num++; seq++;
span[num] = 4502; step[seq] = 4502;
dictionary.Add(958u, list20); dictionary.Add(958u, list20);
num = 4; seq = 4;
List<ushort> list21 = new List<ushort>(num); List<ushort> list21 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list21, num); CollectionsMarshal.SetCount(list21, seq);
span = CollectionsMarshal.AsSpan(list21); step = CollectionsMarshal.AsSpan(list21);
num2 = 0; createTasks = 0;
span[num2] = 4240; step[createTasks] = 4240;
num2++; createTasks++;
span[num2] = 4241; step[createTasks] = 4241;
num2++; createTasks++;
span[num2] = 4253; step[createTasks] = 4253;
num2++; createTasks++;
span[num2] = 4516; step[createTasks] = 4516;
dictionary.Add(959u, list21); dictionary.Add(959u, list21);
num2 = 4; createTasks = 4;
List<ushort> list22 = new List<ushort>(num2); List<ushort> list22 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list22, num2); CollectionsMarshal.SetCount(list22, createTasks);
span = CollectionsMarshal.AsSpan(list22); step = CollectionsMarshal.AsSpan(list22);
num = 0; seq = 0;
span[num] = 4342; step[seq] = 4342;
num++; seq++;
span[num] = 4346; step[seq] = 4346;
num++; seq++;
span[num] = 4354; step[seq] = 4354;
num++; seq++;
span[num] = 4355; step[seq] = 4355;
dictionary.Add(960u, list22); dictionary.Add(960u, list22);
num = 4; seq = 4;
List<ushort> list23 = new List<ushort>(num); List<ushort> list23 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list23, num); CollectionsMarshal.SetCount(list23, seq);
span = CollectionsMarshal.AsSpan(list23); step = CollectionsMarshal.AsSpan(list23);
num2 = 0; createTasks = 0;
span[num2] = 4288; step[createTasks] = 4288;
num2++; createTasks++;
span[num2] = 4313; step[createTasks] = 4313;
num2++; createTasks++;
span[num2] = 4507; step[createTasks] = 4507;
num2++; createTasks++;
span[num2] = 4511; step[createTasks] = 4511;
dictionary.Add(961u, list23); dictionary.Add(961u, list23);
num2 = 4; createTasks = 4;
List<ushort> list24 = new List<ushort>(num2); List<ushort> list24 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list24, num2); CollectionsMarshal.SetCount(list24, createTasks);
span = CollectionsMarshal.AsSpan(list24); step = CollectionsMarshal.AsSpan(list24);
num = 0; seq = 0;
span[num] = 5039; step[seq] = 5039;
num++; seq++;
span[num] = 5047; step[seq] = 5047;
num++; seq++;
span[num] = 5051; step[seq] = 5051;
num++; seq++;
span[num] = 5055; step[seq] = 5055;
dictionary.Add(1187u, list24); dictionary.Add(1187u, list24);
num = 4; seq = 4;
List<ushort> list25 = new List<ushort>(num); List<ushort> list25 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list25, num); CollectionsMarshal.SetCount(list25, seq);
span = CollectionsMarshal.AsSpan(list25); step = CollectionsMarshal.AsSpan(list25);
num2 = 0; createTasks = 0;
span[num2] = 5064; step[createTasks] = 5064;
num2++; createTasks++;
span[num2] = 5074; step[createTasks] = 5074;
num2++; createTasks++;
span[num2] = 5081; step[createTasks] = 5081;
num2++; createTasks++;
span[num2] = 5085; step[createTasks] = 5085;
dictionary.Add(1188u, list25); dictionary.Add(1188u, list25);
num2 = 4; createTasks = 4;
List<ushort> list26 = new List<ushort>(num2); List<ushort> list26 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list26, num2); CollectionsMarshal.SetCount(list26, createTasks);
span = CollectionsMarshal.AsSpan(list26); step = CollectionsMarshal.AsSpan(list26);
num = 0; seq = 0;
span[num] = 5094; step[seq] = 5094;
num++; seq++;
span[num] = 5103; step[seq] = 5103;
num++; seq++;
span[num] = 5110; step[seq] = 5110;
num++; seq++;
span[num] = 5114; step[seq] = 5114;
dictionary.Add(1189u, list26); dictionary.Add(1189u, list26);
num = 4; seq = 4;
List<ushort> list27 = new List<ushort>(num); List<ushort> list27 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list27, num); CollectionsMarshal.SetCount(list27, seq);
span = CollectionsMarshal.AsSpan(list27); step = CollectionsMarshal.AsSpan(list27);
num2 = 0; createTasks = 0;
span[num2] = 5130; step[createTasks] = 5130;
num2++; createTasks++;
span[num2] = 5138; step[createTasks] = 5138;
num2++; createTasks++;
span[num2] = 5140; step[createTasks] = 5140;
num2++; createTasks++;
span[num2] = 5144; step[createTasks] = 5144;
dictionary.Add(1190u, list27); dictionary.Add(1190u, list27);
num2 = 4; createTasks = 4;
List<ushort> list28 = new List<ushort>(num2); List<ushort> list28 = new List<ushort>(createTasks);
CollectionsMarshal.SetCount(list28, num2); CollectionsMarshal.SetCount(list28, createTasks);
span = CollectionsMarshal.AsSpan(list28); step = CollectionsMarshal.AsSpan(list28);
num = 0; seq = 0;
span[num] = 5153; step[seq] = 5153;
num++; seq++;
span[num] = 5156; step[seq] = 5156;
num++; seq++;
span[num] = 5159; step[seq] = 5159;
num++; seq++;
span[num] = 5160; step[seq] = 5160;
dictionary.Add(1191u, list28); dictionary.Add(1191u, list28);
num = 4; seq = 4;
List<ushort> list29 = new List<ushort>(num); List<ushort> list29 = new List<ushort>(seq);
CollectionsMarshal.SetCount(list29, num); CollectionsMarshal.SetCount(list29, seq);
span = CollectionsMarshal.AsSpan(list29); step = CollectionsMarshal.AsSpan(list29);
num2 = 0; createTasks = 0;
span[num2] = 5174; step[createTasks] = 5174;
num2++; createTasks++;
span[num2] = 5176; step[createTasks] = 5176;
num2++; createTasks++;
span[num2] = 5178; step[createTasks] = 5178;
num2++; createTasks++;
span[num2] = 5179; step[createTasks] = 5179;
dictionary.Add(1192u, list29); dictionary.Add(1192u, list29);
AetherCurrentQuestsByTerritory = dictionary.ToImmutableDictionary((KeyValuePair<uint, List<ushort>> x) => x.Key, (KeyValuePair<uint, List<ushort>> x) => x.Value.Select((ushort y) => new QuestId(y)).ToImmutableList()); AetherCurrentQuestsByTerritory = dictionary.ToImmutableDictionary((KeyValuePair<uint, List<ushort>> x) => x.Key, (KeyValuePair<uint, List<ushort>> x) => x.Value.Select((ushort y) => new QuestId(y)).ToImmutableList());
AetherCurrentQuests = AetherCurrentQuestsByTerritory.Values.SelectMany((ImmutableList<QuestId> x) => x).ToImmutableHashSet(); AetherCurrentQuests = AetherCurrentQuestsByTerritory.Values.SelectMany((ImmutableList<QuestId> x) => x).ToImmutableHashSet();

View file

@ -80,12 +80,12 @@ internal sealed class TerritoryData
public string GetNameAndId(ushort territoryId) public string GetNameAndId(ushort territoryId)
{ {
string name = GetName(territoryId); string t = GetName(territoryId);
if (name != null) if (t != null)
{ {
IFormatProvider invariantCulture = CultureInfo.InvariantCulture; IFormatProvider invariantCulture = CultureInfo.InvariantCulture;
DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(3, 2, invariantCulture); DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(3, 2, invariantCulture);
handler.AppendFormatted(name); handler.AppendFormatted(t);
handler.AppendLiteral(" ("); handler.AppendLiteral(" (");
handler.AppendFormatted(territoryId); handler.AppendFormatted(territoryId);
handler.AppendLiteral(")"); handler.AppendLiteral(")");
@ -106,9 +106,9 @@ internal sealed class TerritoryData
public bool IsQuestBattleInstance(ushort territoryId) public bool IsQuestBattleInstance(ushort territoryId)
{ {
if (_dutyTerritories.TryGetValue(territoryId, out var value)) if (_dutyTerritories.TryGetValue(territoryId, out var debugStateProvider))
{ {
return value == 7; return debugStateProvider == 7;
} }
return false; return false;
} }
@ -130,9 +130,9 @@ internal sealed class TerritoryData
public bool TryGetContentFinderConditionForSoloInstance(ElementId questId, byte index, [NotNullWhen(true)] out ContentFinderConditionData? contentFinderConditionData) public bool TryGetContentFinderConditionForSoloInstance(ElementId questId, byte index, [NotNullWhen(true)] out ContentFinderConditionData? contentFinderConditionData)
{ {
if (_questBattlesToContentFinderCondition.TryGetValue((questId, index), out var value)) if (_questBattlesToContentFinderCondition.TryGetValue((questId, index), out var priorityQuestId))
{ {
return _contentFinderConditions.TryGetValue(value, out contentFinderConditionData); return _contentFinderConditions.TryGetValue(priorityQuestId, out contentFinderConditionData);
} }
contentFinderConditionData = null; contentFinderConditionData = null;
return false; return false;

View file

@ -89,21 +89,21 @@ internal sealed class AutoDutyIpc
public void StartInstance(uint cfcId, DutyMode dutyMode) public void StartInstance(uint cfcId, DutyMode dutyMode)
{ {
if (!_territoryData.TryGetContentFinderCondition(cfcId, out TerritoryData.ContentFinderConditionData contentFinderConditionData)) if (!_territoryData.TryGetContentFinderCondition(cfcId, out TerritoryData.ContentFinderConditionData player))
{ {
throw new TaskException($"Unknown ContentFinderConditionId {cfcId}"); throw new TaskException($"Unknown ContentFinderConditionId {cfcId}");
} }
try try
{ {
_setConfig.InvokeAction("Unsynced", $"{dutyMode == DutyMode.UnsyncRegular}"); _setConfig.InvokeAction("Unsynced", $"{dutyMode == DutyMode.UnsyncRegular}");
ICallGateSubscriber<string, string, object> setConfig = _setConfig; ICallGateSubscriber<string, string, object> actualDistance = _setConfig;
setConfig.InvokeAction("dutyModeEnum", dutyMode switch actualDistance.InvokeAction("dutyModeEnum", dutyMode switch
{ {
DutyMode.Support => "Support", DutyMode.Support => "Support",
DutyMode.UnsyncRegular => "Regular", DutyMode.UnsyncRegular => "Regular",
_ => throw new ArgumentOutOfRangeException("dutyMode", dutyMode, null), _ => throw new ArgumentOutOfRangeException("dutyMode", dutyMode, null),
}); });
_run.InvokeAction(contentFinderConditionData.TerritoryId, 1, !_configuration.Advanced.DisableAutoDutyBareMode); _run.InvokeAction(player.TerritoryId, 1, !_configuration.Advanced.DisableAutoDutyBareMode);
} }
catch (IpcError ipcError) catch (IpcError ipcError)
{ {

View file

@ -146,7 +146,7 @@ internal sealed class QuestionableIpc : IDisposable
private bool StartQuest(string questId, bool single) private bool StartQuest(string questId, bool single)
{ {
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.TryGetQuest(elementId, out Quest quest)) if (ElementId.TryFromString(questId, out ElementId currentTaskRevisitAware) && currentTaskRevisitAware != null && _questRegistry.TryGetQuest(currentTaskRevisitAware, out Quest quest))
{ {
_questController.SetNextQuest(quest); _questController.SetNextQuest(quest);
if (single) if (single)
@ -201,9 +201,9 @@ internal sealed class QuestionableIpc : IDisposable
private bool IsQuestCompleted(string questId) private bool IsQuestCompleted(string questId)
{ {
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null) if (ElementId.TryFromString(questId, out ElementId e) && e != null)
{ {
return _questFunctions.IsQuestComplete(elementId); return _questFunctions.IsQuestComplete(e);
} }
return false; return false;
} }
@ -219,18 +219,18 @@ internal sealed class QuestionableIpc : IDisposable
private bool IsQuestAccepted(string questId) private bool IsQuestAccepted(string questId)
{ {
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null) if (ElementId.TryFromString(questId, out ElementId solutionDirectory) && solutionDirectory != null)
{ {
return _questFunctions.IsQuestAccepted(elementId); return _questFunctions.IsQuestAccepted(solutionDirectory);
} }
return false; return false;
} }
private bool IsQuestUnobtainable(string questId) private bool IsQuestUnobtainable(string questId)
{ {
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null) if (ElementId.TryFromString(questId, out ElementId gatheringPointId) && gatheringPointId != null)
{ {
return _questFunctions.IsQuestUnobtainable(elementId); return _questFunctions.IsQuestUnobtainable(gatheringPointId);
} }
return false; return false;
} }

View file

@ -37,10 +37,10 @@ internal sealed class AetheryteFunctions
public unsafe bool IsAetheryteUnlocked(uint aetheryteId, out byte subIndex) public unsafe bool IsAetheryteUnlocked(uint aetheryteId, out byte subIndex)
{ {
subIndex = 0; subIndex = 0;
UIState* ptr = UIState.Instance(); UIState* cfcData = UIState.Instance();
if (ptr != null) if (cfcData != null)
{ {
return ptr->IsAetheryteUnlocked(aetheryteId); return cfcData->IsAetheryteUnlocked(aetheryteId);
} }
return false; return false;
} }
@ -51,8 +51,8 @@ internal sealed class AetheryteFunctions
{ {
return _serviceProvider.GetRequiredService<QuestFunctions>().IsQuestComplete(new QuestId(3672)); return _serviceProvider.GetRequiredService<QuestFunctions>().IsQuestComplete(new QuestId(3672));
} }
byte subIndex; byte cfcData;
return IsAetheryteUnlocked((uint)aetheryteLocation, out subIndex); return IsAetheryteUnlocked((uint)aetheryteLocation, out cfcData);
} }
public unsafe bool CanTeleport(EAetheryteLocation aetheryteLocation) public unsafe bool CanTeleport(EAetheryteLocation aetheryteLocation)
@ -66,8 +66,8 @@ internal sealed class AetheryteFunctions
public unsafe bool IsTeleportUnlocked() public unsafe bool IsTeleportUnlocked()
{ {
uint rowId = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(5u).UnlockLink.RowId; uint e = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(5u).UnlockLink.RowId;
return UIState.Instance()->IsUnlockLinkUnlocked(rowId); return UIState.Instance()->IsUnlockLinkUnlocked(e);
} }
public unsafe bool TeleportAetheryte(uint aetheryteId) public unsafe bool TeleportAetheryte(uint aetheryteId)

View file

@ -131,8 +131,8 @@ internal sealed class GameFunctions
{ {
foreach (IGameObject item in _objectTable) foreach (IGameObject item in _objectTable)
{ {
Dalamud.Game.ClientState.Objects.Enums.ObjectKind objectKind = item.ObjectKind; Dalamud.Game.ClientState.Objects.Enums.ObjectKind e = item.ObjectKind;
bool flag = ((objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || objectKind - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false); bool flag = ((e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || e - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false);
if (!flag && (item == null || item.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.GatheringPoint || item.IsTargetable) && item.BaseId == dataId && (!kind.HasValue || kind.Value == item.ObjectKind)) if (!flag && (item == null || item.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.GatheringPoint || item.IsTargetable) && item.BaseId == dataId && (!kind.HasValue || kind.Value == item.ObjectKind))
{ {
return item; return item;
@ -186,9 +186,9 @@ internal sealed class GameFunctions
if (gameObject != null) if (gameObject != null)
{ {
_targetManager.Target = gameObject; _targetManager.Target = gameObject;
long num = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0); long e = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0);
_logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, num); _logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, e);
if ((ulong)num <= 1uL) if ((ulong)e <= 1uL)
{ {
return true; return true;
} }
@ -215,16 +215,16 @@ internal sealed class GameFunctions
public unsafe bool UseAction(EAction action) public unsafe bool UseAction(EAction action)
{ {
uint num = (uint)(action & (EAction)65535); uint elementId = (uint)(action & (EAction)65535);
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction); ActionType quest = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (actionType == ActionType.Action) if (quest == ActionType.Action)
{ {
num = ActionManager.Instance()->GetAdjustedActionId(num); elementId = ActionManager.Instance()->GetAdjustedActionId(elementId);
} }
if (ActionManager.Instance()->GetActionStatus(actionType, num, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0) if (ActionManager.Instance()->GetActionStatus(quest, elementId, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
{ {
bool flag = ActionManager.Instance()->UseAction(actionType, num, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null); bool flag = ActionManager.Instance()->UseAction(quest, elementId, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, num, flag); _logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, elementId, flag);
return flag; return flag;
} }
return false; return false;
@ -232,34 +232,34 @@ internal sealed class GameFunctions
public unsafe bool UseAction(IGameObject gameObject, EAction action, bool checkCanUse = true) public unsafe bool UseAction(IGameObject gameObject, EAction action, bool checkCanUse = true)
{ {
uint actionId = (uint)(action & (EAction)65535); uint progress = (uint)(action & (EAction)65535);
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction); ActionType questId = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (actionType == ActionType.GeneralAction) if (questId == ActionType.GeneralAction)
{ {
_logger.LogWarning("Can not use general action {Action} on target {Target}", action, gameObject); _logger.LogWarning("Can not use general action {Action} on target {Target}", action, gameObject);
return false; return false;
} }
actionId = ActionManager.Instance()->GetAdjustedActionId(actionId); progress = ActionManager.Instance()->GetAdjustedActionId(progress);
if (checkCanUse && !ActionManager.CanUseActionOnTarget(actionId, (GameObject*)gameObject.Address)) if (checkCanUse && !ActionManager.CanUseActionOnTarget(progress, (GameObject*)gameObject.Address))
{ {
_logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, actionId, gameObject); _logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, progress, gameObject);
return false; return false;
} }
Lumina.Excel.Sheets.Action row = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(actionId); Lumina.Excel.Sheets.Action step = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(progress);
_targetManager.Target = gameObject; _targetManager.Target = gameObject;
if (ActionManager.Instance()->GetActionStatus(actionType, actionId, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0) if (ActionManager.Instance()->GetActionStatus(questId, progress, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0)
{ {
bool flag; bool flag;
if (row.TargetArea) if (step.TargetArea)
{ {
Vector3 position = gameObject.Position; Vector3 position = gameObject.Position;
flag = ActionManager.Instance()->UseActionLocation(actionType, actionId, 3758096384uL, &position, 0u, 0); flag = ActionManager.Instance()->UseActionLocation(questId, progress, 3758096384uL, &position, 0u, 0);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, actionId, gameObject, flag); _logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, progress, gameObject, flag);
} }
else else
{ {
flag = ActionManager.Instance()->UseAction(actionType, actionId, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null); flag = ActionManager.Instance()->UseAction(questId, progress, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, actionId, gameObject, flag); _logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, progress, gameObject, flag);
} }
return flag; return flag;
} }
@ -268,10 +268,10 @@ internal sealed class GameFunctions
public bool IsObjectAtPosition(uint dataId, Vector3 position, float distance) public bool IsObjectAtPosition(uint dataId, Vector3 position, float distance)
{ {
IGameObject gameObject = FindObjectByDataId(dataId); IGameObject elementId = FindObjectByDataId(dataId);
if (gameObject != null) if (elementId != null)
{ {
return (gameObject.Position - position).Length() < distance; return (elementId.Position - position).Length() < distance;
} }
return false; return false;
} }
@ -282,8 +282,8 @@ internal sealed class GameFunctions
{ {
return true; return true;
} }
PlayerState* ptr = PlayerState.Instance(); PlayerState* questElements = PlayerState.Instance();
if (ptr != null && !ptr->IsMountUnlocked(1u)) if (questElements != null && !questElements->IsMountUnlocked(1u))
{ {
return true; return true;
} }
@ -308,12 +308,12 @@ internal sealed class GameFunctions
private unsafe bool HasCharacterStatusPreventingMountOrSprint() private unsafe bool HasCharacterStatusPreventingMountOrSprint()
{ {
IPlayerCharacter localPlayer = _clientState.LocalPlayer; IPlayerCharacter elementId = _clientState.LocalPlayer;
if (localPlayer == null) if (elementId == null)
{ {
return false; return false;
} }
BattleChara* address = (BattleChara*)localPlayer.Address; BattleChara* address = (BattleChara*)elementId.Address;
StatusManager* statusManager = address->GetStatusManager(); StatusManager* statusManager = address->GetStatusManager();
if (!statusManager->HasStatus(565u) && !statusManager->HasStatus(404u) && !statusManager->HasStatus(416u) && !statusManager->HasStatus(2729u)) if (!statusManager->HasStatus(565u) && !statusManager->HasStatus(404u) && !statusManager->HasStatus(416u) && !statusManager->HasStatus(2729u))
{ {
@ -324,12 +324,12 @@ internal sealed class GameFunctions
public unsafe bool HasStatus(EStatus statusId) public unsafe bool HasStatus(EStatus statusId)
{ {
IPlayerCharacter localPlayer = _clientState.LocalPlayer; IPlayerCharacter elementId = _clientState.LocalPlayer;
if (localPlayer == null) if (elementId == null)
{ {
return false; return false;
} }
BattleChara* address = (BattleChara*)localPlayer.Address; BattleChara* address = (BattleChara*)elementId.Address;
return address->GetStatusManager()->HasStatus((uint)statusId); return address->GetStatusManager()->HasStatus((uint)statusId);
} }
@ -393,14 +393,14 @@ internal sealed class GameFunctions
public unsafe void OpenDutyFinder(uint contentFinderConditionId) public unsafe void OpenDutyFinder(uint contentFinderConditionId)
{ {
if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var value)) if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var hasActiveQuest))
{ {
if (UIState.IsInstanceContentUnlocked(value)) if (UIState.IsInstanceContentUnlocked(hasActiveQuest))
{ {
AgentContentsFinder.Instance()->OpenRegularDuty(contentFinderConditionId); AgentContentsFinder.Instance()->OpenRegularDuty(contentFinderConditionId);
return; return;
} }
_logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, value); _logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, hasActiveQuest);
} }
else else
{ {
@ -591,21 +591,21 @@ internal sealed class GameFunctions
{ {
try try
{ {
UIModule* uIModule = Framework.Instance()->GetUIModule(); UIModule* toTerritoryType = Framework.Instance()->GetUIModule();
if (uIModule == null) if (toTerritoryType == null)
{ {
_logger.LogError("UIModule is null, cannot execute command: {Command}", command); _logger.LogError("UIModule is null, cannot execute command: {Command}", command);
return; return;
} }
Utf8String utf8String = new Utf8String(command); Utf8String toPosition = new Utf8String(command);
try try
{ {
uIModule->ProcessChatBoxEntry(&utf8String, (nint)utf8String.StringLength); toTerritoryType->ProcessChatBoxEntry(&toPosition, (nint)toPosition.StringLength);
_logger.LogDebug("Executed chat command: {Command}", command); _logger.LogDebug("Executed chat command: {Command}", command);
} }
finally finally
{ {
((IDisposable)utf8String/*cast due to .constrained prefix*/).Dispose(); ((IDisposable)toPosition/*cast due to .constrained prefix*/).Dispose();
} }
} }
catch (Exception exception) catch (Exception exception)

View file

@ -82,8 +82,8 @@ internal sealed class QuestFunctions
public unsafe QuestReference GetCurrentQuest(bool allowNewMsq = true) public unsafe QuestReference GetCurrentQuest(bool allowNewMsq = true)
{ {
QuestReference currentQuestInternal = GetCurrentQuestInternal(allowNewMsq); QuestReference territoryId = GetCurrentQuestInternal(allowNewMsq);
currentQuestInternal.Deconstruct(out ElementId CurrentQuest, out byte Sequence, out MainScenarioQuestState State); territoryId.Deconstruct(out ElementId CurrentQuest, out byte Sequence, out MainScenarioQuestState State);
ElementId elementId = CurrentQuest; ElementId elementId = CurrentQuest;
byte sequence = Sequence; byte sequence = Sequence;
MainScenarioQuestState state = State; MainScenarioQuestState state = State;
@ -140,7 +140,7 @@ internal sealed class QuestFunctions
return new QuestReference(questId, QuestManager.GetQuestSequence(questId.Value), state); return new QuestReference(questId, QuestManager.GetQuestSequence(questId.Value), state);
} }
} }
return currentQuestInternal; return territoryId;
} }
public unsafe QuestReference GetCurrentQuestInternal(bool allowNewMsq) public unsafe QuestReference GetCurrentQuestInternal(bool allowNewMsq)
@ -949,8 +949,8 @@ internal sealed class QuestFunctions
{ {
return false; return false;
} }
QuestInfo questInfo = (QuestInfo)_questData.GetQuestInfo(questId); QuestInfo combatJob = (QuestInfo)_questData.GetQuestInfo(questId);
return _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(questInfo.AlliedSociety).Contains(questId); return _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(combatJob.AlliedSociety).Contains(questId);
} }
public bool IsQuestUnobtainable(ElementId elementId, ElementId? extraCompletedQuest = null) public bool IsQuestUnobtainable(ElementId elementId, ElementId? extraCompletedQuest = null)
@ -959,17 +959,17 @@ internal sealed class QuestFunctions
{ {
return IsQuestUnobtainable(questId, extraCompletedQuest); return IsQuestUnobtainable(questId, extraCompletedQuest);
} }
if (elementId is UnlockLinkId unlockLinkId) if (elementId is UnlockLinkId combatJobGearSets)
{ {
return IsQuestUnobtainable(unlockLinkId); return IsQuestUnobtainable(combatJobGearSets);
} }
return false; return false;
} }
public unsafe bool IsQuestUnobtainable(QuestId questId, ElementId? extraCompletedQuest = null) public unsafe bool IsQuestUnobtainable(QuestId questId, ElementId? extraCompletedQuest = null)
{ {
IQuestInfo questInfo = _questData.GetQuestInfo(questId); IQuestInfo playerState = _questData.GetQuestInfo(questId);
if (questInfo is UnlockLinkQuestInfo { QuestExpiry: { TimeOfDay: var timeOfDay } questExpiry }) if (playerState is UnlockLinkQuestInfo { QuestExpiry: { TimeOfDay: var timeOfDay } questExpiry })
{ {
TimeSpan timeSpan = new TimeSpan(23, 59, 59); TimeSpan timeSpan = new TimeSpan(23, 59, 59);
bool flag = false; bool flag = false;
@ -997,12 +997,12 @@ internal sealed class QuestFunctions
return true; return true;
} }
} }
QuestInfo questInfo2 = (QuestInfo)questInfo; QuestInfo i = (QuestInfo)playerState;
if ((int)questInfo2.Expansion > (int)PlayerState.Instance()->MaxExpansion) if ((int)i.Expansion > (int)PlayerState.Instance()->MaxExpansion)
{ {
return true; return true;
} }
if (questInfo2.JournalGenre >= 234 && questInfo2.JournalGenre <= 247) if (i.JournalGenre >= 234 && i.JournalGenre <= 247)
{ {
if (_questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest)) if (_questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))
{ {
@ -1021,38 +1021,38 @@ internal sealed class QuestFunctions
} }
goto IL_0288; goto IL_0288;
IL_0288: IL_0288:
if (questInfo2.QuestLocks.Count > 0) if (i.QuestLocks.Count > 0)
{ {
int num = questInfo2.QuestLocks.Count((QuestId x) => IsQuestComplete(x) || x.Equals(extraCompletedQuest)); int num = i.QuestLocks.Count((QuestId x) => IsQuestComplete(x) || x.Equals(extraCompletedQuest));
if (questInfo2.QuestLockJoin == EQuestJoin.All && questInfo2.QuestLocks.Count == num) if (i.QuestLockJoin == EQuestJoin.All && i.QuestLocks.Count == num)
{ {
return true; return true;
} }
if (questInfo2.QuestLockJoin == EQuestJoin.AtLeastOne && num > 0) if (i.QuestLockJoin == EQuestJoin.AtLeastOne && num > 0)
{ {
return true; return true;
} }
} }
DateTime? seasonalQuestExpiry = questInfo2.SeasonalQuestExpiry; DateTime? seasonalQuestExpiry = i.SeasonalQuestExpiry;
if (seasonalQuestExpiry.HasValue) if (seasonalQuestExpiry.HasValue)
{ {
DateTime valueOrDefault = seasonalQuestExpiry.GetValueOrDefault(); DateTime gearset = seasonalQuestExpiry.GetValueOrDefault();
TimeSpan timeOfDay2 = valueOrDefault.TimeOfDay; TimeSpan timeOfDay2 = gearset.TimeOfDay;
TimeSpan timeSpan2 = new TimeSpan(23, 59, 59); TimeSpan timeSpan2 = new TimeSpan(23, 59, 59);
bool flag2 = false; bool flag2 = false;
DateTime dateTime2; DateTime dateTime2;
if (timeOfDay2 == TimeSpan.Zero || timeOfDay2 == timeSpan2) if (timeOfDay2 == TimeSpan.Zero || timeOfDay2 == timeSpan2)
{ {
dateTime2 = EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(valueOrDefault)); dateTime2 = EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(gearset));
flag2 = true; flag2 = true;
} }
else else
{ {
dateTime2 = ((valueOrDefault.Kind == DateTimeKind.Utc) ? valueOrDefault : valueOrDefault.ToUniversalTime()); dateTime2 = ((gearset.Kind == DateTimeKind.Utc) ? gearset : gearset.ToUniversalTime());
} }
if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value)) if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value))
{ {
_logger.LogDebug("Quest {QuestId} seasonal expiry raw={ExpiryRaw} Kind={Kind} TimeOfDay={TimeOfDay}", questId, valueOrDefault.ToString("o"), valueOrDefault.Kind, valueOrDefault.TimeOfDay); _logger.LogDebug("Quest {QuestId} seasonal expiry raw={ExpiryRaw} Kind={Kind} TimeOfDay={TimeOfDay}", questId, gearset.ToString("o"), gearset.Kind, gearset.TimeOfDay);
_logger.LogDebug("Quest {QuestId} normalized expiryUtc={ExpiryUtc:o} treatedAsDailyReset={TreatedAsDailyReset}", questId, dateTime2, flag2); _logger.LogDebug("Quest {QuestId} normalized expiryUtc={ExpiryUtc:o} treatedAsDailyReset={TreatedAsDailyReset}", questId, dateTime2, flag2);
_logger.LogTrace("Quest {QuestId} expiry check: nowUtc={Now:o}, expiryUtc={Expiry:o}, expired={Expired}", questId, DateTime.UtcNow, dateTime2, DateTime.UtcNow > dateTime2); _logger.LogTrace("Quest {QuestId} expiry check: nowUtc={Now:o}, expiryUtc={Expiry:o}, expired={Expired}", questId, DateTime.UtcNow, dateTime2, DateTime.UtcNow > dateTime2);
} }
@ -1065,7 +1065,7 @@ internal sealed class QuestFunctions
return true; return true;
} }
} }
if ((questInfo2.IsSeasonalEvent || questInfo2.IsSeasonalQuest) && !(questInfo2.SeasonalQuestExpiry is DateTime)) if ((i.IsSeasonalEvent || i.IsSeasonalQuest) && !(i.SeasonalQuestExpiry is DateTime))
{ {
if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value)) if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value))
{ {
@ -1080,20 +1080,20 @@ internal sealed class QuestFunctions
{ {
return true; return true;
} }
byte startTown = PlayerState.Instance()->StartTown; byte classJob = PlayerState.Instance()->StartTown;
if (questInfo2.StartingCity > 0 && questInfo2.StartingCity != startTown) if (i.StartingCity > 0 && i.StartingCity != classJob)
{ {
return true; return true;
} }
if (questId.Value == 674 && startTown == 3) if (questId.Value == 674 && classJob == 3)
{ {
return true; return true;
} }
if (questId.Value == 673 && startTown != 3) if (questId.Value == 673 && classJob != 3)
{ {
return true; return true;
} }
Dictionary<ushort, EClassJob> dictionary = new Dictionary<ushort, EClassJob> Dictionary<ushort, EClassJob> level = new Dictionary<ushort, EClassJob>
{ {
{ {
108, 108,
@ -1128,7 +1128,7 @@ internal sealed class QuestFunctions
EClassJob.Thaumaturge EClassJob.Thaumaturge
} }
}; };
if (dictionary.TryGetValue(questId.Value, out var value) && dictionary.Any((KeyValuePair<ushort, EClassJob> x) => IsQuestAcceptedOrComplete(new QuestId(x.Key))) && (EClassJob)PlayerState.Instance()->FirstClass != value) if (level.TryGetValue(questId.Value, out var itemLevel) && level.Any((KeyValuePair<ushort, EClassJob> x) => IsQuestAcceptedOrComplete(new QuestId(x.Key))) && (EClassJob)PlayerState.Instance()->FirstClass != itemLevel)
{ {
return true; return true;
} }
@ -1156,12 +1156,12 @@ internal sealed class QuestFunctions
{ {
for (int i = 0; i < GameMain.Instance()->ActiveFestivals.Length; i++) for (int i = 0; i < GameMain.Instance()->ActiveFestivals.Length; i++)
{ {
GameMain.Festival festival = GameMain.Instance()->ActiveFestivals[i]; GameMain.Festival gatheringItemToItem = GameMain.Instance()->ActiveFestivals[i];
if (festival.Id == id) if (gatheringItemToItem.Id == id)
{ {
if (phase.HasValue) if (phase.HasValue)
{ {
return festival.Phase == phase; return gatheringItemToItem.Phase == phase;
} }
return true; return true;
} }

View file

@ -73,7 +73,7 @@ internal sealed class QuestInfo : IQuestInfo
public QuestInfo(Lumina.Excel.Sheets.Quest quest, uint newGamePlusChapter, byte startingCity, JournalGenreOverrides journalGenreOverrides, bool isSeasonalEventQuest = false, DateTime? seasonalQuestExpiry = null) public QuestInfo(Lumina.Excel.Sheets.Quest quest, uint newGamePlusChapter, byte startingCity, JournalGenreOverrides journalGenreOverrides, bool isSeasonalEventQuest = false, DateTime? seasonalQuestExpiry = null)
{ {
QuestId = Questionable.Model.Questing.QuestId.FromRowId(quest.RowId); QuestId = Questionable.Model.Questing.QuestId.FromRowId(quest.RowId);
string value = QuestId.Value switch string localPlayer = QuestId.Value switch
{ {
85 => " (Lancer)", 85 => " (Lancer)",
108 => " (Marauder)", 108 => " (Marauder)",
@ -90,7 +90,7 @@ internal sealed class QuestInfo : IQuestInfo
1434 => " (Ul'dah)", 1434 => " (Ul'dah)",
_ => "", _ => "",
}; };
Name = $"{quest.Name}{value}"; Name = $"{quest.Name}{localPlayer}";
Level = quest.ClassJobLevel[0]; Level = quest.ClassJobLevel[0];
IssuerDataId = quest.IssuerStart.RowId; IssuerDataId = quest.IssuerStart.RowId;
IsRepeatable = quest.IsRepeatable; IsRepeatable = quest.IsRepeatable;
@ -144,9 +144,9 @@ internal sealed class QuestInfo : IQuestInfo
tuple = (quest.JournalGenre.ValueNullable?.RowId, null); tuple = (quest.JournalGenre.ValueNullable?.RowId, null);
break; break;
} }
(uint?, ushort?) tuple2 = tuple; (uint?, ushort?) battleChara = tuple;
JournalGenre = tuple2.Item1; JournalGenre = battleChara.Item1;
SortKey = tuple2.Item2 ?? quest.SortKey; SortKey = battleChara.Item2 ?? quest.SortKey;
JournalGenre? valueNullable = quest.JournalGenre.ValueNullable; JournalGenre? valueNullable = quest.JournalGenre.ValueNullable;
IsMainScenarioQuest = valueNullable.HasValue && valueNullable.GetValueOrDefault().Icon == 61412; IsMainScenarioQuest = valueNullable.HasValue && valueNullable.GetValueOrDefault().Icon == 61412;
CompletesInstantly = quest.TodoParams[0].ToDoCompleteSeq == 0; CompletesInstantly = quest.TodoParams[0].ToDoCompleteSeq == 0;
@ -210,16 +210,16 @@ internal sealed class QuestInfo : IQuestInfo
} }
QuestLockJoin = questJoin; QuestLockJoin = questJoin;
ImmutableList<QuestId> questLocks = QuestLocks; ImmutableList<QuestId> questLocks = QuestLocks;
int num = 0; int festival = 0;
QuestId[] array = new QuestId[questLocks.Count + questId.Length]; QuestId[] array = new QuestId[questLocks.Count + questId.Length];
foreach (QuestId item in questLocks) foreach (QuestId item in questLocks)
{ {
array[num] = item; array[festival] = item;
num++; festival++;
} }
ReadOnlySpan<QuestId> readOnlySpan = new ReadOnlySpan<QuestId>(questId); ReadOnlySpan<QuestId> readOnlySpan = new ReadOnlySpan<QuestId>(questId);
readOnlySpan.CopyTo(new Span<QuestId>(array).Slice(num, readOnlySpan.Length)); readOnlySpan.CopyTo(new Span<QuestId>(array).Slice(festival, readOnlySpan.Length));
num += readOnlySpan.Length; festival += readOnlySpan.Length;
QuestLocks = ImmutableList.Create(new ReadOnlySpan<QuestId>(array)); QuestLocks = ImmutableList.Create(new ReadOnlySpan<QuestId>(array));
} }
} }

View file

@ -31,11 +31,11 @@ internal sealed class QuestProgressInfo
Variables = questWork.Variables.ToArray().ToList(); Variables = questWork.Variables.ToArray().ToList();
IsHidden = questWork.IsHidden; IsHidden = questWork.IsHidden;
ClassJob = (EClassJob)questWork.AcceptClassJob; ClassJob = (EClassJob)questWork.AcceptClassJob;
Span<byte> variables = questWork.Variables; Span<byte> progress = questWork.Variables;
string text = ""; string text = "";
for (int i = 0; i < variables.Length; i++) for (int i = 0; i < progress.Length; i++)
{ {
text = text + variables[i] + " "; text = text + progress[i] + " ";
if (i % 2 == 1) if (i % 2 == 1)
{ {
text += " "; text += " ";

View file

@ -46,28 +46,28 @@ internal sealed class AlliedSocietyJournalComponent
{ {
return; return;
} }
foreach (EAlliedSociety item in from x in Enum.GetValues<EAlliedSociety>() foreach (EAlliedSociety quest in from x in Enum.GetValues<EAlliedSociety>()
where x != EAlliedSociety.None where x != EAlliedSociety.None
select x) select x)
{ {
List<QuestInfo> list = (from x in _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(item) List<QuestInfo> foundStep = (from x in _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(quest)
select (QuestInfo)_questData.GetQuestInfo(x)).ToList(); select (QuestInfo)_questData.GetQuestInfo(x)).ToList();
if (list.Count == 0 || !ImGui.CollapsingHeader($"{item}###AlliedSociety{item}")) if (foundStep.Count == 0 || !ImGui.CollapsingHeader($"{quest}###AlliedSociety{quest}"))
{ {
continue; continue;
} }
if ((int)item <= 5) if ((int)quest <= 5)
{ {
byte i = 1; byte i = 1;
while (i <= 8) while (i <= 8)
{ {
List<QuestInfo> list2 = list.Where((QuestInfo x) => x.AlliedSocietyRank == i).ToList(); List<QuestInfo> list = foundStep.Where((QuestInfo x) => x.AlliedSocietyRank == i).ToList();
if (list2.Count != 0) if (list.Count != 0)
{ {
ImGui.Text(RankNames[i - 1]); ImGui.Text(RankNames[i - 1]);
foreach (QuestInfo item2 in list2) foreach (QuestInfo item in list)
{ {
DrawQuest(item2); DrawQuest(item);
} }
} }
byte b = (byte)(i + 1); byte b = (byte)(i + 1);
@ -75,22 +75,22 @@ internal sealed class AlliedSocietyJournalComponent
} }
continue; continue;
} }
foreach (QuestInfo item3 in list) foreach (QuestInfo item2 in foundStep)
{ {
DrawQuest(item3); DrawQuest(item2);
} }
} }
} }
private void DrawQuest(QuestInfo questInfo) private void DrawQuest(QuestInfo questInfo)
{ {
var (color, icon, value) = _uiUtils.GetQuestStyle(questInfo.QuestId); var (journalGenre, journalCategory, genreName) = _uiUtils.GetQuestStyle(questInfo.QuestId);
if (!_questRegistry.TryGetQuest(questInfo.QuestId, out Quest quest) || quest.Root.Disabled) if (!_questRegistry.TryGetQuest(questInfo.QuestId, out Quest quest) || quest.Root.Disabled)
{ {
color = ImGuiColors.DalamudGrey; journalGenre = ImGuiColors.DalamudGrey;
} }
string text = $"{questInfo.Name} ({value}) [{questInfo.QuestId}]"; string text = $"{questInfo.Name} ({genreName}) [{questInfo.QuestId}]";
if (_uiUtils.ChecklistItem(text, color, icon)) if (_uiUtils.ChecklistItem(text, journalGenre, journalCategory))
{ {
_questTooltipComponent.Draw(questInfo); _questTooltipComponent.Draw(questInfo);
} }

View file

@ -205,8 +205,8 @@ internal sealed class GatheringJournalComponent
public void DrawGatheringItems() public void DrawGatheringItems()
{ {
using ImRaii.IEndObject endObject = ImRaii.TabItem("Gathering Points"); using ImRaii.IEndObject totalEnabled = ImRaii.TabItem("Gathering Points");
if (!endObject) if (!totalEnabled)
{ {
return; return;
} }
@ -217,9 +217,9 @@ internal sealed class GatheringJournalComponent
} }
if (_filteredExpansions.Count > 0) if (_filteredExpansions.Count > 0)
{ {
using (ImRaii.IEndObject endObject2 = ImRaii.Table("GatheringPoints", 3, ImGuiTableFlags.NoSavedSettings)) using (ImRaii.IEndObject totalCount = ImRaii.Table("GatheringPoints", 3, ImGuiTableFlags.NoSavedSettings))
{ {
if (!endObject2) if (!totalCount)
{ {
return; return;
} }
@ -250,9 +250,9 @@ internal sealed class GatheringJournalComponent
{ {
return; return;
} }
foreach (FilteredTerritory territory in expansion.Territories) foreach (FilteredTerritory dutyInfo in expansion.Territories)
{ {
DrawTerritory(territory); DrawTerritory(dutyInfo);
} }
ImGui.TreePop(); ImGui.TreePop();
} }
@ -317,12 +317,12 @@ internal sealed class GatheringJournalComponent
ImGui.TreeNodeEx(_gatheringItems.GetValueOrDefault(item, "???"), ImGuiTreeNodeFlags.NoTreePushOnOpen | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.SpanFullWidth); ImGui.TreeNodeEx(_gatheringItems.GetValueOrDefault(item, "???"), ImGuiTreeNodeFlags.NoTreePushOnOpen | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.SpanFullWidth);
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TableNextColumn(); ImGui.TableNextColumn();
float num; float clipboardText;
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{ {
num = ImGui.GetColumnWidth() / 2f - ImGui.CalcTextSize(FontAwesomeIcon.Check.ToIconString()).X; clipboardText = ImGui.GetColumnWidth() / 2f - ImGui.CalcTextSize(FontAwesomeIcon.Check.ToIconString()).X;
} }
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + num); ImGui.SetCursorPosX(ImGui.GetCursorPosX() + clipboardText);
if (item < 10000) if (item < 10000)
{ {
_uiUtils.ChecklistItem(string.Empty, _gatheredItems.Contains(item)); _uiUtils.ChecklistItem(string.Empty, _gatheredItems.Contains(item));
@ -368,13 +368,13 @@ internal sealed class GatheringJournalComponent
private FilteredExpansion? FilterExpansion(ExpansionPoints expansion, Predicate<string> match) private FilteredExpansion? FilterExpansion(ExpansionPoints expansion, Predicate<string> match)
{ {
List<FilteredTerritory> list = (from x in expansion.PointsByTerritories List<FilteredTerritory> totalCount = (from x in expansion.PointsByTerritories
select FilterTerritory(x, match) into x select FilterTerritory(x, match) into x
where x != null where x != null
select (x)).ToList(); select (x)).ToList();
if (list.Count > 0) if (totalCount.Count > 0)
{ {
return new FilteredExpansion(expansion, list); return new FilteredExpansion(expansion, totalCount);
} }
return null; return null;
} }
@ -385,13 +385,13 @@ internal sealed class GatheringJournalComponent
{ {
return new FilteredTerritory(territory, territory.Points.Select((DefaultGatheringPoint x) => FilterGatheringPoint(x, (string _) => true)).ToList()); return new FilteredTerritory(territory, territory.Points.Select((DefaultGatheringPoint x) => FilterGatheringPoint(x, (string _) => true)).ToList());
} }
List<FilteredGatheringPoint> list = (from x in territory.Points List<FilteredGatheringPoint> totalCount = (from x in territory.Points
select FilterGatheringPoint(x, match) into x select FilterGatheringPoint(x, match) into x
where x != null where x != null
select (x)).ToList(); select (x)).ToList();
if (list.Count > 0) if (totalCount.Count > 0)
{ {
return new FilteredTerritory(territory, list); return new FilteredTerritory(territory, totalCount);
} }
return null; return null;
} }
@ -402,10 +402,10 @@ internal sealed class GatheringJournalComponent
{ {
return new FilteredGatheringPoint(gatheringPoint, gatheringPoint.GatheringItemIds); return new FilteredGatheringPoint(gatheringPoint, gatheringPoint.GatheringItemIds);
} }
List<ushort> list = gatheringPoint.GatheringItemIds.Where((ushort x) => match(_gatheringItems.GetValueOrDefault(x, string.Empty))).ToList(); List<ushort> totalCount = gatheringPoint.GatheringItemIds.Where((ushort x) => match(_gatheringItems.GetValueOrDefault(x, string.Empty))).ToList();
if (list.Count > 0) if (totalCount.Count > 0)
{ {
return new FilteredGatheringPoint(gatheringPoint, list); return new FilteredGatheringPoint(gatheringPoint, totalCount);
} }
return null; return null;
} }
@ -415,30 +415,30 @@ internal sealed class GatheringJournalComponent
_gatheredItems.Clear(); _gatheredItems.Clear();
foreach (int key in _gatheringItems.Keys) foreach (int key in _gatheringItems.Keys)
{ {
ushort item = (ushort)key; ushort totalCount = (ushort)key;
if (IsGatheringItemGathered(item)) if (IsGatheringItemGathered(totalCount))
{ {
_gatheredItems.Add(item); _gatheredItems.Add(totalCount);
} }
} }
foreach (ExpansionPoints item2 in _gatheringPointsByExpansion) foreach (ExpansionPoints otherTotal in _gatheringPointsByExpansion)
{ {
foreach (TerritoryPoints pointsByTerritory in item2.PointsByTerritories) foreach (TerritoryPoints battles in otherTotal.PointsByTerritories)
{ {
foreach (DefaultGatheringPoint point in pointsByTerritory.Points) foreach (DefaultGatheringPoint total in battles.Points)
{ {
point.TotalItems = point.GatheringItemIds.Count((ushort x) => x < 10000); total.TotalItems = total.GatheringItemIds.Count((ushort x) => x < 10000);
point.CompletedItems = point.GatheringItemIds.Count(_gatheredItems.Contains); total.CompletedItems = total.GatheringItemIds.Count(_gatheredItems.Contains);
point.IsComplete = _gatheringPointRegistry.TryGetGatheringPoint(point.Id, out GatheringRoot _); total.IsComplete = _gatheringPointRegistry.TryGetGatheringPoint(total.Id, out GatheringRoot _);
} }
pointsByTerritory.TotalItems = pointsByTerritory.Points.Sum((DefaultGatheringPoint x) => x.TotalItems); battles.TotalItems = battles.Points.Sum((DefaultGatheringPoint x) => x.TotalItems);
pointsByTerritory.CompletedItems = pointsByTerritory.Points.Sum((DefaultGatheringPoint x) => x.CompletedItems); battles.CompletedItems = battles.Points.Sum((DefaultGatheringPoint x) => x.CompletedItems);
pointsByTerritory.CompletedPoints = pointsByTerritory.Points.Count((DefaultGatheringPoint x) => x.IsComplete); battles.CompletedPoints = battles.Points.Count((DefaultGatheringPoint x) => x.IsComplete);
} }
item2.TotalItems = item2.PointsByTerritories.Sum((TerritoryPoints x) => x.TotalItems); otherTotal.TotalItems = otherTotal.PointsByTerritories.Sum((TerritoryPoints x) => x.TotalItems);
item2.CompletedItems = item2.PointsByTerritories.Sum((TerritoryPoints x) => x.CompletedItems); otherTotal.CompletedItems = otherTotal.PointsByTerritories.Sum((TerritoryPoints x) => x.CompletedItems);
item2.TotalPoints = item2.PointsByTerritories.Sum((TerritoryPoints x) => x.TotalPoints); otherTotal.TotalPoints = otherTotal.PointsByTerritories.Sum((TerritoryPoints x) => x.TotalPoints);
item2.CompletedPoints = item2.PointsByTerritories.Sum((TerritoryPoints x) => x.CompletedPoints); otherTotal.CompletedPoints = otherTotal.PointsByTerritories.Sum((TerritoryPoints x) => x.CompletedPoints);
} }
} }

View file

@ -235,19 +235,19 @@ internal sealed class QuestJournalComponent
private void DrawGenre(FilteredGenre filter) private void DrawGenre(FilteredGenre filter)
{ {
var (count, num5, total, count2) = _genreCounts.GetValueOrDefault(filter.Genre, new JournalCounts()); var (tab, enabled, total, levelToStopAfter) = _genreCounts.GetValueOrDefault(filter.Genre, new JournalCounts());
if (num5 == 0) if (enabled == 0)
{ {
return; return;
} }
ImGui.TableNextRow(); ImGui.TableNextRow();
ImGui.TableNextColumn(); ImGui.TableNextColumn();
bool num6 = ImGui.TreeNodeEx(filter.Genre.Name, ImGuiTreeNodeFlags.SpanFullWidth); bool num2 = ImGui.TreeNodeEx(filter.Genre.Name, ImGuiTreeNodeFlags.SpanFullWidth);
ImGui.TableNextColumn(); ImGui.TableNextColumn();
DrawCount(count, num5); DrawCount(tab, enabled);
ImGui.TableNextColumn(); ImGui.TableNextColumn();
DrawCount(count2, total); DrawCount(levelToStopAfter, total);
if (!num6) if (!num2)
{ {
return; return;
} }

View file

@ -175,16 +175,16 @@ internal sealed class ActiveQuestComponent
{ {
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{ {
ImU8String text = new ImU8String(26, 4); ImU8String hover = new ImU8String(26, 4);
text.AppendLiteral("Simulated Quest: "); hover.AppendLiteral("Simulated Quest: ");
text.AppendFormatted(Shorten(currentQuest.Quest.Info.Name)); hover.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(currentQuest.Quest.Id); hover.AppendFormatted(currentQuest.Quest.Id);
text.AppendLiteral(") / "); hover.AppendLiteral(") / ");
text.AppendFormatted(currentQuest.Sequence); hover.AppendFormatted(currentQuest.Sequence);
text.AppendLiteral(" / "); hover.AppendLiteral(" / ");
text.AppendFormatted(currentQuest.Step); hover.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text); ImGui.TextUnformatted(hover);
return; return;
} }
} }
@ -192,16 +192,16 @@ internal sealed class ActiveQuestComponent
{ {
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold)) using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
{ {
ImU8String text = new ImU8String(20, 4); ImU8String hover = new ImU8String(20, 4);
text.AppendLiteral("Gathering: "); hover.AppendLiteral("Gathering: ");
text.AppendFormatted(Shorten(currentQuest.Quest.Info.Name)); hover.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(currentQuest.Quest.Id); hover.AppendFormatted(currentQuest.Quest.Id);
text.AppendLiteral(") / "); hover.AppendLiteral(") / ");
text.AppendFormatted(currentQuest.Sequence); hover.AppendFormatted(currentQuest.Sequence);
text.AppendLiteral(" / "); hover.AppendLiteral(" / ");
text.AppendFormatted(currentQuest.Step); hover.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text); ImGui.TextUnformatted(hover);
return; return;
} }
} }
@ -219,25 +219,25 @@ internal sealed class ActiveQuestComponent
ImGui.SetTooltip("This quest is loaded from your 'pluginConfigs\\Questionable\\Quests' directory.\nThis gets loaded even if Questionable ships with a newer/different version of the quest."); ImGui.SetTooltip("This quest is loaded from your 'pluginConfigs\\Questionable\\Quests' directory.\nThis gets loaded even if Questionable ships with a newer/different version of the quest.");
} }
} }
ImU8String text = new ImU8String(16, 4); ImU8String hover = new ImU8String(16, 4);
text.AppendLiteral("Quest: "); hover.AppendLiteral("Quest: ");
text.AppendFormatted(Shorten(startedQuest.Quest.Info.Name)); hover.AppendFormatted(Shorten(startedQuest.Quest.Info.Name));
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(startedQuest.Quest.Id); hover.AppendFormatted(startedQuest.Quest.Id);
text.AppendLiteral(") / "); hover.AppendLiteral(") / ");
text.AppendFormatted(startedQuest.Sequence); hover.AppendFormatted(startedQuest.Sequence);
text.AppendLiteral(" / "); hover.AppendLiteral(" / ");
text.AppendFormatted(startedQuest.Step); hover.AppendFormatted(startedQuest.Step);
ImGui.TextUnformatted(text); ImGui.TextUnformatted(hover);
if (startedQuest.Quest.Root.Disabled) if (startedQuest.Quest.Root.Disabled)
{ {
ImGui.SameLine(); ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudRed, "Disabled"); ImGui.TextColored(ImGuiColors.DalamudRed, "Disabled");
} }
bool flag = _configuration.Stop.Enabled && _configuration.Stop.LevelToStopAfter; bool flag = _configuration.Stop.Enabled && _configuration.Stop.LevelToStopAfter;
bool flag2 = _configuration.Stop.Enabled && _configuration.Stop.QuestsToStopAfter.Any((ElementId x) => !_questFunctions.IsQuestComplete(x) && !_questFunctions.IsQuestUnobtainable(x)); bool instanceId = _configuration.Stop.Enabled && _configuration.Stop.QuestsToStopAfter.Any((ElementId x) => !_questFunctions.IsQuestComplete(x) && !_questFunctions.IsQuestUnobtainable(x));
bool flag3 = _configuration.Stop.Enabled && _configuration.Stop.SequenceToStopAfter; bool color = _configuration.Stop.Enabled && _configuration.Stop.SequenceToStopAfter;
if (flag || flag2 || flag3) if (flag || instanceId || color)
{ {
ImGui.SameLine(); ImGui.SameLine();
Vector4 col = ImGuiColors.ParsedPurple; Vector4 col = ImGuiColors.ParsedPurple;
@ -253,7 +253,7 @@ internal sealed class ActiveQuestComponent
col = ImGuiColors.ParsedBlue; col = ImGuiColors.ParsedBlue;
} }
} }
if (flag3) if (color)
{ {
col = ((startedQuest.Sequence < _configuration.Stop.TargetSequence) ? ImGuiColors.ParsedBlue : ImGuiColors.ParsedGreen); col = ((startedQuest.Sequence < _configuration.Stop.TargetSequence) ? ImGuiColors.ParsedBlue : ImGuiColors.ParsedGreen);
} }
@ -268,67 +268,67 @@ internal sealed class ActiveQuestComponent
if (flag) if (flag)
{ {
int num2 = _clientState.LocalPlayer?.Level ?? 0; int num2 = _clientState.LocalPlayer?.Level ?? 0;
text = new ImU8String(14, 1); hover = new ImU8String(14, 1);
text.AppendLiteral("Stop at level "); hover.AppendLiteral("Stop at level ");
text.AppendFormatted(_configuration.Stop.TargetLevel); hover.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text); ImGui.BulletText(hover);
if (num2 > 0) if (num2 > 0)
{ {
ImGui.SameLine(); ImGui.SameLine();
if (num2 >= _configuration.Stop.TargetLevel) if (num2 >= _configuration.Stop.TargetLevel)
{ {
Vector4 col2 = ImGuiColors.ParsedGreen; Vector4 icon = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1); hover = new ImU8String(22, 1);
text.AppendLiteral("(Current: "); hover.AppendLiteral("(Current: ");
text.AppendFormatted(num2); hover.AppendFormatted(num2);
text.AppendLiteral(" - Reached!)"); hover.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text); ImGui.TextColored(in icon, hover);
} }
else else
{ {
Vector4 col2 = ImGuiColors.ParsedBlue; Vector4 icon = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1); hover = new ImU8String(11, 1);
text.AppendLiteral("(Current: "); hover.AppendLiteral("(Current: ");
text.AppendFormatted(num2); hover.AppendFormatted(num2);
text.AppendLiteral(")"); hover.AppendLiteral(")");
ImGui.TextColored(in col2, text); ImGui.TextColored(in icon, hover);
} }
} }
} }
if (flag3) if (color)
{ {
if (flag) if (flag)
{ {
ImGui.Spacing(); ImGui.Spacing();
} }
int sequence = startedQuest.Sequence; int sequence = startedQuest.Sequence;
text = new ImU8String(23, 1); hover = new ImU8String(23, 1);
text.AppendLiteral("Stop at quest sequence "); hover.AppendLiteral("Stop at quest sequence ");
text.AppendFormatted(_configuration.Stop.TargetSequence); hover.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text); ImGui.BulletText(hover);
ImGui.SameLine(); ImGui.SameLine();
if (sequence >= _configuration.Stop.TargetSequence) if (sequence >= _configuration.Stop.TargetSequence)
{ {
Vector4 col2 = ImGuiColors.ParsedGreen; Vector4 icon = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1); hover = new ImU8String(22, 1);
text.AppendLiteral("(Current: "); hover.AppendLiteral("(Current: ");
text.AppendFormatted(sequence); hover.AppendFormatted(sequence);
text.AppendLiteral(" - Reached!)"); hover.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text); ImGui.TextColored(in icon, hover);
} }
else else
{ {
Vector4 col2 = ImGuiColors.ParsedBlue; Vector4 icon = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1); hover = new ImU8String(11, 1);
text.AppendLiteral("(Current: "); hover.AppendLiteral("(Current: ");
text.AppendFormatted(sequence); hover.AppendFormatted(sequence);
text.AppendLiteral(")"); hover.AppendLiteral(")");
ImGui.TextColored(in col2, text); ImGui.TextColored(in icon, hover);
} }
} }
if (flag2) if (instanceId)
{ {
if (flag || flag3) if (flag || color)
{ {
ImGui.Spacing(); ImGui.Spacing();
} }
@ -338,8 +338,8 @@ internal sealed class ActiveQuestComponent
{ {
if (_questRegistry.TryGetQuest(item, out Quest quest)) if (_questRegistry.TryGetQuest(item, out Quest quest))
{ {
var (color, icon, _) = _uiUtils.GetQuestStyle(item); var (color2, icon2, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon); _uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color2, icon2);
} }
} }
ImGui.Unindent(); ImGui.Unindent();
@ -370,12 +370,12 @@ internal sealed class ActiveQuestComponent
{ {
if (_questRegistry.TryGetQuest(item2, out Quest quest2)) if (_questRegistry.TryGetQuest(item2, out Quest quest2))
{ {
text = new ImU8String(3, 2); hover = new ImU8String(3, 2);
text.AppendFormatted(quest2.Info.Name); hover.AppendFormatted(quest2.Info.Name);
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(item2); hover.AppendFormatted(item2);
text.AppendLiteral(")"); hover.AppendLiteral(")");
ImGui.BulletText(text); ImGui.BulletText(hover);
} }
} }
} }
@ -393,13 +393,13 @@ internal sealed class ActiveQuestComponent
{ {
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3)) if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
{ {
text = new ImU8String(6, 3); hover = new ImU8String(6, 3);
text.AppendFormatted(quest3.Info.Name); hover.AppendFormatted(quest3.Info.Name);
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(elementId2); hover.AppendFormatted(elementId2);
text.AppendLiteral(") - "); hover.AppendLiteral(") - ");
text.AppendFormatted(value); hover.AppendFormatted(value);
ImGui.BulletText(text); ImGui.BulletText(hover);
} }
} }
} }
@ -413,41 +413,41 @@ internal sealed class ActiveQuestComponent
{ {
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{ {
ImU8String text = new ImU8String(21, 4); ImU8String hover = new ImU8String(21, 4);
text.AppendLiteral("Next Quest: "); hover.AppendLiteral("Next Quest: ");
text.AppendFormatted(Shorten(nextQuest.Quest.Info.Name)); hover.AppendFormatted(Shorten(nextQuest.Quest.Info.Name));
text.AppendLiteral(" ("); hover.AppendLiteral(" (");
text.AppendFormatted(nextQuest.Quest.Id); hover.AppendFormatted(nextQuest.Quest.Id);
text.AppendLiteral(") / "); hover.AppendLiteral(") / ");
text.AppendFormatted(nextQuest.Sequence); hover.AppendFormatted(nextQuest.Sequence);
text.AppendLiteral(" / "); hover.AppendLiteral(" / ");
text.AppendFormatted(nextQuest.Step); hover.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text); ImGui.TextUnformatted(hover);
} }
} }
} }
private unsafe QuestProgressInfo? DrawQuestWork(QuestController.QuestProgress currentQuest, bool isMinimized) private unsafe QuestProgressInfo? DrawQuestWork(QuestController.QuestProgress currentQuest, bool isMinimized)
{ {
QuestProgressInfo questProgressInfo = _questFunctions.GetQuestProgressInfo(currentQuest.Quest.Id); QuestProgressInfo complete = _questFunctions.GetQuestProgressInfo(currentQuest.Quest.Id);
if (questProgressInfo != null) if (complete != null)
{ {
if (isMinimized) if (isMinimized)
{ {
return questProgressInfo; return complete;
} }
Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled); Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled);
Vector4 color = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec)); Vector4 hover = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
using (ImRaii.PushColor(ImGuiCol.Text, color)) using (ImRaii.PushColor(ImGuiCol.Text, hover))
{ {
ImU8String text = new ImU8String(0, 1); ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(questProgressInfo); text.AppendFormatted(complete);
ImGui.Text(text); ImGui.Text(text);
if (ImGui.IsItemClicked()) if (ImGui.IsItemClicked())
{ {
string text2 = MultipleWhitespaceRegex().Replace(questProgressInfo.ToString(), " "); string questId = MultipleWhitespaceRegex().Replace(complete.ToString(), " ");
ImGui.SetClipboardText(text2); ImGui.SetClipboardText(questId);
_chatGui.Print("Copied '" + text2 + "' to clipboard"); _chatGui.Print("Copied '" + questId + "' to clipboard");
} }
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
{ {
@ -461,7 +461,7 @@ internal sealed class ActiveQuestComponent
ImGui.SameLine(); ImGui.SameLine();
text = new ImU8String(2, 1); text = new ImU8String(2, 1);
text.AppendLiteral("/ "); text.AppendLiteral("/ ");
text.AppendFormatted(questProgressInfo.ClassJob); text.AppendFormatted(complete.ClassJob);
ImGui.Text(text); ImGui.Text(text);
} }
} }
@ -480,7 +480,7 @@ internal sealed class ActiveQuestComponent
} }
} }
} }
return questProgressInfo; return complete;
} }
private void DrawQuestButtons(QuestController.QuestProgress currentQuest, QuestStep? currentStep, QuestProgressInfo? questProgressInfo, bool isMinimized) private void DrawQuestButtons(QuestController.QuestProgress currentQuest, QuestStep? currentStep, QuestProgressInfo? questProgressInfo, bool isMinimized)

View file

@ -75,12 +75,12 @@ internal sealed class CreationUtilsComponent
} }
if (_configuration.Advanced.AdditionalStatusInformation) if (_configuration.Advanced.AdditionalStatusInformation)
{ {
QuestReference currentQuest = _questFunctions.GetCurrentQuest(); QuestReference time = _questFunctions.GetCurrentQuest();
ImU8String text = new ImU8String(18, 2); ImU8String text = new ImU8String(18, 2);
text.AppendLiteral("Current Quest: "); text.AppendLiteral("Current Quest: ");
text.AppendFormatted(currentQuest.CurrentQuest); text.AppendFormatted(time.CurrentQuest);
text.AppendLiteral(" → "); text.AppendLiteral(" → ");
text.AppendFormatted(currentQuest.Sequence); text.AppendFormatted(time.Sequence);
ImGui.Text(text); ImGui.Text(text);
} }
if (_targetManager.Target != null) if (_targetManager.Target != null)
@ -94,13 +94,13 @@ internal sealed class CreationUtilsComponent
{ {
DrawCopyButton(); DrawCopyButton();
} }
ulong hoveredItem = _gameGui.HoveredItem; ulong startableQuests = _gameGui.HoveredItem;
if (hoveredItem != 0L) if (startableQuests != 0L)
{ {
ImGui.Separator(); ImGui.Separator();
ImU8String text = new ImU8String(14, 1); ImU8String text = new ImU8String(14, 1);
text.AppendLiteral("Hovered Item: "); text.AppendLiteral("Hovered Item: ");
text.AppendFormatted(hoveredItem); text.AppendFormatted(startableQuests);
ImGui.Text(text); ImGui.Text(text);
} }
} }

View file

@ -76,7 +76,7 @@ internal sealed class EventInfoComponent
public void Draw() public void Draw()
{ {
UpdateCacheIfNeeded(); UpdateCacheIfNeeded();
foreach (IGrouping<string, IQuestInfo> item in _cachedActiveSeasonalQuests.GroupBy(delegate(IQuestInfo q) foreach (IGrouping<string, IQuestInfo> tooltipText in _cachedActiveSeasonalQuests.GroupBy(delegate(IQuestInfo q)
{ {
if (q.QuestId is UnlockLinkId) if (q.QuestId is UnlockLinkId)
{ {
@ -89,11 +89,11 @@ internal sealed class EventInfoComponent
return q.JournalGenre.HasValue ? GetJournalGenreName(q.JournalGenre.Value) : q.Name; return q.JournalGenre.HasValue ? GetJournalGenreName(q.JournalGenre.Value) : q.Name;
})) }))
{ {
if (item.All((IQuestInfo q) => _questFunctions.IsQuestComplete(q.QuestId))) if (tooltipText.All((IQuestInfo q) => _questFunctions.IsQuestComplete(q.QuestId)))
{ {
continue; continue;
} }
DateTime endsAtUtc = item.Select(delegate(IQuestInfo q) DateTime quest = tooltipText.Select(delegate(IQuestInfo q)
{ {
DateTime? dateTime = (q as QuestInfo)?.SeasonalQuestExpiry ?? ((q is UnlockLinkQuestInfo unlockLinkQuestInfo) ? unlockLinkQuestInfo.QuestExpiry : ((DateTime?)null)); DateTime? dateTime = (q as QuestInfo)?.SeasonalQuestExpiry ?? ((q is UnlockLinkQuestInfo unlockLinkQuestInfo) ? unlockLinkQuestInfo.QuestExpiry : ((DateTime?)null));
if (dateTime.HasValue) if (dateTime.HasValue)
@ -103,12 +103,12 @@ internal sealed class EventInfoComponent
} }
return DateTime.MaxValue; return DateTime.MaxValue;
}).DefaultIfEmpty(DateTime.MaxValue).Min(); }).DefaultIfEmpty(DateTime.MaxValue).Min();
List<string> list = (from q in item List<string> list = (from q in tooltipText
select (q as UnlockLinkQuestInfo)?.Patch into p select (q as UnlockLinkQuestInfo)?.Patch into p
where !string.IsNullOrEmpty(p) where !string.IsNullOrEmpty(p)
select p).Distinct().ToList(); select p).Distinct().ToList();
string patch = ((list.Count == 1) ? list[0] : null); string patch = ((list.Count == 1) ? list[0] : null);
EventQuest eventQuest = new EventQuest(item.Key, item.Select((IQuestInfo q) => q.QuestId).ToList(), endsAtUtc, patch); EventQuest eventQuest = new EventQuest(tooltipText.Key, tooltipText.Select((IQuestInfo q) => q.QuestId).ToList(), quest, patch);
DrawEventQuest(eventQuest); DrawEventQuest(eventQuest);
} }
} }
@ -117,10 +117,10 @@ internal sealed class EventInfoComponent
{ {
try try
{ {
JournalGenre row = _dataManager.GetExcelSheet<JournalGenre>().GetRow(journalGenreId); JournalGenre actualQuestInfo = _dataManager.GetExcelSheet<JournalGenre>().GetRow(journalGenreId);
if (!row.Equals(default(JournalGenre))) if (!actualQuestInfo.Equals(default(JournalGenre)))
{ {
return row.Name.ExtractText(); return actualQuestInfo.Name.ExtractText();
} }
} }
catch (Exception exception) catch (Exception exception)
@ -132,10 +132,10 @@ internal sealed class EventInfoComponent
private void DrawEventQuest(EventQuest eventQuest) private void DrawEventQuest(EventQuest eventQuest)
{ {
string text = eventQuest.Name; string name = eventQuest.Name;
if (!string.IsNullOrEmpty(eventQuest.Patch)) if (!string.IsNullOrEmpty(eventQuest.Patch))
{ {
text = text + " [" + eventQuest.Patch + "]"; name = name + " [" + eventQuest.Patch + "]";
} }
if (eventQuest.EndsAtUtc != DateTime.MaxValue) if (eventQuest.EndsAtUtc != DateTime.MaxValue)
{ {
@ -145,21 +145,21 @@ internal sealed class EventInfoComponent
timeSpan = TimeSpan.Zero; timeSpan = TimeSpan.Zero;
} }
string value = FormatRemainingDays(timeSpan); string value = FormatRemainingDays(timeSpan);
string text2 = FormatRemainingFull(timeSpan); string text = FormatRemainingFull(timeSpan);
ImU8String text3 = new ImU8String(3, 2); ImU8String text2 = new ImU8String(3, 2);
text3.AppendFormatted(text); text2.AppendFormatted(name);
text3.AppendLiteral(" ("); text2.AppendLiteral(" (");
text3.AppendFormatted(value); text2.AppendFormatted(value);
text3.AppendLiteral(")"); text2.AppendLiteral(")");
ImGui.Text(text3); ImGui.Text(text2);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
{ {
ImGui.SetTooltip(text2); ImGui.SetTooltip(text);
} }
} }
else else
{ {
ImGui.Text(text); ImGui.Text(name);
} }
List<ElementId> list = eventQuest.QuestIds.Where((ElementId x) => _questRegistry.IsKnownQuest(x) && _questFunctions.IsReadyToAcceptQuest(x) && x != _questController.StartedQuest?.Quest.Id && x != _questController.NextQuest?.Quest.Id).ToList(); List<ElementId> list = eventQuest.QuestIds.Where((ElementId x) => _questRegistry.IsKnownQuest(x) && _questFunctions.IsReadyToAcceptQuest(x) && x != _questController.StartedQuest?.Quest.Id && x != _questController.NextQuest?.Quest.Id).ToList();
foreach (ElementId questId in eventQuest.QuestIds) foreach (ElementId questId in eventQuest.QuestIds)
@ -168,12 +168,12 @@ internal sealed class EventInfoComponent
{ {
continue; continue;
} }
ImU8String text3 = new ImU8String(21, 1); ImU8String text2 = new ImU8String(21, 1);
text3.AppendLiteral("##EventQuestSelection"); text2.AppendLiteral("##EventQuestSelection");
text3.AppendFormatted(questId); text2.AppendFormatted(questId);
using (ImRaii.PushId(text3)) using (ImRaii.PushId(text2))
{ {
string name = _questData.GetQuestInfo(questId).Name; string name2 = _questData.GetQuestInfo(questId).Name;
if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest)) if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))
{ {
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play)) if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
@ -184,7 +184,7 @@ internal sealed class EventInfoComponent
bool num = ImGui.IsItemHovered(); bool num = ImGui.IsItemHovered();
ImGui.SameLine(); ImGui.SameLine();
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Text(name); ImGui.Text(name2);
if (num | ImGui.IsItemHovered()) if (num | ImGui.IsItemHovered())
{ {
_questTooltipComponent.Draw(quest.Info); _questTooltipComponent.Draw(quest.Info);
@ -194,7 +194,7 @@ internal sealed class EventInfoComponent
{ {
ImGui.SetCursorPosX(ImGui.GetCursorPosX()); ImGui.SetCursorPosX(ImGui.GetCursorPosX());
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(questId); (Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(questId);
if (_uiUtils.ChecklistItem(name, questStyle.Item1, questStyle.Item2, ImGui.GetStyle().FramePadding.X)) if (_uiUtils.ChecklistItem(name2, questStyle.Item1, questStyle.Item2, ImGui.GetStyle().FramePadding.X))
{ {
_questTooltipComponent.Draw(_questData.GetQuestInfo(questId)); _questTooltipComponent.Draw(_questData.GetQuestInfo(questId));
} }
@ -424,14 +424,14 @@ internal sealed class EventInfoComponent
private static string FormatRemainingFull(TimeSpan remaining) private static string FormatRemainingFull(TimeSpan remaining)
{ {
int num = (int)Math.Ceiling(Math.Max(0.0, remaining.TotalSeconds)); int num = (int)Math.Ceiling(Math.Max(0.0, remaining.TotalSeconds));
int num2 = num / 86400; int errorCount = num / 86400;
int value = num % 86400 / 3600; int infoCount = num % 86400 / 3600;
int value2 = num % 3600 / 60; int partsToRender = num % 3600 / 60;
int value3 = num % 60; int id = num % 60;
if (num2 < 1) if (errorCount < 1)
{ {
return $"Ends in {value:D2}d {value2:D2}m {value3:D2}s"; return $"Ends in {infoCount:D2}d {partsToRender:D2}m {id:D2}s";
} }
return $"Ends in {num2}d {value:D2}h {value2:D2}m {value3:D2}s"; return $"Ends in {errorCount}d {infoCount:D2}h {partsToRender:D2}m {id:D2}s";
} }
} }

View file

@ -117,11 +117,11 @@ internal sealed class PresetBuilderComponent
where x.Key.StartsWith("aether_currents_", StringComparison.Ordinal) where x.Key.StartsWith("aether_currents_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder orderby x.Value.DisplayOrder
select x; select x;
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable2 = from x in _availablePresets IOrderedEnumerable<KeyValuePair<string, QuestPreset>> filteredTerritories = from x in _availablePresets
where x.Key.StartsWith("aethernet_", StringComparison.Ordinal) where x.Key.StartsWith("aethernet_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder orderby x.Value.DisplayOrder
select x; select x;
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable3 = from x in _availablePresets IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable2 = from x in _availablePresets
where !x.Key.StartsWith("aether_currents_", StringComparison.Ordinal) && !x.Key.StartsWith("aethernet_", StringComparison.Ordinal) where !x.Key.StartsWith("aether_currents_", StringComparison.Ordinal) && !x.Key.StartsWith("aethernet_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder orderby x.Value.DisplayOrder
select x; select x;
@ -140,11 +140,11 @@ internal sealed class PresetBuilderComponent
} }
} }
} }
if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", orderedEnumerable2)) if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", filteredTerritories))
{ {
using (ImRaii.PushIndent()) using (ImRaii.PushIndent())
{ {
foreach (KeyValuePair<string, QuestPreset> item2 in orderedEnumerable2) foreach (KeyValuePair<string, QuestPreset> item2 in filteredTerritories)
{ {
item2.Deconstruct(out key, out value); item2.Deconstruct(out key, out value);
string key3 = key; string key3 = key;
@ -153,13 +153,13 @@ internal sealed class PresetBuilderComponent
} }
} }
} }
if (!orderedEnumerable3.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable3)) if (!orderedEnumerable2.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable2))
{ {
return; return;
} }
using (ImRaii.PushIndent()) using (ImRaii.PushIndent())
{ {
foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable3) foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable2)
{ {
item3.Deconstruct(out key, out value); item3.Deconstruct(out key, out value);
string key4 = key; string key4 = key;
@ -172,31 +172,31 @@ internal sealed class PresetBuilderComponent
private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable<KeyValuePair<string, QuestPreset>> presets) private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable<KeyValuePair<string, QuestPreset>> presets)
{ {
int num = 0; int num = 0;
int filteredPoints = 0;
int num2 = 0; int num2 = 0;
int num3 = 0;
foreach (KeyValuePair<string, QuestPreset> preset2 in presets) foreach (KeyValuePair<string, QuestPreset> preset2 in presets)
{ {
preset2.Deconstruct(out var _, out var value); preset2.Deconstruct(out var _, out var value);
QuestPreset preset = value; QuestPreset preset = value;
num += GetAvailableQuestsForPreset(preset).Count; num += GetAvailableQuestsForPreset(preset).Count;
num2 += GetCompletedQuestsForPreset(preset).Count; filteredPoints += GetCompletedQuestsForPreset(preset).Count;
num3 += GetAlreadyPriorityQuestsForPreset(preset).Count; num2 += GetAlreadyPriorityQuestsForPreset(preset).Count;
} }
string text = groupName; string text = groupName;
if (num > 0 || num2 > 0 || num3 > 0) if (num > 0 || filteredPoints > 0 || num2 > 0)
{ {
List<string> list = new List<string>(); List<string> list = new List<string>();
if (num > 0) if (num > 0)
{ {
list.Add($"{num} available"); list.Add($"{num} available");
} }
if (num3 > 0)
{
list.Add($"{num3} priority");
}
if (num2 > 0) if (num2 > 0)
{ {
list.Add($"{num2} completed"); list.Add($"{num2} priority");
}
if (filteredPoints > 0)
{
list.Add($"{filteredPoints} completed");
} }
if (list.Count > 0) if (list.Count > 0)
{ {
@ -221,16 +221,16 @@ internal sealed class PresetBuilderComponent
{ {
using (ImRaii.PushId(key)) using (ImRaii.PushId(key))
{ {
List<ElementId> availableQuestsForPreset = GetAvailableQuestsForPreset(preset); List<ElementId> filteredItems = GetAvailableQuestsForPreset(preset);
List<ElementId> completedQuestsForPreset = GetCompletedQuestsForPreset(preset); List<ElementId> completedQuestsForPreset = GetCompletedQuestsForPreset(preset);
List<ElementId> alreadyPriorityQuestsForPreset = GetAlreadyPriorityQuestsForPreset(preset); List<ElementId> alreadyPriorityQuestsForPreset = GetAlreadyPriorityQuestsForPreset(preset);
string text = preset.Name; string text = preset.Name;
if (availableQuestsForPreset.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0) if (filteredItems.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
{ {
List<string> list = new List<string>(); List<string> list = new List<string>();
if (availableQuestsForPreset.Count > 0) if (filteredItems.Count > 0)
{ {
list.Add($"{availableQuestsForPreset.Count} available"); list.Add($"{filteredItems.Count} available");
} }
if (alreadyPriorityQuestsForPreset.Count > 0) if (alreadyPriorityQuestsForPreset.Count > 0)
{ {
@ -265,7 +265,7 @@ internal sealed class PresetBuilderComponent
ImGui.TextWrapped(preset.Description); ImGui.TextWrapped(preset.Description);
ImGui.Spacing(); ImGui.Spacing();
bool flag = key.StartsWith("aethernet_", StringComparison.Ordinal); bool flag = key.StartsWith("aethernet_", StringComparison.Ordinal);
if (flag && availableQuestsForPreset.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0) if (flag && filteredItems.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
{ {
EAetheryteLocation? mainAetheryteForAethernetPreset = GetMainAetheryteForAethernetPreset(key); EAetheryteLocation? mainAetheryteForAethernetPreset = GetMainAetheryteForAethernetPreset(key);
if (mainAetheryteForAethernetPreset.HasValue && !_aetheryteFunctions.IsAetheryteUnlocked(mainAetheryteForAethernetPreset.Value)) if (mainAetheryteForAethernetPreset.HasValue && !_aetheryteFunctions.IsAetheryteUnlocked(mainAetheryteForAethernetPreset.Value))
@ -274,9 +274,9 @@ internal sealed class PresetBuilderComponent
ImGui.Spacing(); ImGui.Spacing();
} }
} }
if (availableQuestsForPreset.Count > 0) if (filteredItems.Count > 0)
{ {
_uiUtils.ChecklistItem($"{availableQuestsForPreset.Count} {((availableQuestsForPreset.Count == 1) ? "quest" : "quests")} available", ImGuiColors.DalamudYellow, FontAwesomeIcon.Running); _uiUtils.ChecklistItem($"{filteredItems.Count} {((filteredItems.Count == 1) ? "quest" : "quests")} available", ImGuiColors.DalamudYellow, FontAwesomeIcon.Running);
} }
if (alreadyPriorityQuestsForPreset.Count > 0) if (alreadyPriorityQuestsForPreset.Count > 0)
{ {
@ -286,7 +286,7 @@ internal sealed class PresetBuilderComponent
{ {
_uiUtils.ChecklistItem($"{completedQuestsForPreset.Count} {((completedQuestsForPreset.Count == 1) ? "quest" : "quests")} already completed", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check); _uiUtils.ChecklistItem($"{completedQuestsForPreset.Count} {((completedQuestsForPreset.Count == 1) ? "quest" : "quests")} already completed", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check);
} }
if (availableQuestsForPreset.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0) if (filteredItems.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
{ {
if (!flag) if (!flag)
{ {
@ -303,20 +303,20 @@ internal sealed class PresetBuilderComponent
} }
goto IL_03d8; goto IL_03d8;
IL_03d8: IL_03d8:
if (availableQuestsForPreset.Count > 0) if (filteredItems.Count > 0)
{ {
ImGui.Spacing(); ImGui.Spacing();
string text2 = ((availableQuestsForPreset.Count == 1) ? "Add Quest to Priority" : $"Add All {availableQuestsForPreset.Count} Quests to Priority"); string text2 = ((filteredItems.Count == 1) ? "Add Quest to Priority" : $"Add All {filteredItems.Count} Quests to Priority");
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, text2)) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, text2))
{ {
AddPresetToPriority(preset, availableQuestsForPreset); AddPresetToPriority(preset, filteredItems);
} }
} }
if (availableQuestsForPreset.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0) if (filteredItems.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
{ {
ImGui.Spacing(); ImGui.Spacing();
ImGui.Separator(); ImGui.Separator();
foreach (ElementId item in availableQuestsForPreset) foreach (ElementId item in filteredItems)
{ {
if (_questData.TryGetQuestInfo(item, out IQuestInfo questInfo)) if (_questData.TryGetQuestInfo(item, out IQuestInfo questInfo))
{ {
@ -394,30 +394,30 @@ internal sealed class PresetBuilderComponent
private void ClearAllPresetQuests(List<ElementId> questsToRemove) private void ClearAllPresetQuests(List<ElementId> questsToRemove)
{ {
int num = 0; int tab = 0;
foreach (ElementId questId in questsToRemove) foreach (ElementId questId in questsToRemove)
{ {
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(questId)); Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(questId));
if (quest != null) if (quest != null)
{ {
_questController.ManualPriorityQuests.Remove(quest); _questController.ManualPriorityQuests.Remove(quest);
num++; tab++;
} }
} }
_logger.LogInformation("Removed {Count} preset quests from priority list", num); _logger.LogInformation("Removed {Count} preset quests from priority list", tab);
} }
private void AddPresetToPriority(QuestPreset preset, List<ElementId> questIds) private void AddPresetToPriority(QuestPreset preset, List<ElementId> questIds)
{ {
int num = 0; int available = 0;
foreach (ElementId questId in questIds) foreach (ElementId obtainable in questIds)
{ {
if (_questController.AddQuestPriority(questId)) if (_questController.AddQuestPriority(obtainable))
{ {
num++; available++;
} }
} }
_logger.LogInformation("Added {Count} quests from preset '{PresetName}' to priority list", num, preset.Name); _logger.LogInformation("Added {Count} quests from preset '{PresetName}' to priority list", available, preset.Name);
} }
private void AddIndividualQuestToPriority(IQuestInfo questInfo, ElementId questId) private void AddIndividualQuestToPriority(IQuestInfo questInfo, ElementId questId)
@ -614,15 +614,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list15 = new List<ElementId>(num); List<ElementId> list15 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list15, num); CollectionsMarshal.SetCount(list15, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list15); Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
int index = 0; int text = 0;
span[index] = new AethernetId(1); span[text] = new AethernetId(1);
return list15; return list15;
} }
case "Gridania": case "Gridania":
{ {
int index = 1; int text = 1;
List<ElementId> list14 = new List<ElementId>(index); List<ElementId> list14 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list14, index); CollectionsMarshal.SetCount(list14, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list14); Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
int num = 0; int num = 0;
span[num] = new AethernetId(2); span[num] = new AethernetId(2);
@ -634,15 +634,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list13 = new List<ElementId>(num); List<ElementId> list13 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list13, num); CollectionsMarshal.SetCount(list13, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list13); Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
int index = 0; int text = 0;
span[index] = new AethernetId(3); span[text] = new AethernetId(3);
return list13; return list13;
} }
case "GoldSaucer": case "GoldSaucer":
{ {
int index = 1; int text = 1;
List<ElementId> list12 = new List<ElementId>(index); List<ElementId> list12 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list12, index); CollectionsMarshal.SetCount(list12, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list12); Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
int num = 0; int num = 0;
span[num] = new AethernetId(4); span[num] = new AethernetId(4);
@ -654,15 +654,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list11 = new List<ElementId>(num); List<ElementId> list11 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list11, num); CollectionsMarshal.SetCount(list11, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list11); Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
int index = 0; int text = 0;
span[index] = new AethernetId(5); span[text] = new AethernetId(5);
return list11; return list11;
} }
case "Idyllshire": case "Idyllshire":
{ {
int index = 1; int text = 1;
List<ElementId> list10 = new List<ElementId>(index); List<ElementId> list10 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list10, index); CollectionsMarshal.SetCount(list10, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list10); Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
int num = 0; int num = 0;
span[num] = new AethernetId(6); span[num] = new AethernetId(6);
@ -674,15 +674,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list9 = new List<ElementId>(num); List<ElementId> list9 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list9, num); CollectionsMarshal.SetCount(list9, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list9); Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
int index = 0; int text = 0;
span[index] = new AethernetId(7); span[text] = new AethernetId(7);
return list9; return list9;
} }
case "Kugane": case "Kugane":
{ {
int index = 1; int text = 1;
List<ElementId> list8 = new List<ElementId>(index); List<ElementId> list8 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list8, index); CollectionsMarshal.SetCount(list8, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list8); Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
int num = 0; int num = 0;
span[num] = new AethernetId(8); span[num] = new AethernetId(8);
@ -694,15 +694,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list7 = new List<ElementId>(num); List<ElementId> list7 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list7, num); CollectionsMarshal.SetCount(list7, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list7); Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
int index = 0; int text = 0;
span[index] = new AethernetId(9); span[text] = new AethernetId(9);
return list7; return list7;
} }
case "The Crystarium": case "The Crystarium":
{ {
int index = 1; int text = 1;
List<ElementId> list6 = new List<ElementId>(index); List<ElementId> list6 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list6, index); CollectionsMarshal.SetCount(list6, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list6); Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
int num = 0; int num = 0;
span[num] = new AethernetId(10); span[num] = new AethernetId(10);
@ -714,15 +714,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list5 = new List<ElementId>(num); List<ElementId> list5 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list5, num); CollectionsMarshal.SetCount(list5, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list5); Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
int index = 0; int text = 0;
span[index] = new AethernetId(11); span[text] = new AethernetId(11);
return list5; return list5;
} }
case "Old Sharlayan": case "Old Sharlayan":
{ {
int index = 1; int text = 1;
List<ElementId> list4 = new List<ElementId>(index); List<ElementId> list4 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list4, index); CollectionsMarshal.SetCount(list4, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list4); Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
int num = 0; int num = 0;
span[num] = new AethernetId(12); span[num] = new AethernetId(12);
@ -734,15 +734,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list3 = new List<ElementId>(num); List<ElementId> list3 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list3, num); CollectionsMarshal.SetCount(list3, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list3); Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
int index = 0; int text = 0;
span[index] = new AethernetId(13); span[text] = new AethernetId(13);
return list3; return list3;
} }
case "Tuliyollal": case "Tuliyollal":
{ {
int index = 1; int text = 1;
List<ElementId> list2 = new List<ElementId>(index); List<ElementId> list2 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list2, index); CollectionsMarshal.SetCount(list2, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list2); Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
int num = 0; int num = 0;
span[num] = new AethernetId(14); span[num] = new AethernetId(14);
@ -754,8 +754,8 @@ internal sealed class PresetBuilderComponent
List<ElementId> list = new List<ElementId>(num); List<ElementId> list = new List<ElementId>(num);
CollectionsMarshal.SetCount(list, num); CollectionsMarshal.SetCount(list, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list); Span<ElementId> span = CollectionsMarshal.AsSpan(list);
int index = 0; int text = 0;
span[index] = new AethernetId(15); span[text] = new AethernetId(15);
return list; return list;
} }
default: default:

View file

@ -38,8 +38,8 @@ internal sealed class QuestTooltipComponent
public void Draw(IQuestInfo questInfo) public void Draw(IQuestInfo questInfo)
{ {
using ImRaii.IEndObject endObject = ImRaii.Tooltip(); using ImRaii.IEndObject quest = ImRaii.Tooltip();
if (endObject) if (quest)
{ {
DrawInner(questInfo, showItemRewards: true); DrawInner(questInfo, showItemRewards: true);
} }

View file

@ -99,8 +99,8 @@ internal sealed class QuestValidationComponent
private void DrawValidationTable() private void DrawValidationTable()
{ {
using ImRaii.IEndObject endObject = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY); using ImRaii.IEndObject tab = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY);
if (!(!endObject)) if (!(!tab))
{ {
ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f); ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f); ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f);

View file

@ -82,30 +82,30 @@ internal sealed class ValidationDetailsRenderer
public void DrawDetailWindows() public void DrawDetailWindows()
{ {
List<int> list = new List<int>(); List<int> tab = new List<int>();
foreach (KeyValuePair<int, bool> item in _openDetailWindows.ToList()) foreach (KeyValuePair<int, bool> neverFly in _openDetailWindows.ToList())
{ {
if (item.Value && _storedIssues.TryGetValue(item.Key, out ValidationIssue value)) if (neverFly.Value && _storedIssues.TryGetValue(neverFly.Key, out ValidationIssue additionalStatusInformation))
{ {
string obj = $"Validation Details##{item.Key}"; string obj = $"Validation Details##{neverFly.Key}";
bool open = true; bool open = true;
ImGui.SetNextWindowSize(new Vector2(800f, 600f), ImGuiCond.FirstUseEver); ImGui.SetNextWindowSize(new Vector2(800f, 600f), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSizeConstraints(new Vector2(500f, 300f), new Vector2(1200f, 800f)); ImGui.SetNextWindowSizeConstraints(new Vector2(500f, 300f), new Vector2(1200f, 800f));
if (ImGui.Begin(obj, ref open)) if (ImGui.Begin(obj, ref open))
{ {
DrawIssueDetails(value); DrawIssueDetails(additionalStatusInformation);
ImGui.End(); ImGui.End();
} }
if (!open) if (!open)
{ {
list.Add(item.Key); tab.Add(neverFly.Key);
} }
} }
} }
foreach (int item2 in list) foreach (int combatDataOverlay in tab)
{ {
_openDetailWindows.Remove(item2); _openDetailWindows.Remove(combatDataOverlay);
_storedIssues.Remove(item2); _storedIssues.Remove(combatDataOverlay);
} }
} }
@ -184,10 +184,10 @@ internal sealed class ValidationDetailsRenderer
private static void DrawJsonSyntaxErrorDetails(string description) private static void DrawJsonSyntaxErrorDetails(string description)
{ {
string[] array = description.Split('\n'); string[] tab = description.Split('\n');
for (int i = 0; i < array.Length; i++) for (int runInstancedContentWithAutoDuty = 0; runInstancedContentWithAutoDuty < tab.Length; runInstancedContentWithAutoDuty++)
{ {
string text = array[i].Trim(); string text = tab[runInstancedContentWithAutoDuty].Trim();
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
{ {
ImGui.Spacing(); ImGui.Spacing();
@ -222,15 +222,15 @@ internal sealed class ValidationDetailsRenderer
private void DrawDisabledTribesDetails(string description) private void DrawDisabledTribesDetails(string description)
{ {
string[] array = description.Split(':', 2); string[] child = description.Split(':', 2);
if (array.Length < 2) if (child.Length < 2)
{ {
ImGui.TextWrapped(description); ImGui.TextWrapped(description);
return; return;
} }
ImGui.TextWrapped(array[0]); ImGui.TextWrapped(child[0]);
ImGui.Spacing(); ImGui.Spacing();
List<string> list = (from x in array[1].Split(',', StringSplitOptions.RemoveEmptyEntries) List<string> list = (from x in child[1].Split(',', StringSplitOptions.RemoveEmptyEntries)
select x.Trim() into x select x.Trim() into x
where !string.IsNullOrEmpty(x) where !string.IsNullOrEmpty(x)
select x).Distinct().ToList(); select x).Distinct().ToList();
@ -241,7 +241,7 @@ internal sealed class ValidationDetailsRenderer
} }
ImGui.Text("Disabled Quests:"); ImGui.Text("Disabled Quests:");
ImGui.Indent(); ImGui.Indent();
Vector4[] array2 = new Vector4[6] Vector4[] array = new Vector4[6]
{ {
ImGuiColors.TankBlue, ImGuiColors.TankBlue,
ImGuiColors.HealerGreen, ImGuiColors.HealerGreen,
@ -250,29 +250,29 @@ internal sealed class ValidationDetailsRenderer
ImGuiColors.ParsedBlue, ImGuiColors.ParsedBlue,
ImGuiColors.DalamudViolet ImGuiColors.DalamudViolet
}; };
for (int num = 0; num < list.Count; num++) for (int expansion = 0; expansion < list.Count; expansion++)
{ {
string value = list[num]; string enabledCount = list[expansion];
Vector4 color = array2[num % array2.Length]; Vector4 totalCount = array[expansion % array.Length];
using (ImRaii.PushColor(ImGuiCol.Text, color)) using (ImRaii.PushColor(ImGuiCol.Text, totalCount))
{ {
if (ElementId.TryFromString(value, out ElementId elementId) && elementId != null) if (ElementId.TryFromString(enabledCount, out ElementId elementId) && elementId != null)
{ {
try try
{ {
IQuestInfo questInfo = _questData.GetQuestInfo(elementId); IQuestInfo table = _questData.GetQuestInfo(elementId);
ImU8String text = new ImU8String(5, 2); ImU8String text = new ImU8String(5, 2);
text.AppendLiteral("\ufffd "); text.AppendLiteral("\ufffd ");
text.AppendFormatted(value); text.AppendFormatted(enabledCount);
text.AppendLiteral(" - "); text.AppendLiteral(" - ");
text.AppendFormatted(questInfo.Name); text.AppendFormatted(table.Name);
ImGui.TextWrapped(text); ImGui.TextWrapped(text);
} }
catch catch
{ {
ImU8String text = new ImU8String(18, 1); ImU8String text = new ImU8String(18, 1);
text.AppendLiteral("\ufffd "); text.AppendLiteral("\ufffd ");
text.AppendFormatted(value); text.AppendFormatted(enabledCount);
text.AppendLiteral(" (unknown quest)"); text.AppendLiteral(" (unknown quest)");
ImGui.TextWrapped(text); ImGui.TextWrapped(text);
} }
@ -281,7 +281,7 @@ internal sealed class ValidationDetailsRenderer
{ {
ImU8String text = new ImU8String(2, 1); ImU8String text = new ImU8String(2, 1);
text.AppendLiteral("\ufffd "); text.AppendLiteral("\ufffd ");
text.AppendFormatted(value); text.AppendFormatted(enabledCount);
ImGui.TextWrapped(text); ImGui.TextWrapped(text);
} }
} }
@ -296,15 +296,15 @@ internal sealed class ValidationDetailsRenderer
ImGui.TextWrapped("No validation details available."); ImGui.TextWrapped("No validation details available.");
return; return;
} }
List<JsonValidationError> list = ParseJsonValidationErrors(description); List<JsonValidationError> cfcNames = ParseJsonValidationErrors(description);
if (list.Count > 0) if (cfcNames.Count > 0)
{ {
ImGui.Text("JSON Schema Validation Errors:"); ImGui.Text("JSON Schema Validation Errors:");
ImGui.Spacing(); ImGui.Spacing();
for (int i = 0; i < list.Count; i++) for (int enabledCount = 0; enabledCount < cfcNames.Count; enabledCount++)
{ {
DrawJsonValidationError(list[i], i); DrawJsonValidationError(cfcNames[enabledCount], enabledCount);
if (i < list.Count - 1) if (enabledCount < cfcNames.Count - 1)
{ {
ImGui.Separator(); ImGui.Separator();
} }
@ -390,8 +390,8 @@ internal sealed class ValidationDetailsRenderer
private static void DrawSimpleJsonSchemaDetails(string description) private static void DrawSimpleJsonSchemaDetails(string description)
{ {
string[] array = description.Split('\n'); string[] clipboardText = description.Split('\n');
foreach (string text in array) foreach (string text in clipboardText)
{ {
if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal)) if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal))
{ {
@ -402,11 +402,11 @@ internal sealed class ValidationDetailsRenderer
} }
else if (text.StartsWith(" - ", StringComparison.Ordinal)) else if (text.StartsWith(" - ", StringComparison.Ordinal))
{ {
int num = text.IndexOf(':', 3); int whitelisted = text.IndexOf(':', 3);
if (num > 0) if (whitelisted > 0)
{ {
string path = text.Substring(3, num - 3).Trim(); string blacklisted = text.Substring(3, whitelisted - 3).Trim();
string text2 = CleanJsonText(text.Substring(num + 1).Trim()); string text2 = CleanJsonText(text.Substring(whitelisted + 1).Trim());
if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase)) if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase))
{ {
text2 = "Schema validation failed - check property format and values"; text2 = "Schema validation failed - check property format and values";
@ -415,7 +415,7 @@ internal sealed class ValidationDetailsRenderer
ImGui.SameLine(); ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue)) using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
{ {
ImGui.Text(FormatJsonPath(path)); ImGui.Text(FormatJsonPath(blacklisted));
} }
ImGui.SameLine(); ImGui.SameLine();
ImGui.Text(":"); ImGui.Text(":");
@ -477,12 +477,12 @@ internal sealed class ValidationDetailsRenderer
Match match = JsonPropertyPathRegex.Match(path); Match match = JsonPropertyPathRegex.Match(path);
if (match.Success) if (match.Success)
{ {
string value = match.Groups[1].Value; string mounts = match.Groups[1].Value;
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(mounts))
{ {
return "<root>"; return "<root>";
} }
return value.Replace('/', '.'); return mounts.Replace('/', '.');
} }
if (!(path == "<root>")) if (!(path == "<root>"))
{ {
@ -493,40 +493,40 @@ internal sealed class ValidationDetailsRenderer
private static List<string> GetValidationSuggestions(JsonValidationError error) private static List<string> GetValidationSuggestions(JsonValidationError error)
{ {
List<string> list = new List<string>(); List<string> tab = new List<string>();
foreach (string message in error.Messages) foreach (string message in error.Messages)
{ {
string text = message.ToUpperInvariant(); string grandCompany = message.ToUpperInvariant();
if (text.Contains("REQUIRED", StringComparison.Ordinal)) if (grandCompany.Contains("REQUIRED", StringComparison.Ordinal))
{ {
list.Add("Add the missing required property to your JSON."); tab.Add("Add the missing required property to your JSON.");
} }
else if (text.Contains("TYPE", StringComparison.Ordinal)) else if (grandCompany.Contains("TYPE", StringComparison.Ordinal))
{ {
list.Add("Check that the property value has the correct data type (string, number, boolean, etc.)."); tab.Add("Check that the property value has the correct data type (string, number, boolean, etc.).");
} }
else if (text.Contains("ENUM", StringComparison.Ordinal) || text.Contains("ALLOWED VALUES", StringComparison.Ordinal)) else if (grandCompany.Contains("ENUM", StringComparison.Ordinal) || grandCompany.Contains("ALLOWED VALUES", StringComparison.Ordinal))
{ {
list.Add("Use one of the allowed enumeration values for this property."); tab.Add("Use one of the allowed enumeration values for this property.");
} }
else if (text.Contains("FORMAT", StringComparison.Ordinal)) else if (grandCompany.Contains("FORMAT", StringComparison.Ordinal))
{ {
list.Add("Ensure the property value follows the expected format."); tab.Add("Ensure the property value follows the expected format.");
} }
else if (text.Contains("MINIMUM", StringComparison.Ordinal) || text.Contains("MAXIMUM", StringComparison.Ordinal)) else if (grandCompany.Contains("MINIMUM", StringComparison.Ordinal) || grandCompany.Contains("MAXIMUM", StringComparison.Ordinal))
{ {
list.Add("Check that numeric values are within the allowed range."); tab.Add("Check that numeric values are within the allowed range.");
} }
else if (text.Contains("ADDITIONAL", StringComparison.Ordinal) && text.Contains("NOT ALLOWED", StringComparison.Ordinal)) else if (grandCompany.Contains("ADDITIONAL", StringComparison.Ordinal) && grandCompany.Contains("NOT ALLOWED", StringComparison.Ordinal))
{ {
list.Add("Remove any extra properties that are not defined in the schema."); tab.Add("Remove any extra properties that are not defined in the schema.");
} }
else if (text.Contains("VALIDATION FAILED", StringComparison.Ordinal)) else if (grandCompany.Contains("VALIDATION FAILED", StringComparison.Ordinal))
{ {
list.Add("Review the JSON structure and ensure all properties match the expected schema format."); tab.Add("Review the JSON structure and ensure all properties match the expected schema format.");
} }
} }
return list.Distinct().ToList(); return tab.Distinct().ToList();
} }
private static void DrawGenericDetails(string description) private static void DrawGenericDetails(string description)

View file

@ -28,11 +28,11 @@ internal sealed class QuestSelector(QuestRegistry questRegistry)
if (ImGui.BeginCombo("##QuestSelection", "Add Quest...", ImGuiComboFlags.HeightLarge)) if (ImGui.BeginCombo("##QuestSelection", "Add Quest...", ImGuiComboFlags.HeightLarge))
{ {
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
bool flag = ImGui.InputTextWithHint("", "Filter...", ref _searchString, 256, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.EnterReturnsTrue); bool questWork = ImGui.InputTextWithHint("", "Filter...", ref _searchString, 256, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.EnterReturnsTrue);
IEnumerable<Quest> enumerable; IEnumerable<Quest> color;
if (!string.IsNullOrEmpty(_searchString)) if (!string.IsNullOrEmpty(_searchString))
{ {
enumerable = Enumerable.Where(predicate: (!ElementId.TryFromString(_searchString, out ElementId elementId)) ? new Func<Quest, bool>(DefaultPredicate) : ((Func<Quest, bool>)((Quest x) => DefaultPredicate(x) || x.Id == elementId)), source: questRegistry.AllQuests.Where(delegate(Quest x) color = Enumerable.Where(predicate: (!ElementId.TryFromString(_searchString, out ElementId elementId)) ? new Func<Quest, bool>(DefaultPredicate) : ((Func<Quest, bool>)((Quest x) => DefaultPredicate(x) || x.Id == elementId)), source: questRegistry.AllQuests.Where(delegate(Quest x)
{ {
ElementId id = x.Id; ElementId id = x.Id;
return !(id is SatisfactionSupplyNpcId) && !(id is AlliedSocietyDailyId); return !(id is SatisfactionSupplyNpcId) && !(id is AlliedSocietyDailyId);
@ -40,17 +40,17 @@ internal sealed class QuestSelector(QuestRegistry questRegistry)
} }
else else
{ {
enumerable = questRegistry.AllQuests.Where((Quest x) => this.DefaultPredicate?.Invoke(x) ?? true); color = questRegistry.AllQuests.Where((Quest x) => this.DefaultPredicate?.Invoke(x) ?? true);
} }
foreach (Quest item in enumerable) foreach (Quest progressText in color)
{ {
if ((SuggestionPredicate == null || SuggestionPredicate(item)) && (ImGui.Selectable(item.Info.Name) || flag)) if ((SuggestionPredicate == null || SuggestionPredicate(progressText)) && (ImGui.Selectable(progressText.Info.Name) || questWork))
{ {
QuestSelected(item); QuestSelected(progressText);
if (flag) if (questWork)
{ {
ImGui.CloseCurrentPopup(); ImGui.CloseCurrentPopup();
flag = false; questWork = false;
} }
} }
} }

View file

@ -74,8 +74,8 @@ internal sealed class DebugOverlay : Window
{ {
return; return;
} }
IClientState clientState = _clientState; IClientState clipboardItems = _clientState;
if (clientState != null && clientState.IsLoggedIn && clientState.LocalPlayer != null && !clientState.IsPvPExcludingDen && _questController.IsQuestWindowOpen) if (clipboardItems != null && clipboardItems.IsLoggedIn && clipboardItems.LocalPlayer != null && !clipboardItems.IsPvPExcludingDen && _questController.IsQuestWindowOpen)
{ {
DrawCurrentQuest(); DrawCurrentQuest();
DrawHighlightedQuest(); DrawHighlightedQuest();
@ -88,22 +88,22 @@ internal sealed class DebugOverlay : Window
private void DrawCurrentQuest() private void DrawCurrentQuest()
{ {
QuestController.QuestProgress currentQuest = _questController.CurrentQuest; QuestController.QuestProgress priorityQuests = _questController.CurrentQuest;
if (currentQuest == null) if (priorityQuests == null)
{ {
return; return;
} }
QuestSequence questSequence = currentQuest.Quest.FindSequence(currentQuest.Sequence); QuestSequence itemToRemove = priorityQuests.Quest.FindSequence(priorityQuests.Sequence);
if (questSequence == null) if (itemToRemove == null)
{ {
return; return;
} }
for (int i = currentQuest.Step; i <= questSequence.Steps.Count; i++) for (int itemToAdd = priorityQuests.Step; itemToAdd <= itemToRemove.Steps.Count; itemToAdd++)
{ {
QuestStep questStep = questSequence.FindStep(i); QuestStep indexToAdd = itemToRemove.FindStep(itemToAdd);
if (questStep != null && TryGetPosition(questStep, out var position)) if (indexToAdd != null && TryGetPosition(indexToAdd, out var width))
{ {
DrawStep(i.ToString(CultureInfo.InvariantCulture), questStep, position.Value, (Vector3.Distance(_clientState.LocalPlayer.Position, position.Value) < questStep.CalculateActualStopDistance()) ? 4278255360u : 4278190335u); DrawStep(itemToAdd.ToString(CultureInfo.InvariantCulture), indexToAdd, width.Value, (Vector3.Distance(_clientState.LocalPlayer.Position, width.Value) < indexToAdd.CalculateActualStopDistance()) ? 4278255360u : 4278190335u);
} }
} }
} }
@ -129,11 +129,11 @@ internal sealed class DebugOverlay : Window
private void DrawStep(string counter, QuestStep step, Vector3 position, uint color) private void DrawStep(string counter, QuestStep step, Vector3 position, uint color)
{ {
if (!step.Disabled && step.TerritoryId == _clientState.TerritoryType && _gameGui.WorldToScreen(position, out var screenPos)) if (!step.Disabled && step.TerritoryId == _clientState.TerritoryType && _gameGui.WorldToScreen(position, out var clipboardItems))
{ {
ImGui.GetWindowDrawList().AddCircleFilled(screenPos, 3f, color); ImGui.GetWindowDrawList().AddCircleFilled(clipboardItems, 3f, color);
ImDrawListPtr windowDrawList = ImGui.GetWindowDrawList(); ImDrawListPtr prefixToRemove = ImGui.GetWindowDrawList();
Vector2 pos = screenPos + new Vector2(10f, -8f); Vector2 pos = clipboardItems + new Vector2(10f, -8f);
ImU8String text = new ImU8String(7, 5); ImU8String text = new ImU8String(7, 5);
text.AppendFormatted(counter); text.AppendFormatted(counter);
text.AppendLiteral(": "); text.AppendLiteral(": ");
@ -144,7 +144,7 @@ internal sealed class DebugOverlay : Window
text.AppendFormatted((position - _clientState.LocalPlayer.Position).Length(), "N2"); text.AppendFormatted((position - _clientState.LocalPlayer.Position).Length(), "N2");
text.AppendLiteral("]\n"); text.AppendLiteral("]\n");
text.AppendFormatted(step.Comment); text.AppendFormatted(step.Comment);
windowDrawList.AddText(pos, color, text); prefixToRemove.AddText(pos, color, text);
} }
} }

View file

@ -44,20 +44,20 @@ internal sealed class PriorityWindow : LWindow
public override void DrawContent() public override void DrawContent()
{ {
using ImRaii.IEndObject endObject = ImRaii.TabBar("PriorityTabs"); using ImRaii.IEndObject table = ImRaii.TabBar("PriorityTabs");
if (!endObject) if (!table)
{ {
return; return;
} }
using (ImRaii.IEndObject endObject2 = ImRaii.TabItem("Manual Priority")) using (ImRaii.IEndObject statusIconSize = ImRaii.TabItem("Manual Priority"))
{ {
if (endObject2) if (statusIconSize)
{ {
_manualPriorityComponent.Draw(); _manualPriorityComponent.Draw();
} }
} }
using ImRaii.IEndObject endObject3 = ImRaii.TabItem("Quest Presets"); using ImRaii.IEndObject actionIconSize = ImRaii.TabItem("Quest Presets");
if (endObject3) if (actionIconSize)
{ {
_presetBuilderComponent.Draw(); _presetBuilderComponent.Draw();
} }
@ -65,7 +65,7 @@ internal sealed class PriorityWindow : LWindow
public static List<ElementId> DecodeQuestPriority(string clipboardText) public static List<ElementId> DecodeQuestPriority(string clipboardText)
{ {
List<ElementId> list = new List<ElementId>(); List<ElementId> fileName = new List<ElementId>();
try try
{ {
if (!string.IsNullOrEmpty(clipboardText)) if (!string.IsNullOrEmpty(clipboardText))
@ -86,15 +86,15 @@ internal sealed class PriorityWindow : LWindow
for (int i = 0; i < array.Length; i++) for (int i = 0; i < array.Length; i++)
{ {
ElementId item = ElementId.FromString(array[i]); ElementId item = ElementId.FromString(array[i]);
list.Add(item); fileName.Add(item);
} }
} }
} }
} }
catch (Exception) catch (Exception)
{ {
list.Clear(); fileName.Clear();
} }
return list; return fileName;
} }
} }

View file

@ -82,13 +82,13 @@ internal sealed class QuestSelectionWindow : LWindow
{ {
if (gameObject != null) if (gameObject != null)
{ {
uint baseId = gameObject.BaseId; uint table = gameObject.BaseId;
string value = gameObject.Name.ToString(); string value = gameObject.Name.ToString();
base.WindowName = $"Quests starting with {value} [{baseId}]{"###QuestionableQuestSelection"}"; base.WindowName = $"Quests starting with {value} [{table}]{"###QuestionableQuestSelection"}";
_quests = _questData.GetAllByIssuerDataId(baseId); _quests = _questData.GetAllByIssuerDataId(table);
if (_gameGui.TryGetAddonByName<AddonSelectIconString>("SelectIconString", out var addonPtr)) if (_gameGui.TryGetAddonByName<AddonSelectIconString>("SelectIconString", out var validationIssue))
{ {
List<string?> answers = InteractionUiController.GetChoices(addonPtr); List<string?> answers = InteractionUiController.GetChoices(validationIssue);
_offeredQuests = _quests.Where((IQuestInfo x) => answers.Any((string y) => GameFunctions.GameStringEquals(x.Name, y))).ToList(); _offeredQuests = _quests.Where((IQuestInfo x) => answers.Any((string y) => GameFunctions.GameStringEquals(x.Name, y))).ToList();
} }
else else