Add option for quests to be non-interruptible
authorLiza Carvelli <liza@carvel.li>
Mon, 14 Apr 2025 14:29:42 +0000 (16:29 +0200)
committerLiza Carvelli <liza@carvel.li>
Mon, 14 Apr 2025 14:29:42 +0000 (16:29 +0200)
QuestPathGenerator/QuestSourceGenerator.cs
QuestPaths/2.x - A Realm Reborn/MSQ-2/B2-Eastern La Noscea, Brayflox, Cheese and Wine/832_The Things We Do for Cheese.json
QuestPaths/quest-v1.json
Questionable.Model/Questing/QuestRoot.cs
Questionable/Controller/QuestController.cs

index b23bb9d..463e04b 100644 (file)
@@ -152,6 +152,7 @@ public class QuestSourceGenerator : ISourceGenerator
     {
         try
         {
+            QuestRoot emptyQuest = new();
             return ObjectCreationExpression(
                     IdentifierName(nameof(QuestRoot)))
                 .WithInitializer(
@@ -161,8 +162,9 @@ public class QuestSourceGenerator : ISourceGenerator
                             SyntaxNodeList(
                                 AssignmentList(nameof(QuestRoot.Author), quest.Author)
                                     .AsSyntaxNodeOrToken(),
-                                Assignment(nameof(QuestRoot.Disabled), quest.Disabled, false).AsSyntaxNodeOrToken(),
-                                Assignment(nameof(QuestRoot.Comment), quest.Comment, null)
+                                Assignment(nameof(QuestRoot.Disabled), quest.Disabled, emptyQuest.Disabled).AsSyntaxNodeOrToken(),
+                                Assignment(nameof(QuestRoot.Interruptible), quest.Interruptible, emptyQuest.Interruptible).AsSyntaxNodeOrToken(),
+                                Assignment(nameof(QuestRoot.Comment), quest.Comment, emptyQuest.Comment)
                                     .AsSyntaxNodeOrToken(),
                                 AssignmentExpression(
                                     SyntaxKind.SimpleAssignmentExpression,
index 925a801..56d33fc 100644 (file)
     "Disabled": {
       "type": "boolean"
     },
+    "Interruptible": {
+      "type": "boolean",
+      "description": "If set to false, no priority quest (e.g. class quests) will be done while this is the currently active quest"
+    },
     "Comment": {
       "type": "string"
     },
       ]
     }
   }
-}
\ No newline at end of file
+}
index 9989941..d42ee86 100644 (file)
@@ -15,6 +15,7 @@ public sealed class QuestRoot
     /// </summary>
     public bool Disabled { get; set; }
 
+    public bool Interruptible { get; set; } = true;
     public string? Comment { get; set; }
     public List<QuestSequence> QuestSequence { get; set; } = new();
 }
index 752df5b..905c2ab 100644 (file)
@@ -9,13 +9,11 @@ using Dalamud.Game.Gui.Toast;
 using Dalamud.Game.Text.SeStringHandling;
 using Dalamud.Plugin.Services;
 using FFXIVClientStructs.FFXIV.Client.Game;
-using Lumina.Excel.Sheets;
 using Microsoft.Extensions.Logging;
 using Questionable.Controller.Steps;
 using Questionable.Controller.Steps.Interactions;
 using Questionable.Controller.Steps.Shared;
 using Questionable.Data;
-using Questionable.External;
 using Questionable.Functions;
 using Questionable.Model;
 using Questionable.Model.Questing;
@@ -812,7 +810,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
             return false;
 
         var (currentQuest, type) = details.Value;
-        if (type != ECurrentQuestType.Normal || currentQuest.Sequence == 0)
+        if (type != ECurrentQuestType.Normal || !currentQuest.Quest.Root.Interruptible || currentQuest.Sequence == 0)
             return false;
 
         if (ManualPriorityQuests.Contains(currentQuest.Quest))