From 46513978087cc11b647fa6a39552be986dd96819 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Fri, 30 Jan 2026 12:57:08 +0100 Subject: [PATCH] Add support for Adventures to IUnlockState --- Dalamud/Game/UnlockState/UnlockState.cs | 19 +++++++++++++++++-- Dalamud/Plugin/Services/IUnlockState.cs | 7 +++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Dalamud/Game/UnlockState/UnlockState.cs b/Dalamud/Game/UnlockState/UnlockState.cs index 273a0228e..7e8f64adf 100644 --- a/Dalamud/Game/UnlockState/UnlockState.cs +++ b/Dalamud/Game/UnlockState/UnlockState.cs @@ -115,6 +115,15 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState return this.IsUnlockLinkUnlocked(row.UnlockLink.RowId); } + /// + public bool IsAdventureComplete(Adventure row) + { + if (!this.IsLoaded) + return false; + + return PlayerState.Instance()->IsAdventureComplete(row.RowId - 0x210000); + } + /// public bool IsAetherCurrentUnlocked(AetherCurrent row) { @@ -527,6 +536,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState if (rowRef.TryGetValue(out var actionRow)) return this.IsActionUnlocked(actionRow); + if (rowRef.TryGetValue(out var adventureRow)) + return this.IsAdventureComplete(adventureRow); + if (rowRef.TryGetValue(out var aetherCurrentRow)) return this.IsAetherCurrentUnlocked(aetherCurrentRow); @@ -710,10 +722,11 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState return; Log.Verbose("Checking for new unlocks..."); - + // Do not check for Achievements or Titles here! this.UpdateUnlocksForSheet(); + this.UpdateUnlocksForSheet(); this.UpdateUnlocksForSheet(); this.UpdateUnlocksForSheet(); this.UpdateUnlocksForSheet(); @@ -760,7 +773,6 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState // For some other day: // - FishingSpot // - Spearfishing - // - Adventure (Sightseeing) // - MinerFolkloreTome // - BotanistFolkloreTome // - FishingFolkloreTome @@ -851,6 +863,9 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat /// public bool IsActionUnlocked(ActionSheet row) => this.unlockStateService.IsActionUnlocked(row); + /// + public bool IsAdventureComplete(Adventure row) => this.unlockStateService.IsAdventureComplete(row); + /// public bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row) => this.unlockStateService.IsAetherCurrentCompFlgSetUnlocked(row); diff --git a/Dalamud/Plugin/Services/IUnlockState.cs b/Dalamud/Plugin/Services/IUnlockState.cs index 4554aa318..4f92b2b3d 100644 --- a/Dalamud/Plugin/Services/IUnlockState.cs +++ b/Dalamud/Plugin/Services/IUnlockState.cs @@ -46,6 +46,13 @@ public interface IUnlockState : IDalamudService /// if unlocked; otherwise, . bool IsActionUnlocked(Lumina.Excel.Sheets.Action row); + /// + /// Determines whether the specified Adventure is completed. + /// + /// The Adventure row to check. + /// if completed; otherwise, . + public bool IsAdventureComplete(Adventure row); + /// /// Determines whether the specified AetherCurrentCompFlgSet is unlocked. ///