muffin v7.38.4
This commit is contained in:
parent
bbc394c386
commit
7177a5440c
8 changed files with 5330 additions and 4542 deletions
|
|
@ -1,11 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Ipc;
|
||||
using Questionable.Controller;
|
||||
using Questionable.Controller.Steps;
|
||||
using Questionable.Data;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
|
@ -38,6 +41,13 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
public required int RemainingTaskCount { get; init; }
|
||||
}
|
||||
|
||||
public sealed class StopConditionData
|
||||
{
|
||||
public required bool Enabled { get; init; }
|
||||
|
||||
public required int TargetValue { get; init; }
|
||||
}
|
||||
|
||||
private const string IpcIsRunning = "Questionable.IsRunning";
|
||||
|
||||
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
|
||||
|
|
@ -62,16 +72,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private const string IpcIsQuestUnobtainable = "Questionable.IsQuestUnobtainable";
|
||||
|
||||
private const string IpcImportQuestPriority = "Questionable.ImportQuestPriority";
|
||||
|
||||
private const string IpcClearQuestPriority = "Questionable.ClearQuestPriority";
|
||||
|
||||
private const string IpcAddQuestPriority = "Questionable.AddQuestPriority";
|
||||
|
||||
private const string IpcInsertQuestPriority = "Questionable.InsertQuestPriority";
|
||||
|
||||
private const string IpcExportQuestPriority = "Questionable.ExportQuestPriority";
|
||||
|
||||
private const string IpcGetDefaultDutyMode = "Questionable.GetDefaultDutyMode";
|
||||
|
||||
private const string IpcSetDefaultDutyMode = "Questionable.SetDefaultDutyMode";
|
||||
|
|
@ -84,14 +84,68 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private const string IpcClearAllDutyModeOverrides = "Questionable.ClearAllDutyModeOverrides";
|
||||
|
||||
private const string IpcImportQuestPriority = "Questionable.ImportQuestPriority";
|
||||
|
||||
private const string IpcClearQuestPriority = "Questionable.ClearQuestPriority";
|
||||
|
||||
private const string IpcAddQuestPriority = "Questionable.AddQuestPriority";
|
||||
|
||||
private const string IpcInsertQuestPriority = "Questionable.InsertQuestPriority";
|
||||
|
||||
private const string IpcExportQuestPriority = "Questionable.ExportQuestPriority";
|
||||
|
||||
private const string IpcGetPriorityQuests = "Questionable.GetPriorityQuests";
|
||||
|
||||
private const string IpcRemovePriorityQuest = "Questionable.RemovePriorityQuest";
|
||||
|
||||
private const string IpcReorderPriorityQuest = "Questionable.ReorderPriorityQuest";
|
||||
|
||||
private const string IpcGetAvailablePresets = "Questionable.GetAvailablePresets";
|
||||
|
||||
private const string IpcGetPresetQuests = "Questionable.GetPresetQuests";
|
||||
|
||||
private const string IpcAddPresetToPriority = "Questionable.AddPresetToPriority";
|
||||
|
||||
private const string IpcIsPresetAvailable = "Questionable.IsPresetAvailable";
|
||||
|
||||
private const string IpcIsQuestInPriority = "Questionable.IsQuestInPriority";
|
||||
|
||||
private const string IpcGetQuestPriorityIndex = "Questionable.GetQuestPriorityIndex";
|
||||
|
||||
private const string IpcHasAvailablePriorityQuests = "Questionable.HasAvailablePriorityQuests";
|
||||
|
||||
private const string IpcGetStopConditionsEnabled = "Questionable.GetStopConditionsEnabled";
|
||||
|
||||
private const string IpcSetStopConditionsEnabled = "Questionable.SetStopConditionsEnabled";
|
||||
|
||||
private const string IpcGetStopQuestList = "Questionable.GetStopQuestList";
|
||||
|
||||
private const string IpcAddStopQuest = "Questionable.AddStopQuest";
|
||||
|
||||
private const string IpcRemoveStopQuest = "Questionable.RemoveStopQuest";
|
||||
|
||||
private const string IpcClearStopQuests = "Questionable.ClearStopQuests";
|
||||
|
||||
private const string IpcGetLevelStopCondition = "Questionable.GetLevelStopCondition";
|
||||
|
||||
private const string IpcSetLevelStopCondition = "Questionable.SetLevelStopCondition";
|
||||
|
||||
private const string IpcGetSequenceStopCondition = "Questionable.GetSequenceStopCondition";
|
||||
|
||||
private const string IpcSetSequenceStopCondition = "Questionable.SetSequenceStopCondition";
|
||||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly QuestRegistry _questRegistry;
|
||||
|
||||
private readonly QuestFunctions _questFunctions;
|
||||
|
||||
private readonly QuestData _questData;
|
||||
|
||||
private readonly ManualPriorityComponent _manualPriorityComponent;
|
||||
|
||||
private readonly PresetBuilderComponent _presetBuilderComponent;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
|
@ -120,16 +174,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private readonly ICallGateProvider<string, bool> _isQuestUnobtainable;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _importQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int, string, bool> _insertQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string> _exportQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int> _getDefaultDutyMode;
|
||||
|
||||
private readonly ICallGateProvider<int, bool> _setDefaultDutyMode;
|
||||
|
|
@ -142,13 +186,65 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private readonly ICallGateProvider<bool> _clearAllDutyModeOverrides;
|
||||
|
||||
public QuestionableIpc(QuestController questController, EventInfoComponent eventInfoComponent, QuestRegistry questRegistry, QuestFunctions questFunctions, ManualPriorityComponent manualPriorityComponent, Configuration configuration, IDalamudPluginInterface pluginInterface)
|
||||
private readonly ICallGateProvider<string, bool> _importQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int, string, bool> _insertQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string> _exportQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getPriorityQuests;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _removePriorityQuest;
|
||||
|
||||
private readonly ICallGateProvider<string, int, bool> _reorderPriorityQuest;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getAvailablePresets;
|
||||
|
||||
private readonly ICallGateProvider<string, List<string>> _getPresetQuests;
|
||||
|
||||
private readonly ICallGateProvider<string, int> _addPresetToPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _isPresetAvailable;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _isQuestInPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, int> _getQuestPriorityIndex;
|
||||
|
||||
private readonly ICallGateProvider<bool> _hasAvailablePriorityQuests;
|
||||
|
||||
private readonly ICallGateProvider<bool> _getStopConditionsEnabled;
|
||||
|
||||
private readonly ICallGateProvider<bool, bool> _setStopConditionsEnabled;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getStopQuestList;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addStopQuest;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _removeStopQuest;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearStopQuests;
|
||||
|
||||
private readonly ICallGateProvider<StopConditionData> _getLevelStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<bool, int, bool> _setLevelStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<StopConditionData> _getSequenceStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<bool, int, bool> _setSequenceStopCondition;
|
||||
|
||||
public QuestionableIpc(QuestController questController, EventInfoComponent eventInfoComponent, QuestRegistry questRegistry, QuestFunctions questFunctions, QuestData questData, ManualPriorityComponent manualPriorityComponent, PresetBuilderComponent presetBuilderComponent, Configuration configuration, IDalamudPluginInterface pluginInterface)
|
||||
{
|
||||
QuestionableIpc questionableIpc = this;
|
||||
_questController = questController;
|
||||
_questRegistry = questRegistry;
|
||||
_questFunctions = questFunctions;
|
||||
_questData = questData;
|
||||
_manualPriorityComponent = manualPriorityComponent;
|
||||
_presetBuilderComponent = presetBuilderComponent;
|
||||
_configuration = configuration;
|
||||
_pluginInterface = pluginInterface;
|
||||
_isRunning = pluginInterface.GetIpcProvider<bool>("Questionable.IsRunning");
|
||||
|
|
@ -176,16 +272,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_isQuestAccepted.RegisterFunc(IsQuestAccepted);
|
||||
_isQuestUnobtainable = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsQuestUnobtainable");
|
||||
_isQuestUnobtainable.RegisterFunc(IsQuestUnobtainable);
|
||||
_importQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.ImportQuestPriority");
|
||||
_importQuestPriority.RegisterFunc(ImportQuestPriority);
|
||||
_addQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddQuestPriority");
|
||||
_addQuestPriority.RegisterFunc(AddQuestPriority);
|
||||
_clearQuestPriority = pluginInterface.GetIpcProvider<bool>("Questionable.ClearQuestPriority");
|
||||
_clearQuestPriority.RegisterFunc(ClearQuestPriority);
|
||||
_insertQuestPriority = pluginInterface.GetIpcProvider<int, string, bool>("Questionable.InsertQuestPriority");
|
||||
_insertQuestPriority.RegisterFunc(InsertQuestPriority);
|
||||
_exportQuestPriority = pluginInterface.GetIpcProvider<string>("Questionable.ExportQuestPriority");
|
||||
_exportQuestPriority.RegisterFunc(_manualPriorityComponent.EncodeQuestPriority);
|
||||
_getDefaultDutyMode = pluginInterface.GetIpcProvider<int>("Questionable.GetDefaultDutyMode");
|
||||
_getDefaultDutyMode.RegisterFunc(GetDefaultDutyMode);
|
||||
_setDefaultDutyMode = pluginInterface.GetIpcProvider<int, bool>("Questionable.SetDefaultDutyMode");
|
||||
|
|
@ -198,6 +284,56 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_clearDutyModeOverride.RegisterFunc(ClearDutyModeOverride);
|
||||
_clearAllDutyModeOverrides = pluginInterface.GetIpcProvider<bool>("Questionable.ClearAllDutyModeOverrides");
|
||||
_clearAllDutyModeOverrides.RegisterFunc(ClearAllDutyModeOverrides);
|
||||
_importQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.ImportQuestPriority");
|
||||
_importQuestPriority.RegisterFunc(ImportQuestPriority);
|
||||
_addQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddQuestPriority");
|
||||
_addQuestPriority.RegisterFunc(AddQuestPriority);
|
||||
_clearQuestPriority = pluginInterface.GetIpcProvider<bool>("Questionable.ClearQuestPriority");
|
||||
_clearQuestPriority.RegisterFunc(ClearQuestPriority);
|
||||
_insertQuestPriority = pluginInterface.GetIpcProvider<int, string, bool>("Questionable.InsertQuestPriority");
|
||||
_insertQuestPriority.RegisterFunc(InsertQuestPriority);
|
||||
_exportQuestPriority = pluginInterface.GetIpcProvider<string>("Questionable.ExportQuestPriority");
|
||||
_exportQuestPriority.RegisterFunc(_manualPriorityComponent.EncodeQuestPriority);
|
||||
_getPriorityQuests = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetPriorityQuests");
|
||||
_getPriorityQuests.RegisterFunc(GetPriorityQuests);
|
||||
_removePriorityQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.RemovePriorityQuest");
|
||||
_removePriorityQuest.RegisterFunc(RemovePriorityQuest);
|
||||
_reorderPriorityQuest = pluginInterface.GetIpcProvider<string, int, bool>("Questionable.ReorderPriorityQuest");
|
||||
_reorderPriorityQuest.RegisterFunc(ReorderPriorityQuest);
|
||||
_getAvailablePresets = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetAvailablePresets");
|
||||
_getAvailablePresets.RegisterFunc(GetAvailablePresets);
|
||||
_getPresetQuests = pluginInterface.GetIpcProvider<string, List<string>>("Questionable.GetPresetQuests");
|
||||
_getPresetQuests.RegisterFunc(GetPresetQuests);
|
||||
_addPresetToPriority = pluginInterface.GetIpcProvider<string, int>("Questionable.AddPresetToPriority");
|
||||
_addPresetToPriority.RegisterFunc(AddPresetToPriority);
|
||||
_isPresetAvailable = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsPresetAvailable");
|
||||
_isPresetAvailable.RegisterFunc(IsPresetAvailable);
|
||||
_isQuestInPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsQuestInPriority");
|
||||
_isQuestInPriority.RegisterFunc(IsQuestInPriority);
|
||||
_getQuestPriorityIndex = pluginInterface.GetIpcProvider<string, int>("Questionable.GetQuestPriorityIndex");
|
||||
_getQuestPriorityIndex.RegisterFunc(GetQuestPriorityIndex);
|
||||
_hasAvailablePriorityQuests = pluginInterface.GetIpcProvider<bool>("Questionable.HasAvailablePriorityQuests");
|
||||
_hasAvailablePriorityQuests.RegisterFunc(HasAvailablePriorityQuests);
|
||||
_getStopConditionsEnabled = pluginInterface.GetIpcProvider<bool>("Questionable.GetStopConditionsEnabled");
|
||||
_getStopConditionsEnabled.RegisterFunc(GetStopConditionsEnabled);
|
||||
_setStopConditionsEnabled = pluginInterface.GetIpcProvider<bool, bool>("Questionable.SetStopConditionsEnabled");
|
||||
_setStopConditionsEnabled.RegisterFunc(SetStopConditionsEnabled);
|
||||
_getStopQuestList = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetStopQuestList");
|
||||
_getStopQuestList.RegisterFunc(GetStopQuestList);
|
||||
_addStopQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddStopQuest");
|
||||
_addStopQuest.RegisterFunc(AddStopQuest);
|
||||
_removeStopQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.RemoveStopQuest");
|
||||
_removeStopQuest.RegisterFunc(RemoveStopQuest);
|
||||
_clearStopQuests = pluginInterface.GetIpcProvider<bool>("Questionable.ClearStopQuests");
|
||||
_clearStopQuests.RegisterFunc(ClearStopQuests);
|
||||
_getLevelStopCondition = pluginInterface.GetIpcProvider<StopConditionData>("Questionable.GetLevelStopCondition");
|
||||
_getLevelStopCondition.RegisterFunc(GetLevelStopCondition);
|
||||
_setLevelStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetLevelStopCondition");
|
||||
_setLevelStopCondition.RegisterFunc(SetLevelStopCondition);
|
||||
_getSequenceStopCondition = pluginInterface.GetIpcProvider<StopConditionData>("Questionable.GetSequenceStopCondition");
|
||||
_getSequenceStopCondition.RegisterFunc(GetSequenceStopCondition);
|
||||
_setSequenceStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetSequenceStopCondition");
|
||||
_setSequenceStopCondition.RegisterFunc(SetSequenceStopCondition);
|
||||
}
|
||||
|
||||
private bool StartQuest(string questId, bool single)
|
||||
|
|
@ -307,37 +443,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool ImportQuestPriority(string encodedQuestPriority)
|
||||
{
|
||||
List<ElementId> questElements = PriorityWindow.DecodeQuestPriority(encodedQuestPriority);
|
||||
_questController.ImportQuestPriority(questElements);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ClearQuestPriority()
|
||||
{
|
||||
_questController.ClearQuestPriority();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool AddQuestPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.AddQuestPriority(elementId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool InsertQuestPriority(int index, string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.InsertQuestPriority(index, elementId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private int GetDefaultDutyMode()
|
||||
{
|
||||
return (int)_configuration.Duties.DefaultDutyMode;
|
||||
|
|
@ -391,14 +496,433 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool ImportQuestPriority(string encodedQuestPriority)
|
||||
{
|
||||
List<ElementId> questElements = PriorityWindow.DecodeQuestPriority(encodedQuestPriority);
|
||||
_questController.ImportQuestPriority(questElements);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ClearQuestPriority()
|
||||
{
|
||||
_questController.ClearQuestPriority();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool AddQuestPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.AddQuestPriority(elementId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool InsertQuestPriority(int index, string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.InsertQuestPriority(index, elementId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> GetPriorityQuests()
|
||||
{
|
||||
return _questController.ManualPriorityQuests.Select((Quest q) => q.Id.ToString()).ToList();
|
||||
}
|
||||
|
||||
private bool RemovePriorityQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null)
|
||||
{
|
||||
_questController.ManualPriorityQuests.Remove(quest);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ReorderPriorityQuest(string questId, int newIndex)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null && newIndex >= 0 && newIndex < _questController.ManualPriorityQuests.Count)
|
||||
{
|
||||
_questController.ManualPriorityQuests.Remove(quest);
|
||||
_questController.ManualPriorityQuests.Insert(newIndex, quest);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> GetAvailablePresets()
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
"aether_currents_hw", "aether_currents_sb", "aether_currents_shb", "aether_currents_ew", "aether_currents_dt", "aethernet_limsa", "aethernet_gridania", "aethernet_uldah", "aethernet_goldsaucer", "aethernet_ishgard",
|
||||
"aethernet_idyllshire", "aethernet_rhalgrs_reach", "aethernet_kugane", "aethernet_doman_enclave", "aethernet_the_crystarium", "aethernet_eulmore", "aethernet_old_sharlayan", "aethernet_radz_at_han", "aethernet_tuliyollal", "aethernet_solution_nine",
|
||||
"crystal_tower", "hard_primals"
|
||||
};
|
||||
}
|
||||
|
||||
private List<string> GetPresetQuests(string presetName)
|
||||
{
|
||||
List<ElementId> source;
|
||||
switch (presetName)
|
||||
{
|
||||
case "aether_currents_hw":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Heavensward);
|
||||
break;
|
||||
case "aether_currents_sb":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Stormblood);
|
||||
break;
|
||||
case "aether_currents_shb":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Shadowbringers);
|
||||
break;
|
||||
case "aether_currents_ew":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Endwalker);
|
||||
break;
|
||||
case "aether_currents_dt":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Dawntrail);
|
||||
break;
|
||||
case "aethernet_limsa":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list15 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list15, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(1);
|
||||
source = list15;
|
||||
break;
|
||||
}
|
||||
case "aethernet_gridania":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list14 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list14, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(2);
|
||||
source = list14;
|
||||
break;
|
||||
}
|
||||
case "aethernet_uldah":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list13 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list13, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(3);
|
||||
source = list13;
|
||||
break;
|
||||
}
|
||||
case "aethernet_goldsaucer":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list12 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list12, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(4);
|
||||
source = list12;
|
||||
break;
|
||||
}
|
||||
case "aethernet_ishgard":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list11 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list11, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(5);
|
||||
source = list11;
|
||||
break;
|
||||
}
|
||||
case "aethernet_idyllshire":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list10 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list10, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(6);
|
||||
source = list10;
|
||||
break;
|
||||
}
|
||||
case "aethernet_rhalgrs_reach":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list9 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list9, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(7);
|
||||
source = list9;
|
||||
break;
|
||||
}
|
||||
case "aethernet_kugane":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list8 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list8, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(8);
|
||||
source = list8;
|
||||
break;
|
||||
}
|
||||
case "aethernet_doman_enclave":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list7 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list7, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(9);
|
||||
source = list7;
|
||||
break;
|
||||
}
|
||||
case "aethernet_the_crystarium":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list6 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list6, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(10);
|
||||
source = list6;
|
||||
break;
|
||||
}
|
||||
case "aethernet_eulmore":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list5 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list5, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(11);
|
||||
source = list5;
|
||||
break;
|
||||
}
|
||||
case "aethernet_old_sharlayan":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list4 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list4, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(12);
|
||||
source = list4;
|
||||
break;
|
||||
}
|
||||
case "aethernet_radz_at_han":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list3 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list3, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(13);
|
||||
source = list3;
|
||||
break;
|
||||
}
|
||||
case "aethernet_tuliyollal":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list2 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list2, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(14);
|
||||
source = list2;
|
||||
break;
|
||||
}
|
||||
case "aethernet_solution_nine":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(15);
|
||||
source = list;
|
||||
break;
|
||||
}
|
||||
case "crystal_tower":
|
||||
source = QuestData.CrystalTowerQuests.Cast<ElementId>().ToList();
|
||||
break;
|
||||
case "hard_primals":
|
||||
source = QuestData.HardModePrimals.Cast<ElementId>().ToList();
|
||||
break;
|
||||
default:
|
||||
source = new List<ElementId>();
|
||||
break;
|
||||
}
|
||||
return source.Select((ElementId q) => q.ToString()).ToList();
|
||||
}
|
||||
|
||||
private int AddPresetToPriority(string presetName)
|
||||
{
|
||||
List<string> presetQuests = GetPresetQuests(presetName);
|
||||
int num = 0;
|
||||
foreach (string item in presetQuests)
|
||||
{
|
||||
if (ElementId.TryFromString(item, out ElementId elementId) && elementId != null && (_questFunctions.IsReadyToAcceptQuest(elementId) || _questFunctions.IsQuestAccepted(elementId)) && !_questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(elementId)) && _questRegistry.IsKnownQuest(elementId) && _questController.AddQuestPriority(elementId))
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private static List<ElementId> GetAetherCurrentQuestsByExpansion(EExpansionVersion expansion)
|
||||
{
|
||||
uint[] territoryRanges = expansion switch
|
||||
{
|
||||
EExpansionVersion.Heavensward => new uint[5] { 397u, 398u, 399u, 400u, 401u },
|
||||
EExpansionVersion.Stormblood => new uint[6] { 612u, 613u, 614u, 620u, 621u, 622u },
|
||||
EExpansionVersion.Shadowbringers => new uint[6] { 813u, 814u, 815u, 816u, 817u, 818u },
|
||||
EExpansionVersion.Endwalker => new uint[6] { 956u, 957u, 958u, 959u, 960u, 961u },
|
||||
EExpansionVersion.Dawntrail => new uint[6] { 1187u, 1188u, 1189u, 1190u, 1191u, 1192u },
|
||||
_ => Array.Empty<uint>(),
|
||||
};
|
||||
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => territoryRanges.Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private bool IsPresetAvailable(string presetName)
|
||||
{
|
||||
return GetAvailablePresets().Contains(presetName);
|
||||
}
|
||||
|
||||
private bool IsQuestInPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
return _questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(elementId));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int GetQuestPriorityIndex(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null)
|
||||
{
|
||||
return _questController.ManualPriorityQuests.IndexOf(quest);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private bool HasAvailablePriorityQuests()
|
||||
{
|
||||
return _questFunctions.GetNextPriorityQuestsThatCanBeAccepted().Any((PriorityQuestInfo x) => x.IsAvailable);
|
||||
}
|
||||
|
||||
private bool GetStopConditionsEnabled()
|
||||
{
|
||||
return _configuration.Stop.Enabled;
|
||||
}
|
||||
|
||||
private bool SetStopConditionsEnabled(bool enabled)
|
||||
{
|
||||
_configuration.Stop.Enabled = enabled;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<string> GetStopQuestList()
|
||||
{
|
||||
return _configuration.Stop.QuestsToStopAfter.Select((ElementId q) => q.ToString()).ToList();
|
||||
}
|
||||
|
||||
private bool AddStopQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId) && !_configuration.Stop.QuestsToStopAfter.Contains(elementId))
|
||||
{
|
||||
_configuration.Stop.QuestsToStopAfter.Add(elementId);
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool RemoveStopQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
bool num = _configuration.Stop.QuestsToStopAfter.Remove(elementId);
|
||||
if (num)
|
||||
{
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ClearStopQuests()
|
||||
{
|
||||
_configuration.Stop.QuestsToStopAfter.Clear();
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private StopConditionData GetLevelStopCondition()
|
||||
{
|
||||
return new StopConditionData
|
||||
{
|
||||
Enabled = _configuration.Stop.LevelToStopAfter,
|
||||
TargetValue = _configuration.Stop.TargetLevel
|
||||
};
|
||||
}
|
||||
|
||||
private bool SetLevelStopCondition(bool enabled, int targetLevel)
|
||||
{
|
||||
if (targetLevel < 1 || targetLevel > 100)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_configuration.Stop.LevelToStopAfter = enabled;
|
||||
_configuration.Stop.TargetLevel = targetLevel;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private StopConditionData GetSequenceStopCondition()
|
||||
{
|
||||
return new StopConditionData
|
||||
{
|
||||
Enabled = _configuration.Stop.SequenceToStopAfter,
|
||||
TargetValue = _configuration.Stop.TargetSequence
|
||||
};
|
||||
}
|
||||
|
||||
private bool SetSequenceStopCondition(bool enabled, int targetSequence)
|
||||
{
|
||||
if (targetSequence < 0 || targetSequence > 255)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_configuration.Stop.SequenceToStopAfter = enabled;
|
||||
_configuration.Stop.TargetSequence = targetSequence;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_clearAllDutyModeOverrides.UnregisterFunc();
|
||||
_clearDutyModeOverride.UnregisterFunc();
|
||||
_setDutyModeOverride.UnregisterFunc();
|
||||
_getDutyModeOverride.UnregisterFunc();
|
||||
_setDefaultDutyMode.UnregisterFunc();
|
||||
_getDefaultDutyMode.UnregisterFunc();
|
||||
_exportQuestPriority.UnregisterFunc();
|
||||
_insertQuestPriority.UnregisterFunc();
|
||||
_clearQuestPriority.UnregisterFunc();
|
||||
|
|
@ -416,5 +940,31 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_getCurrentStepData.UnregisterFunc();
|
||||
_getCurrentQuestId.UnregisterFunc();
|
||||
_isRunning.UnregisterFunc();
|
||||
_clearAllDutyModeOverrides.UnregisterFunc();
|
||||
_clearDutyModeOverride.UnregisterFunc();
|
||||
_setDutyModeOverride.UnregisterFunc();
|
||||
_getDutyModeOverride.UnregisterFunc();
|
||||
_setDefaultDutyMode.UnregisterFunc();
|
||||
_getDefaultDutyMode.UnregisterFunc();
|
||||
_hasAvailablePriorityQuests.UnregisterFunc();
|
||||
_getQuestPriorityIndex.UnregisterFunc();
|
||||
_isQuestInPriority.UnregisterFunc();
|
||||
_isPresetAvailable.UnregisterFunc();
|
||||
_addPresetToPriority.UnregisterFunc();
|
||||
_getPresetQuests.UnregisterFunc();
|
||||
_getAvailablePresets.UnregisterFunc();
|
||||
_reorderPriorityQuest.UnregisterFunc();
|
||||
_removePriorityQuest.UnregisterFunc();
|
||||
_getPriorityQuests.UnregisterFunc();
|
||||
_setSequenceStopCondition.UnregisterFunc();
|
||||
_getSequenceStopCondition.UnregisterFunc();
|
||||
_setLevelStopCondition.UnregisterFunc();
|
||||
_getLevelStopCondition.UnregisterFunc();
|
||||
_clearStopQuests.UnregisterFunc();
|
||||
_removeStopQuest.UnregisterFunc();
|
||||
_addStopQuest.UnregisterFunc();
|
||||
_getStopQuestList.UnregisterFunc();
|
||||
_setStopConditionsEnabled.UnregisterFunc();
|
||||
_getStopConditionsEnabled.UnregisterFunc();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue