From 69caffeb97e31d5ec5c58e75ef34ca4de5f733f5 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sat, 18 Oct 2025 03:52:31 +0200 Subject: [PATCH] Add support for EmjCostume rows --- Dalamud/Game/UnlockState/UnlockState.cs | 15 +++++++++++++++ Dalamud/Plugin/Services/IUnlockState.cs | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/Dalamud/Game/UnlockState/UnlockState.cs b/Dalamud/Game/UnlockState/UnlockState.cs index 0d4a8859e..f86b89efb 100644 --- a/Dalamud/Game/UnlockState/UnlockState.cs +++ b/Dalamud/Game/UnlockState/UnlockState.cs @@ -8,6 +8,7 @@ using Dalamud.IoC.Internal; using Dalamud.Logging.Internal; using Dalamud.Plugin.Services; +using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game.InstanceContent; using FFXIVClientStructs.FFXIV.Client.Game.UI; using FFXIVClientStructs.FFXIV.Component.Exd; @@ -211,6 +212,14 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState return this.IsUnlockLinkUnlocked(row.Unknown26); } + /// + public bool IsEmjCostumeUnlocked(EmjCostume row) + { + return this.dataManager.GetExcelSheet().TryGetRow(row.RowId, out var emjVoiceNpcRow) + && this.IsEmjVoiceNpcUnlocked(emjVoiceNpcRow) + && QuestManager.IsQuestComplete(row.Unknown1); + } + /// public bool IsGeneralActionUnlocked(GeneralAction row) { @@ -644,6 +653,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState // - FramersKit (is that just an Item?) // - ... more? + // Subrow sheets, which are incompatible with the current Unlock event, since RowRef doesn't carry the SubrowId: + // - EmjCostume + // Probably not happening, because it requires fetching data from server: // - Achievements // - Titles @@ -768,6 +780,9 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat /// public bool IsEmjVoiceNpcUnlocked(EmjVoiceNpc row) => this.unlockStateService.IsEmjVoiceNpcUnlocked(row); + /// + public bool IsEmjCostumeUnlocked(EmjCostume row) => this.unlockStateService.IsEmjCostumeUnlocked(row); + /// public bool IsGeneralActionUnlocked(GeneralAction row) => this.unlockStateService.IsGeneralActionUnlocked(row); diff --git a/Dalamud/Plugin/Services/IUnlockState.cs b/Dalamud/Plugin/Services/IUnlockState.cs index 50167812d..00f2df190 100644 --- a/Dalamud/Plugin/Services/IUnlockState.cs +++ b/Dalamud/Plugin/Services/IUnlockState.cs @@ -157,6 +157,13 @@ public interface IUnlockState /// if unlocked; otherwise, . bool IsEmjVoiceNpcUnlocked(EmjVoiceNpc row); + /// + /// Determines whether the specified EmjCostume (Doman Mahjong Character Costume) is unlocked. + /// + /// The EmjCostume row to check. + /// if unlocked; otherwise, . + bool IsEmjCostumeUnlocked(EmjCostume row); + /// /// Determines whether the specified GeneralAction is unlocked. ///