Update dungeon/trial json schema to allow notes (similar to quest battles)
This commit is contained in:
parent
6c27b7d85e
commit
5c904d6cb3
30
QuestPathGenerator/RoslynElements/DutyOptionsExtensions.cs
Normal file
30
QuestPathGenerator/RoslynElements/DutyOptionsExtensions.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.CodeAnalysis.CSharp;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
using Questionable.Model.Questing;
|
||||||
|
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||||
|
using static Questionable.QuestPathGenerator.RoslynShortcuts;
|
||||||
|
|
||||||
|
namespace Questionable.QuestPathGenerator.RoslynElements;
|
||||||
|
|
||||||
|
internal static class DutyOptionsExtensions
|
||||||
|
{
|
||||||
|
public static ExpressionSyntax ToExpressionSyntax(this DutyOptions dutyOptions)
|
||||||
|
{
|
||||||
|
var emptyOptions = new DutyOptions();
|
||||||
|
return ObjectCreationExpression(
|
||||||
|
IdentifierName(nameof(DutyOptions)))
|
||||||
|
.WithInitializer(
|
||||||
|
InitializerExpression(
|
||||||
|
SyntaxKind.ObjectInitializerExpression,
|
||||||
|
SeparatedList<ExpressionSyntax>(
|
||||||
|
SyntaxNodeList(
|
||||||
|
Assignment(nameof(DutyOptions.Enabled),
|
||||||
|
dutyOptions.Enabled, emptyOptions.Enabled)
|
||||||
|
.AsSyntaxNodeOrToken(),
|
||||||
|
Assignment(nameof(DutyOptions.ContentFinderConditionId),
|
||||||
|
dutyOptions.ContentFinderConditionId, emptyOptions.ContentFinderConditionId)
|
||||||
|
.AsSyntaxNodeOrToken(),
|
||||||
|
AssignmentList(nameof(DutyOptions.Notes), dutyOptions.Notes)
|
||||||
|
.AsSyntaxNodeOrToken()))));
|
||||||
|
}
|
||||||
|
}
|
@ -117,11 +117,8 @@ internal static class QuestStepExtensions
|
|||||||
Assignment(nameof(QuestStep.JumpDestination), step.JumpDestination,
|
Assignment(nameof(QuestStep.JumpDestination), step.JumpDestination,
|
||||||
emptyStep.JumpDestination)
|
emptyStep.JumpDestination)
|
||||||
.AsSyntaxNodeOrToken(),
|
.AsSyntaxNodeOrToken(),
|
||||||
Assignment(nameof(QuestStep.ContentFinderConditionId),
|
Assignment(nameof(QuestStep.DutyOptions), step.DutyOptions,
|
||||||
step.ContentFinderConditionId, emptyStep.ContentFinderConditionId)
|
emptyStep.DutyOptions)
|
||||||
.AsSyntaxNodeOrToken(),
|
|
||||||
Assignment(nameof(QuestStep.AutoDutyEnabled),
|
|
||||||
step.AutoDutyEnabled, emptyStep.AutoDutyEnabled)
|
|
||||||
.AsSyntaxNodeOrToken(),
|
.AsSyntaxNodeOrToken(),
|
||||||
Assignment(nameof(QuestStep.SinglePlayerDutyOptions), step.SinglePlayerDutyOptions,
|
Assignment(nameof(QuestStep.SinglePlayerDutyOptions), step.SinglePlayerDutyOptions,
|
||||||
emptyStep.SinglePlayerDutyOptions)
|
emptyStep.SinglePlayerDutyOptions)
|
||||||
|
@ -62,6 +62,7 @@ public static class RoslynShortcuts
|
|||||||
ComplexCombatData complexCombatData => complexCombatData.ToExpressionSyntax(),
|
ComplexCombatData complexCombatData => complexCombatData.ToExpressionSyntax(),
|
||||||
QuestWorkValue questWorkValue => questWorkValue.ToExpressionSyntax(),
|
QuestWorkValue questWorkValue => questWorkValue.ToExpressionSyntax(),
|
||||||
List<QuestWorkValue> list => list.ToExpressionSyntax(), // TODO fix in AssignmentList
|
List<QuestWorkValue> list => list.ToExpressionSyntax(), // TODO fix in AssignmentList
|
||||||
|
DutyOptions dutyOptions => dutyOptions.ToExpressionSyntax(),
|
||||||
SinglePlayerDutyOptions dutyOptions => dutyOptions.ToExpressionSyntax(),
|
SinglePlayerDutyOptions dutyOptions => dutyOptions.ToExpressionSyntax(),
|
||||||
SkipConditions skipConditions => skipConditions.ToExpressionSyntax(),
|
SkipConditions skipConditions => skipConditions.ToExpressionSyntax(),
|
||||||
SkipStepConditions skipStepConditions => skipStepConditions.ToExpressionSyntax(),
|
SkipStepConditions skipStepConditions => skipStepConditions.ToExpressionSyntax(),
|
||||||
|
@ -112,8 +112,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 138,
|
"TerritoryId": 138,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 4,
|
"ContentFinderConditionId": 4,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -75,8 +75,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 146,
|
"TerritoryId": 146,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 56,
|
"ContentFinderConditionId": 56,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -62,8 +62,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 140,
|
"TerritoryId": 140,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 3,
|
"ContentFinderConditionId": 3,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -57,8 +57,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 148,
|
"TerritoryId": 148,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 2,
|
"ContentFinderConditionId": 2,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -44,8 +44,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 153,
|
"TerritoryId": 153,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 1,
|
"ContentFinderConditionId": 1,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -66,8 +66,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 148,
|
"TerritoryId": 148,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 6,
|
"ContentFinderConditionId": 6,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"(after boss 2) Will not pick up the bloody parchment, and instead run off to open a random unrelated chest that it can't reach"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -85,8 +85,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 137,
|
"TerritoryId": 137,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 8,
|
"ContentFinderConditionId": 8,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"(boss 2) Will walk out of the boss arena to try and attack optional enemies on the upper level, thus resetting the boss and breaking the path"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -45,8 +45,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 139,
|
"TerritoryId": 139,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 57,
|
"ContentFinderConditionId": 57,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -59,8 +59,14 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 155,
|
"TerritoryId": 155,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 11,
|
"ContentFinderConditionId": 11,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"(boss 1) AI will not face cleaves away from healer, typically killing them",
|
||||||
|
"(boss 3) AI will not face cleaves away from healer, which doesn't always kill them"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -38,8 +38,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 331,
|
"TerritoryId": 331,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 58,
|
"ContentFinderConditionId": 58,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -195,8 +195,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 147,
|
"TerritoryId": 147,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 15,
|
"ContentFinderConditionId": 15,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -46,8 +46,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 147,
|
"TerritoryId": 147,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 16,
|
"ContentFinderConditionId": 16,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -72,8 +74,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1053,
|
"TerritoryId": 1053,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 830,
|
"ContentFinderConditionId": 830,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -88,8 +88,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 155,
|
"TerritoryId": 155,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 27,
|
"ContentFinderConditionId": 27,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -107,8 +107,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 156,
|
"TerritoryId": 156,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 32,
|
"ContentFinderConditionId": 32,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -78,8 +78,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 398,
|
"TerritoryId": 398,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 37,
|
"ContentFinderConditionId": 37,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -42,8 +42,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 418,
|
"TerritoryId": 418,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 39,
|
"ContentFinderConditionId": 39,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -59,8 +59,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 419,
|
"TerritoryId": 419,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 34,
|
"ContentFinderConditionId": 34,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -110,8 +110,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 399,
|
"TerritoryId": 399,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 31,
|
"ContentFinderConditionId": 31,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -62,8 +62,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 402,
|
"TerritoryId": 402,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 38,
|
"ContentFinderConditionId": 38,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -88,7 +90,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 402,
|
"TerritoryId": 402,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"ContentFinderConditionId": 90
|
"DutyOptions": {
|
||||||
|
"ContentFinderConditionId": 90,
|
||||||
|
"Enabled": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -77,8 +77,11 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 463,
|
"TerritoryId": 463,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 141,
|
"ContentFinderConditionId": 141,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true,
|
||||||
|
"TestedAutoDutyVersion": "0.0.0.191"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -57,8 +57,14 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 155,
|
"TerritoryId": 155,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 182,
|
"ContentFinderConditionId": 182,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"(after boss 1) the drawbridges being up will lead you to die from the spikes",
|
||||||
|
"(after boss 1) the lift isn't working properly"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -198,7 +198,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 180,
|
"TerritoryId": 180,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"ContentFinderConditionId": 60
|
"DutyOptions": {
|
||||||
|
"ContentFinderConditionId": 60,
|
||||||
|
"Enabled": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -109,8 +109,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 152,
|
"TerritoryId": 152,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 219,
|
"ContentFinderConditionId": 219,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -87,8 +87,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 680,
|
"TerritoryId": 680,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 238,
|
"ContentFinderConditionId": 238,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -114,8 +114,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 614,
|
"TerritoryId": 614,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 241,
|
"ContentFinderConditionId": 241,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -114,8 +114,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 620,
|
"TerritoryId": 620,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 242,
|
"ContentFinderConditionId": 242,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -98,8 +98,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 621,
|
"TerritoryId": 621,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 279,
|
"ContentFinderConditionId": 279,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -40,8 +40,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 614,
|
"TerritoryId": 614,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 585,
|
"ContentFinderConditionId": 585,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -27,8 +27,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 829,
|
"TerritoryId": 829,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 611,
|
"ContentFinderConditionId": 611,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -120,8 +120,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 813,
|
"TerritoryId": 813,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 676,
|
"ContentFinderConditionId": 676,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -49,8 +49,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 816,
|
"TerritoryId": 816,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 649,
|
"ContentFinderConditionId": 649,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -61,8 +61,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 817,
|
"TerritoryId": 817,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 651,
|
"ContentFinderConditionId": 651,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -62,8 +62,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 814,
|
"TerritoryId": 814,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 659,
|
"ContentFinderConditionId": 659,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -88,7 +90,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 880,
|
"TerritoryId": 880,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"ContentFinderConditionId": 666
|
"DutyOptions": {
|
||||||
|
"ContentFinderConditionId": 666,
|
||||||
|
"Enabled": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -40,8 +40,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 814,
|
"TerritoryId": 814,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 714,
|
"ContentFinderConditionId": 714,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -55,8 +55,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 957,
|
"TerritoryId": 957,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 783,
|
"ContentFinderConditionId": 783,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -71,8 +71,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 957,
|
"TerritoryId": 957,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 789,
|
"ContentFinderConditionId": 789,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -39,8 +39,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 961,
|
"TerritoryId": 961,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 787,
|
"ContentFinderConditionId": 787,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -38,8 +38,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 956,
|
"TerritoryId": 956,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 786,
|
"ContentFinderConditionId": 786,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"No VBM module"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -64,8 +69,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1030,
|
"TerritoryId": 1030,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 790,
|
"ContentFinderConditionId": 790,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -23,8 +23,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 957,
|
"TerritoryId": 957,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 844,
|
"ContentFinderConditionId": 844,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"No VBM module"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -71,8 +71,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1056,
|
"TerritoryId": 1056,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 869,
|
"ContentFinderConditionId": 869,
|
||||||
"AutoDutyEnabled": false
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"No VBM module"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -56,9 +56,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 958,
|
"TerritoryId": 958,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"Comment": "Lapis Manalis",
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 896,
|
"ContentFinderConditionId": 896,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -160,8 +160,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 962,
|
"TerritoryId": 962,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 822,
|
"ContentFinderConditionId": 822,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"Navigation issues for area transitions"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1162,
|
"TerritoryId": 1162,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 823,
|
"ContentFinderConditionId": 823,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -58,8 +58,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1185,
|
"TerritoryId": 1185,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 826,
|
"ContentFinderConditionId": 826,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -23,8 +23,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1187,
|
"TerritoryId": 1187,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 824,
|
"ContentFinderConditionId": 824,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -115,8 +115,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1189,
|
"TerritoryId": 1189,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 829,
|
"ContentFinderConditionId": 829,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -60,8 +60,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1219,
|
"TerritoryId": 1219,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 831,
|
"ContentFinderConditionId": 831,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -49,8 +49,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1191,
|
"TerritoryId": 1191,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 825,
|
"ContentFinderConditionId": 825,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -75,7 +77,13 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1220,
|
"TerritoryId": 1220,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"ContentFinderConditionId": 995
|
"DutyOptions": {
|
||||||
|
"ContentFinderConditionId": 995,
|
||||||
|
"Enabled": false,
|
||||||
|
"Notes": [
|
||||||
|
"No VBM module"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -56,8 +56,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1192,
|
"TerritoryId": 1192,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 827,
|
"ContentFinderConditionId": 827,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -82,7 +84,10 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1221,
|
"TerritoryId": 1221,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
"ContentFinderConditionId": 984
|
"DutyOptions": {
|
||||||
|
"ContentFinderConditionId": 984,
|
||||||
|
"Enabled": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -122,8 +122,14 @@
|
|||||||
{
|
{
|
||||||
"TerritoryId": 1191,
|
"TerritoryId": 1191,
|
||||||
"InteractionType": "Duty",
|
"InteractionType": "Duty",
|
||||||
|
"DutyOptions": {
|
||||||
"ContentFinderConditionId": 1008,
|
"ContentFinderConditionId": 1008,
|
||||||
"AutoDutyEnabled": true
|
"Enabled": true,
|
||||||
|
"Notes": [
|
||||||
|
"(boss 2) Requires vbm's auto-turn gaze option",
|
||||||
|
"(boss 3) Dashes (such as on SMN) will dash into the hole"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1237,15 +1237,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
|
"properties": {
|
||||||
|
"DutyOptions": {
|
||||||
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ContentFinderConditionId": {
|
"ContentFinderConditionId": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"exclusiveMinimum": 0,
|
"exclusiveMinimum": 0,
|
||||||
"exclusiveMaximum": 3000
|
"exclusiveMaximum": 3000
|
||||||
},
|
},
|
||||||
"AutoDutyEnabled": {
|
"Enabled": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"Notes": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"TestedAutoDutyVersion": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^0\\.\\d+\\.\\d+\\.\\d+$"
|
||||||
|
},
|
||||||
|
"$": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"ContentFinderConditionId",
|
||||||
|
"Enabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
"DataId": {
|
"DataId": {
|
||||||
"type": "null"
|
"type": "null"
|
||||||
},
|
},
|
||||||
@ -1254,7 +1276,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"ContentFinderConditionId"
|
"DutyOptions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
10
Questionable.Model/Questing/DutyOptions.cs
Normal file
10
Questionable.Model/Questing/DutyOptions.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Questionable.Model.Questing;
|
||||||
|
|
||||||
|
public class DutyOptions
|
||||||
|
{
|
||||||
|
public bool Enabled { get; set; }
|
||||||
|
public uint ContentFinderConditionId { get; set; }
|
||||||
|
public List<string> Notes { get; set; } = [];
|
||||||
|
}
|
@ -73,8 +73,7 @@ public sealed class QuestStep
|
|||||||
public float? CombatDelaySecondsAtStart { get; set; }
|
public float? CombatDelaySecondsAtStart { get; set; }
|
||||||
|
|
||||||
public JumpDestination? JumpDestination { get; set; }
|
public JumpDestination? JumpDestination { get; set; }
|
||||||
public uint? ContentFinderConditionId { get; set; }
|
public DutyOptions? DutyOptions { get; set; }
|
||||||
public bool AutoDutyEnabled { get; set; }
|
|
||||||
public SinglePlayerDutyOptions? SinglePlayerDutyOptions { get; set; }
|
public SinglePlayerDutyOptions? SinglePlayerDutyOptions { get; set; }
|
||||||
public byte SinglePlayerDutyIndex => SinglePlayerDutyOptions?.Index ?? 0;
|
public byte SinglePlayerDutyIndex => SinglePlayerDutyOptions?.Index ?? 0;
|
||||||
public SkipConditions? SkipConditions { get; set; }
|
public SkipConditions? SkipConditions { get; set; }
|
||||||
|
@ -165,8 +165,8 @@ internal sealed class QuestRegistry
|
|||||||
foreach (var dutyStep in quest.AllSteps().Where(x =>
|
foreach (var dutyStep in quest.AllSteps().Where(x =>
|
||||||
x.Step.InteractionType is EInteractionType.Duty or EInteractionType.SinglePlayerDuty))
|
x.Step.InteractionType is EInteractionType.Duty or EInteractionType.SinglePlayerDuty))
|
||||||
{
|
{
|
||||||
if (dutyStep.Step is { InteractionType: EInteractionType.Duty, ContentFinderConditionId: not null })
|
if (dutyStep.Step is { InteractionType: EInteractionType.Duty, DutyOptions: { } dutyOptions })
|
||||||
_contentFinderConditionIds[dutyStep.Step.ContentFinderConditionId!.Value] =
|
_contentFinderConditionIds[dutyOptions.ContentFinderConditionId] =
|
||||||
(quest.Id, dutyStep.Step);
|
(quest.Id, dutyStep.Step);
|
||||||
else if (dutyStep.Step.InteractionType == EInteractionType.SinglePlayerDuty &&
|
else if (dutyStep.Step.InteractionType == EInteractionType.SinglePlayerDuty &&
|
||||||
_territoryData.TryGetContentFinderConditionForSoloInstance(quest.Id,
|
_territoryData.TryGetContentFinderConditionForSoloInstance(quest.Id,
|
||||||
@ -262,15 +262,15 @@ internal sealed class QuestRegistry
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetDutyByContentFinderConditionId(uint cfcId, out bool autoDutyEnabledByDefault)
|
public bool TryGetDutyByContentFinderConditionId(uint cfcId, [NotNullWhen(true)] out DutyOptions? dutyOptions)
|
||||||
{
|
{
|
||||||
if (_contentFinderConditionIds.TryGetValue(cfcId, out var value))
|
if (_contentFinderConditionIds.TryGetValue(cfcId, out var value))
|
||||||
{
|
{
|
||||||
autoDutyEnabledByDefault = value.Step.AutoDutyEnabled;
|
dutyOptions = value.Step.DutyOptions;
|
||||||
return true;
|
return dutyOptions != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
autoDutyEnabledByDefault = false;
|
dutyOptions = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ internal static class SendNotification
|
|||||||
{
|
{
|
||||||
EInteractionType.Snipe when !automatonIpc.IsAutoSnipeEnabled =>
|
EInteractionType.Snipe when !automatonIpc.IsAutoSnipeEnabled =>
|
||||||
new Task(step.InteractionType, step.Comment),
|
new Task(step.InteractionType, step.Comment),
|
||||||
EInteractionType.Duty when !autoDutyIpc.IsConfiguredToRunContent(step.ContentFinderConditionId, step.AutoDutyEnabled) =>
|
EInteractionType.Duty when !autoDutyIpc.IsConfiguredToRunContent(step.DutyOptions) =>
|
||||||
new Task(step.InteractionType, step.ContentFinderConditionId.HasValue
|
new Task(step.InteractionType, step.DutyOptions?.ContentFinderConditionId is {} contentFinderConditionId
|
||||||
? territoryData.GetContentFinderCondition(step.ContentFinderConditionId.Value)?.Name
|
? territoryData.GetContentFinderCondition(contentFinderConditionId)?.Name
|
||||||
: step.Comment),
|
: step.Comment),
|
||||||
EInteractionType.SinglePlayerDuty when !bossModIpc.IsConfiguredToRunSoloInstance(quest.Id, step.SinglePlayerDutyOptions) =>
|
EInteractionType.SinglePlayerDuty when !bossModIpc.IsConfiguredToRunSoloInstance(quest.Id, step.SinglePlayerDutyOptions) =>
|
||||||
new Task(step.InteractionType, quest.Info.Name),
|
new Task(step.InteractionType, quest.Info.Name),
|
||||||
|
@ -23,17 +23,17 @@ internal static class Duty
|
|||||||
if (step.InteractionType != EInteractionType.Duty)
|
if (step.InteractionType != EInteractionType.Duty)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
ArgumentNullException.ThrowIfNull(step.ContentFinderConditionId);
|
ArgumentNullException.ThrowIfNull(step.DutyOptions);
|
||||||
|
|
||||||
if (autoDutyIpc.IsConfiguredToRunContent(step.ContentFinderConditionId, step.AutoDutyEnabled))
|
if (autoDutyIpc.IsConfiguredToRunContent(step.DutyOptions))
|
||||||
{
|
{
|
||||||
yield return new StartAutoDutyTask(step.ContentFinderConditionId.Value);
|
yield return new StartAutoDutyTask(step.DutyOptions.ContentFinderConditionId);
|
||||||
yield return new WaitAutoDutyTask(step.ContentFinderConditionId.Value);
|
yield return new WaitAutoDutyTask(step.DutyOptions.ContentFinderConditionId);
|
||||||
yield return new WaitAtEnd.WaitNextStepOrSequence();
|
yield return new WaitAtEnd.WaitNextStepOrSequence();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yield return new OpenDutyFinderTask(step.ContentFinderConditionId.Value);
|
yield return new OpenDutyFinderTask(step.DutyOptions.ContentFinderConditionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ internal static class WaitAtEnd
|
|||||||
case EInteractionType.Snipe:
|
case EInteractionType.Snipe:
|
||||||
return [new WaitNextStepOrSequence()];
|
return [new WaitNextStepOrSequence()];
|
||||||
|
|
||||||
case EInteractionType.Duty when !autoDutyIpc.IsConfiguredToRunContent(step.ContentFinderConditionId, step.AutoDutyEnabled):
|
case EInteractionType.Duty when !autoDutyIpc.IsConfiguredToRunContent(step.DutyOptions):
|
||||||
case EInteractionType.SinglePlayerDuty when !bossModIpc.IsConfiguredToRunSoloInstance(quest.Id, step.SinglePlayerDutyOptions):
|
case EInteractionType.SinglePlayerDuty when !bossModIpc.IsConfiguredToRunSoloInstance(quest.Id, step.SinglePlayerDutyOptions):
|
||||||
return [new EndAutomation()];
|
return [new EndAutomation()];
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ internal sealed class TerritoryData
|
|||||||
private readonly ImmutableDictionary<ushort, uint> _dutyTerritories;
|
private readonly ImmutableDictionary<ushort, uint> _dutyTerritories;
|
||||||
private readonly ImmutableDictionary<uint, string> _instanceNames;
|
private readonly ImmutableDictionary<uint, string> _instanceNames;
|
||||||
private readonly ImmutableDictionary<uint, ContentFinderConditionData> _contentFinderConditions;
|
private readonly ImmutableDictionary<uint, ContentFinderConditionData> _contentFinderConditions;
|
||||||
private readonly ImmutableDictionary<(ElementId QuestId, byte Index), uint> _questsToCfc;
|
private readonly ImmutableDictionary<(ElementId QuestId, byte Index), uint> _questBattlesToContentFinderCondition;
|
||||||
|
|
||||||
public TerritoryData(IDataManager dataManager)
|
public TerritoryData(IDataManager dataManager)
|
||||||
{
|
{
|
||||||
@ -52,7 +52,7 @@ internal sealed class TerritoryData
|
|||||||
.Select(x => new ContentFinderConditionData(x, dataManager.Language))
|
.Select(x => new ContentFinderConditionData(x, dataManager.Language))
|
||||||
.ToImmutableDictionary(x => x.ContentFinderConditionId, x => x);
|
.ToImmutableDictionary(x => x.ContentFinderConditionId, x => x);
|
||||||
|
|
||||||
_questsToCfc = dataManager.GetExcelSheet<Quest>()
|
_questBattlesToContentFinderCondition = dataManager.GetExcelSheet<Quest>()
|
||||||
.Where(x => x is { RowId: > 0, IssuerLocation.RowId: > 0 })
|
.Where(x => x is { RowId: > 0, IssuerLocation.RowId: > 0 })
|
||||||
.SelectMany(GetQuestBattles)
|
.SelectMany(GetQuestBattles)
|
||||||
.Select(x => (x.QuestId, x.Index,
|
.Select(x => (x.QuestId, x.Index,
|
||||||
@ -90,7 +90,7 @@ internal sealed class TerritoryData
|
|||||||
public bool TryGetContentFinderConditionForSoloInstance(ElementId questId, byte index,
|
public bool TryGetContentFinderConditionForSoloInstance(ElementId questId, byte index,
|
||||||
[NotNullWhen(true)] out ContentFinderConditionData? contentFinderConditionData)
|
[NotNullWhen(true)] out ContentFinderConditionData? contentFinderConditionData)
|
||||||
{
|
{
|
||||||
if (_questsToCfc.TryGetValue((questId, index), out uint cfcId))
|
if (_questBattlesToContentFinderCondition.TryGetValue((questId, index), out uint cfcId))
|
||||||
return _contentFinderConditions.TryGetValue(cfcId, out contentFinderConditionData);
|
return _contentFinderConditions.TryGetValue(cfcId, out contentFinderConditionData);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -101,7 +101,7 @@ internal sealed class TerritoryData
|
|||||||
|
|
||||||
public IEnumerable<(ElementId QuestId, byte Index, ContentFinderConditionData Data)> GetAllQuestsWithQuestBattles()
|
public IEnumerable<(ElementId QuestId, byte Index, ContentFinderConditionData Data)> GetAllQuestsWithQuestBattles()
|
||||||
{
|
{
|
||||||
return _questsToCfc.Select(x => (x.Key.QuestId, x.Key.Index, _contentFinderConditions[x.Value]));
|
return _questBattlesToContentFinderCondition.Select(x => (x.Key.QuestId, x.Key.Index, _contentFinderConditions[x.Value]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string FixName(string name, ClientLanguage language)
|
private static string FixName(string name, ClientLanguage language)
|
||||||
|
13
Questionable/External/AutoDutyIpc.cs
vendored
13
Questionable/External/AutoDutyIpc.cs
vendored
@ -4,6 +4,7 @@ using Dalamud.Plugin.Ipc.Exceptions;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Questionable.Controller.Steps;
|
using Questionable.Controller.Steps;
|
||||||
using Questionable.Data;
|
using Questionable.Data;
|
||||||
|
using Questionable.Model.Questing;
|
||||||
|
|
||||||
namespace Questionable.External;
|
namespace Questionable.External;
|
||||||
|
|
||||||
@ -31,22 +32,22 @@ internal sealed class AutoDutyIpc
|
|||||||
_stop = pluginInterface.GetIpcSubscriber<object>("AutoDuty.Stop");
|
_stop = pluginInterface.GetIpcSubscriber<object>("AutoDuty.Stop");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsConfiguredToRunContent(uint? cfcId, bool enabledByDefault)
|
public bool IsConfiguredToRunContent(DutyOptions? dutyOptions)
|
||||||
{
|
{
|
||||||
if (cfcId == null)
|
if (dutyOptions == null || dutyOptions.ContentFinderConditionId == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!_configuration.Duties.RunInstancedContentWithAutoDuty)
|
if (!_configuration.Duties.RunInstancedContentWithAutoDuty)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_configuration.Duties.BlacklistedDutyCfcIds.Contains(cfcId.Value))
|
if (_configuration.Duties.BlacklistedDutyCfcIds.Contains(dutyOptions.ContentFinderConditionId))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_configuration.Duties.WhitelistedDutyCfcIds.Contains(cfcId.Value) &&
|
if (_configuration.Duties.WhitelistedDutyCfcIds.Contains(dutyOptions.ContentFinderConditionId) &&
|
||||||
_territoryData.TryGetContentFinderCondition(cfcId.Value, out _))
|
_territoryData.TryGetContentFinderCondition(dutyOptions.ContentFinderConditionId, out _))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return enabledByDefault && HasPath(cfcId.Value);
|
return dutyOptions.Enabled && HasPath(dutyOptions.ContentFinderConditionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasPath(uint cfcId)
|
public bool HasPath(uint cfcId)
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
@ -61,4 +65,29 @@ internal abstract class ConfigComponent
|
|||||||
++byteCount;
|
++byteCount;
|
||||||
return Encoding.UTF8.GetString(ptr, byteCount);
|
return Encoding.UTF8.GetString(ptr, byteCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static void DrawNotes(bool enabledByDefault, IReadOnlyList<string> notes)
|
||||||
|
{
|
||||||
|
using var color = new ImRaii.Color();
|
||||||
|
color.Push(ImGuiCol.TextDisabled, !enabledByDefault ? ImGuiColors.DalamudYellow : ImGuiColors.ParsedBlue);
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
|
{
|
||||||
|
if (!enabledByDefault)
|
||||||
|
ImGui.TextDisabled(FontAwesomeIcon.ExclamationTriangle.ToIconString());
|
||||||
|
else
|
||||||
|
ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ImGui.IsItemHovered())
|
||||||
|
return;
|
||||||
|
|
||||||
|
using var _ = ImRaii.Tooltip();
|
||||||
|
|
||||||
|
ImGui.TextColored(ImGuiColors.DalamudYellow,
|
||||||
|
"While testing, the following issues have been found:");
|
||||||
|
foreach (string note in notes)
|
||||||
|
ImGui.BulletText(note);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ using Questionable.Controller;
|
|||||||
using Questionable.Data;
|
using Questionable.Data;
|
||||||
using Questionable.External;
|
using Questionable.External;
|
||||||
using Questionable.Model;
|
using Questionable.Model;
|
||||||
|
using Questionable.Model.Questing;
|
||||||
|
|
||||||
namespace Questionable.Windows.ConfigComponents;
|
namespace Questionable.Windows.ConfigComponents;
|
||||||
|
|
||||||
@ -125,12 +126,11 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||||||
{
|
{
|
||||||
foreach (var (cfcId, territoryId, name) in cfcNames)
|
foreach (var (cfcId, territoryId, name) in cfcNames)
|
||||||
{
|
{
|
||||||
if (_questRegistry.TryGetDutyByContentFinderConditionId(cfcId,
|
if (_questRegistry.TryGetDutyByContentFinderConditionId(cfcId, out DutyOptions? dutyOptions))
|
||||||
out bool autoDutyEnabledByDefault))
|
|
||||||
{
|
{
|
||||||
ImGui.TableNextRow();
|
ImGui.TableNextRow();
|
||||||
|
|
||||||
string[] labels = autoDutyEnabledByDefault
|
string[] labels = dutyOptions.Enabled
|
||||||
? SupportedCfcOptions
|
? SupportedCfcOptions
|
||||||
: UnsupportedCfcOptions;
|
: UnsupportedCfcOptions;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
@ -159,6 +159,8 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||||||
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(cfcId))
|
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(cfcId))
|
||||||
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty",
|
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty",
|
||||||
FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
||||||
|
else if (dutyOptions.Notes.Count > 0)
|
||||||
|
DrawNotes(dutyOptions.Enabled, dutyOptions.Notes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.TableNextColumn())
|
if (ImGui.TableNextColumn())
|
||||||
|
@ -460,32 +460,7 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
|
|||||||
FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
else if (dutyInfo.Notes.Count > 0)
|
else if (dutyInfo.Notes.Count > 0)
|
||||||
{
|
DrawNotes(dutyInfo.EnabledByDefault, dutyInfo.Notes);
|
||||||
using var color = new ImRaii.Color();
|
|
||||||
if (!dutyInfo.EnabledByDefault)
|
|
||||||
color.Push(ImGuiCol.TextDisabled, ImGuiColors.DalamudYellow);
|
|
||||||
else
|
|
||||||
color.Push(ImGuiCol.TextDisabled, ImGuiColors.ParsedBlue);
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
|
||||||
{
|
|
||||||
if (!dutyInfo.EnabledByDefault)
|
|
||||||
ImGui.TextDisabled(FontAwesomeIcon.ExclamationTriangle.ToIconString());
|
|
||||||
else
|
|
||||||
ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
|
||||||
using var _ = ImRaii.Tooltip();
|
|
||||||
|
|
||||||
ImGui.TextColored(ImGuiColors.DalamudYellow,
|
|
||||||
"While testing, the following issues have been found:");
|
|
||||||
foreach (string note in dutyInfo.Notes)
|
|
||||||
ImGui.BulletText(note);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.TableNextColumn())
|
if (ImGui.TableNextColumn())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user