forked from aly/qstbak
muffin v6.34
This commit is contained in:
parent
7f7dca1cf0
commit
a10041e3fd
3 changed files with 59 additions and 3 deletions
|
|
@ -241,9 +241,10 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
_taskCreator = taskCreator;
|
_taskCreator = taskCreator;
|
||||||
_singlePlayerDutyConfigComponent = singlePlayerDutyConfigComponent;
|
_singlePlayerDutyConfigComponent = singlePlayerDutyConfigComponent;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_condition.ConditionChange += OnConditionChange;
|
|
||||||
_toastGui.Toast += OnNormalToast;
|
|
||||||
_toastGui.ErrorToast += base.OnErrorToast;
|
_toastGui.ErrorToast += base.OnErrorToast;
|
||||||
|
_toastGui.Toast += OnNormalToast;
|
||||||
|
_condition.ConditionChange += OnConditionChange;
|
||||||
|
_clientState.Logout += OnLogout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reload()
|
public void Reload()
|
||||||
|
|
@ -500,6 +501,14 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
DebugState = "Not logged in";
|
DebugState = "Not logged in";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (_configuration.General.ClearPriorityQuestsOnCompletion && ManualPriorityQuests.Count > 0)
|
||||||
|
{
|
||||||
|
int num = ManualPriorityQuests.RemoveAll((Quest q) => _questFunctions.IsQuestComplete(q.Id));
|
||||||
|
if (num > 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Removed {Count} completed priority quest(s)", num);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_pendingQuest != null)
|
if (_pendingQuest != null)
|
||||||
{
|
{
|
||||||
if (!_questFunctions.IsQuestAccepted(_pendingQuest.Quest.Id))
|
if (!_questFunctions.IsQuestAccepted(_pendingQuest.Quest.Id))
|
||||||
|
|
@ -1107,13 +1116,17 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
|
|
||||||
public void ImportQuestPriority(List<ElementId> questElements)
|
public void ImportQuestPriority(List<ElementId> questElements)
|
||||||
{
|
{
|
||||||
|
ManualPriorityQuests.Clear();
|
||||||
foreach (ElementId questElement in questElements)
|
foreach (ElementId questElement in questElements)
|
||||||
{
|
{
|
||||||
if (_questRegistry.TryGetQuest(questElement, out Quest quest) && !ManualPriorityQuests.Contains(quest))
|
if (_questRegistry.TryGetQuest(questElement, out Quest quest))
|
||||||
{
|
{
|
||||||
ManualPriorityQuests.Add(quest);
|
ManualPriorityQuests.Add(quest);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
_logger.LogWarning("Could not find quest {QuestId} during import", questElement);
|
||||||
}
|
}
|
||||||
|
_logger.LogInformation("Imported {Count} priority quests", ManualPriorityQuests.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExportQuestPriority()
|
public string ExportQuestPriority()
|
||||||
|
|
@ -1223,11 +1236,21 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnLogout(int type, int code)
|
||||||
|
{
|
||||||
|
if (_configuration.General.ClearPriorityQuestsOnLogout)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Clearing priority quests on logout");
|
||||||
|
ManualPriorityQuests.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
_toastGui.ErrorToast -= base.OnErrorToast;
|
_toastGui.ErrorToast -= base.OnErrorToast;
|
||||||
_toastGui.Toast -= OnNormalToast;
|
_toastGui.Toast -= OnNormalToast;
|
||||||
_condition.ConditionChange -= OnConditionChange;
|
_condition.ConditionChange -= OnConditionChange;
|
||||||
|
_clientState.Logout -= OnLogout;
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,35 @@ internal sealed class GeneralConfigComponent : ConfigComponent
|
||||||
ImGui.TextColored(in col, text);
|
ImGui.TextColored(in col, text);
|
||||||
ImGui.Unindent();
|
ImGui.Unindent();
|
||||||
}
|
}
|
||||||
|
ImGui.Spacing();
|
||||||
|
ImGui.Separator();
|
||||||
|
ImGui.Text("Priority Quest Management");
|
||||||
|
bool v9 = base.Configuration.General.ClearPriorityQuestsOnLogout;
|
||||||
|
if (ImGui.Checkbox("Clear priority quests on character logout", ref v9))
|
||||||
|
{
|
||||||
|
base.Configuration.General.ClearPriorityQuestsOnLogout = v9;
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
bool v10 = base.Configuration.General.ClearPriorityQuestsOnCompletion;
|
||||||
|
if (ImGui.Checkbox("Remove priority quests when completed", ref v10))
|
||||||
|
{
|
||||||
|
base.Configuration.General.ClearPriorityQuestsOnCompletion = v10;
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
ImGui.SameLine();
|
||||||
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
|
{
|
||||||
|
ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString());
|
||||||
|
}
|
||||||
|
if (ImGui.IsItemHovered())
|
||||||
|
{
|
||||||
|
using (ImRaii.Tooltip())
|
||||||
|
{
|
||||||
|
ImGui.Text("Automatically removes completed quests from your priority queue.");
|
||||||
|
ImGui.Text("This helps keep your priority list clean without manual intervention.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ internal sealed class Configuration : IPluginConfiguration
|
||||||
public int AutoStepRefreshDelaySeconds { get; set; } = 10;
|
public int AutoStepRefreshDelaySeconds { get; set; } = 10;
|
||||||
|
|
||||||
public bool HideSeasonalEventsFromJournalProgress { get; set; }
|
public bool HideSeasonalEventsFromJournalProgress { get; set; }
|
||||||
|
|
||||||
|
public bool ClearPriorityQuestsOnLogout { get; set; }
|
||||||
|
|
||||||
|
public bool ClearPriorityQuestsOnCompletion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal sealed class StopConfiguration
|
internal sealed class StopConfiguration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue