forked from liza/Questionable
Handle dialogue choices in 'In from the Cold'
This commit is contained in:
parent
aebcb87aba
commit
76ce411e1c
@ -76,18 +76,10 @@
|
|||||||
"Microsoft.SourceLink.Common": "1.1.1"
|
"Microsoft.SourceLink.Common": "1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"System.Text.Encodings.Web": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "8.0.0",
|
|
||||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
|
||||||
},
|
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||||
"dependencies": {
|
|
||||||
"System.Text.Encodings.Web": "8.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ecommons": {
|
"ecommons": {
|
||||||
"type": "Project"
|
"type": "Project"
|
||||||
@ -101,7 +93,7 @@
|
|||||||
"questionable.model": {
|
"questionable.model": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Text.Json": "[8.0.4, )"
|
"System.Text.Json": "[8.0.5, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,15 @@
|
|||||||
"version": 1,
|
"version": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"net8.0-windows7.0": {
|
"net8.0-windows7.0": {
|
||||||
"System.Text.Encodings.Web": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "8.0.0",
|
|
||||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
|
||||||
},
|
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||||
"dependencies": {
|
|
||||||
"System.Text.Encodings.Web": "8.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"questionable.model": {
|
"questionable.model": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Text.Json": "[8.0.4, )"
|
"System.Text.Json": "[8.0.5, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
|
||||||
<PackageReference Include="System.Text.Json" Version="8.0.4" PrivateAssets="all" />
|
<PackageReference Include="System.Text.Json" Version="8.0.5" PrivateAssets="all" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -42,6 +42,9 @@ internal static class DialogueChoiceExtensions
|
|||||||
.AsSyntaxNodeOrToken(),
|
.AsSyntaxNodeOrToken(),
|
||||||
Assignment(nameof(DialogueChoice.DataId), dialogueChoice.DataId,
|
Assignment(nameof(DialogueChoice.DataId), dialogueChoice.DataId,
|
||||||
emptyChoice.DataId)
|
emptyChoice.DataId)
|
||||||
|
.AsSyntaxNodeOrToken(),
|
||||||
|
Assignment(nameof(DialogueChoice.SpecialCondition), dialogueChoice.SpecialCondition,
|
||||||
|
emptyChoice.SpecialCondition)
|
||||||
.AsSyntaxNodeOrToken()))));
|
.AsSyntaxNodeOrToken()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@
|
|||||||
},
|
},
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[8.0.4, )",
|
"requested": "[8.0.5, )",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
||||||
"System.Buffers": "4.5.1",
|
"System.Buffers": "4.5.1",
|
||||||
@ -264,7 +264,7 @@
|
|||||||
"questionable.model": {
|
"questionable.model": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Text.Json": "[8.0.4, )"
|
"System.Text.Json": "[8.0.5, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,19 @@
|
|||||||
"Type": "YesNo",
|
"Type": "YesNo",
|
||||||
"Prompt": "TEXT_AKTKMB115_04394_Q1_000_042",
|
"Prompt": "TEXT_AKTKMB115_04394_Q1_000_042",
|
||||||
"Yes": true
|
"Yes": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Type": "List",
|
||||||
|
"ExcelSheet": "ContentTalk",
|
||||||
|
"Prompt": 254,
|
||||||
|
"Answer": 247,
|
||||||
|
"SpecialCondition": "NoDutyActions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Type": "List",
|
||||||
|
"ExcelSheet": "ContentTalk",
|
||||||
|
"Prompt": 254,
|
||||||
|
"Answer": 248
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"AetheryteShortcut": "Garlemald - Camp Broken Glass",
|
"AetheryteShortcut": "Garlemald - Camp Broken Glass",
|
||||||
|
@ -2,23 +2,15 @@
|
|||||||
"version": 1,
|
"version": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"net8.0-windows7.0": {
|
"net8.0-windows7.0": {
|
||||||
"System.Text.Encodings.Web": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "8.0.0",
|
|
||||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
|
||||||
},
|
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||||
"dependencies": {
|
|
||||||
"System.Text.Encodings.Web": "8.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"questionable.model": {
|
"questionable.model": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Text.Json": "[8.0.4, )"
|
"System.Text.Json": "[8.0.5, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,4 +23,9 @@ public sealed class DialogueChoice
|
|||||||
/// If set, only applies when focusing the given target id.
|
/// If set, only applies when focusing the given target id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint? DataId { get; set; }
|
public uint? DataId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for 'In from the Cold'.
|
||||||
|
/// </summary>
|
||||||
|
public string? SpecialCondition { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.Text.Json" Version="8.0.4" />
|
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
},
|
},
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[8.0.4, )",
|
"requested": "[8.0.5, )",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
||||||
"System.Buffers": "4.5.1",
|
"System.Buffers": "4.5.1",
|
||||||
|
@ -7,7 +7,9 @@ using Dalamud.Game.Addon.Lifecycle;
|
|||||||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Event;
|
using FFXIVClientStructs.FFXIV.Client.Game.Event;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Game.InstanceContent;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
@ -333,7 +335,16 @@ internal sealed class InteractionUiController : IDisposable
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var step = quest.FindSequence(currentQuest.Sequence)?.FindStep(currentQuest.Step);
|
QuestStep? step = null;
|
||||||
|
if (_territoryData.IsQuestBattleInstance(_clientState.TerritoryType))
|
||||||
|
{
|
||||||
|
step = quest.FindSequence(currentQuest.Sequence)?.Steps
|
||||||
|
.FirstOrDefault(x => x.InteractionType == EInteractionType.SinglePlayerDuty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step == null)
|
||||||
|
step = quest.FindSequence(currentQuest.Sequence)?.FindStep(currentQuest.Step);
|
||||||
|
|
||||||
if (step == null)
|
if (step == null)
|
||||||
_logger.LogDebug("Ignoring current quest dialogue choices, no active step");
|
_logger.LogDebug("Ignoring current quest dialogue choices, no active step");
|
||||||
else
|
else
|
||||||
@ -427,6 +438,27 @@ internal sealed class InteractionUiController : IDisposable
|
|||||||
if (dialogueChoice.Type != EDialogChoiceType.List)
|
if (dialogueChoice.Type != EDialogChoiceType.List)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (dialogueChoice.SpecialCondition == "NoDutyActions")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
ContentDirector* contentDirector = EventFramework.Instance()->GetContentDirector();
|
||||||
|
if (contentDirector != null && contentDirector->DutyActionManager.ActionsPresent)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("NoDutyActions: actions present, skipping dialogue choice");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Failed to check for duty actions");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (dialogueChoice.Answer == null)
|
if (dialogueChoice.Answer == null)
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Ignoring entry in DialogueChoices, no answer");
|
_logger.LogDebug("Ignoring entry in DialogueChoices, no answer");
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" ExcludeAssets="runtime" />
|
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" ExcludeAssets="runtime" />
|
||||||
<PackageReference Include="JsonSchema.Net" Version="7.1.2" />
|
<PackageReference Include="JsonSchema.Net" Version="7.1.2" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
|
||||||
<PackageReference Include="System.Text.Json" Version="8.0.4" />
|
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -65,12 +65,9 @@
|
|||||||
},
|
},
|
||||||
"System.Text.Json": {
|
"System.Text.Json": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[8.0.4, )",
|
"requested": "[8.0.5, )",
|
||||||
"resolved": "8.0.4",
|
"resolved": "8.0.5",
|
||||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||||
"dependencies": {
|
|
||||||
"System.Text.Encodings.Web": "8.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"Humanizer.Core": {
|
"Humanizer.Core": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
@ -174,15 +171,10 @@
|
|||||||
"Microsoft.SourceLink.Common": "1.1.1"
|
"Microsoft.SourceLink.Common": "1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"System.Text.Encodings.Web": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "8.0.0",
|
|
||||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
|
||||||
},
|
|
||||||
"gatheringpaths": {
|
"gatheringpaths": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Questionable.Model": "[1.0.0, )"
|
"Questionable.Model": "[3.10.0, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"llib": {
|
"llib": {
|
||||||
@ -194,13 +186,13 @@
|
|||||||
"questionable.model": {
|
"questionable.model": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Text.Json": "[8.0.4, )"
|
"System.Text.Json": "[8.0.5, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"questpaths": {
|
"questpaths": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Questionable.Model": "[1.0.0, )"
|
"Questionable.Model": "[3.10.0, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user