Add support for Adventures to IUnlockState

This commit is contained in:
Haselnussbomber 2026-01-30 12:57:08 +01:00 committed by Blair
parent 1ba18e54bf
commit 4651397808
2 changed files with 24 additions and 2 deletions

View file

@ -115,6 +115,15 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
return this.IsUnlockLinkUnlocked(row.UnlockLink.RowId);
}
/// <inheritdoc/>
public bool IsAdventureComplete(Adventure row)
{
if (!this.IsLoaded)
return false;
return PlayerState.Instance()->IsAdventureComplete(row.RowId - 0x210000);
}
/// <inheritdoc/>
public bool IsAetherCurrentUnlocked(AetherCurrent row)
{
@ -527,6 +536,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
if (rowRef.TryGetValue<ActionSheet>(out var actionRow))
return this.IsActionUnlocked(actionRow);
if (rowRef.TryGetValue<Adventure>(out var adventureRow))
return this.IsAdventureComplete(adventureRow);
if (rowRef.TryGetValue<AetherCurrent>(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<ActionSheet>();
this.UpdateUnlocksForSheet<Adventure>();
this.UpdateUnlocksForSheet<AetherCurrent>();
this.UpdateUnlocksForSheet<AetherCurrentCompFlgSet>();
this.UpdateUnlocksForSheet<AozAction>();
@ -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
/// <inheritdoc/>
public bool IsActionUnlocked(ActionSheet row) => this.unlockStateService.IsActionUnlocked(row);
/// <inheritdoc/>
public bool IsAdventureComplete(Adventure row) => this.unlockStateService.IsAdventureComplete(row);
/// <inheritdoc/>
public bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row) => this.unlockStateService.IsAetherCurrentCompFlgSetUnlocked(row);

View file

@ -46,6 +46,13 @@ public interface IUnlockState : IDalamudService
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
bool IsActionUnlocked(Lumina.Excel.Sheets.Action row);
/// <summary>
/// Determines whether the specified Adventure is completed.
/// </summary>
/// <param name="row">The Adventure row to check.</param>
/// <returns><see langword="true"/> if completed; otherwise, <see langword="false"/>.</returns>
public bool IsAdventureComplete(Adventure row);
/// <summary>
/// Determines whether the specified AetherCurrentCompFlgSet is unlocked.
/// </summary>