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"
|
||||
}
|
||||
},
|
||||
"System.Text.Encodings.Web": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"dependencies": {
|
||||
"System.Text.Encodings.Web": "8.0.0"
|
||||
}
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||
},
|
||||
"ecommons": {
|
||||
"type": "Project"
|
||||
@ -101,7 +93,7 @@
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"System.Text.Json": "[8.0.4, )"
|
||||
"System.Text.Json": "[8.0.5, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,23 +2,15 @@
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net8.0-windows7.0": {
|
||||
"System.Text.Encodings.Web": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"dependencies": {
|
||||
"System.Text.Encodings.Web": "8.0.0"
|
||||
}
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||
},
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"System.Text.Json": "[8.0.4, )"
|
||||
"System.Text.Json": "[8.0.5, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" 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>
|
||||
|
@ -42,6 +42,9 @@ internal static class DialogueChoiceExtensions
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(DialogueChoice.DataId), dialogueChoice.DataId,
|
||||
emptyChoice.DataId)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(DialogueChoice.SpecialCondition), dialogueChoice.SpecialCondition,
|
||||
emptyChoice.SpecialCondition)
|
||||
.AsSyntaxNodeOrToken()))));
|
||||
}
|
||||
}
|
||||
|
@ -68,9 +68,9 @@
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.4, )",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"requested": "[8.0.5, )",
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
||||
"System.Buffers": "4.5.1",
|
||||
@ -264,7 +264,7 @@
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"System.Text.Json": "[8.0.4, )"
|
||||
"System.Text.Json": "[8.0.5, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,19 @@
|
||||
"Type": "YesNo",
|
||||
"Prompt": "TEXT_AKTKMB115_04394_Q1_000_042",
|
||||
"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",
|
||||
|
@ -2,23 +2,15 @@
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net8.0-windows7.0": {
|
||||
"System.Text.Encodings.Web": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"dependencies": {
|
||||
"System.Text.Encodings.Web": "8.0.0"
|
||||
}
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||
},
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"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.
|
||||
/// </summary>
|
||||
public uint? DataId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used for 'In from the Cold'.
|
||||
/// </summary>
|
||||
public string? SpecialCondition { get; set; }
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.4" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.4, )",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"requested": "[8.0.5, )",
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
|
||||
"System.Buffers": "4.5.1",
|
||||
|
@ -7,7 +7,9 @@ using Dalamud.Game.Addon.Lifecycle;
|
||||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||
using Dalamud.Game.ClientState.Objects;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Event;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.InstanceContent;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
@ -333,7 +335,16 @@ internal sealed class InteractionUiController : IDisposable
|
||||
}
|
||||
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)
|
||||
_logger.LogDebug("Ignoring current quest dialogue choices, no active step");
|
||||
else
|
||||
@ -427,6 +438,27 @@ internal sealed class InteractionUiController : IDisposable
|
||||
if (dialogueChoice.Type != EDialogChoiceType.List)
|
||||
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)
|
||||
{
|
||||
_logger.LogDebug("Ignoring entry in DialogueChoices, no answer");
|
||||
|
@ -13,7 +13,7 @@
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" ExcludeAssets="runtime" />
|
||||
<PackageReference Include="JsonSchema.Net" Version="7.1.2" />
|
||||
<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>
|
||||
|
@ -65,12 +65,9 @@
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.4, )",
|
||||
"resolved": "8.0.4",
|
||||
"contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
||||
"dependencies": {
|
||||
"System.Text.Encodings.Web": "8.0.0"
|
||||
}
|
||||
"requested": "[8.0.5, )",
|
||||
"resolved": "8.0.5",
|
||||
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
|
||||
},
|
||||
"Humanizer.Core": {
|
||||
"type": "Transitive",
|
||||
@ -174,15 +171,10 @@
|
||||
"Microsoft.SourceLink.Common": "1.1.1"
|
||||
}
|
||||
},
|
||||
"System.Text.Encodings.Web": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||
},
|
||||
"gatheringpaths": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Questionable.Model": "[1.0.0, )"
|
||||
"Questionable.Model": "[3.10.0, )"
|
||||
}
|
||||
},
|
||||
"llib": {
|
||||
@ -194,13 +186,13 @@
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"System.Text.Json": "[8.0.4, )"
|
||||
"System.Text.Json": "[8.0.5, )"
|
||||
}
|
||||
},
|
||||
"questpaths": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Questionable.Model": "[1.0.0, )"
|
||||
"Questionable.Model": "[3.10.0, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user