mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-13 11:27:42 +01:00
Add support for Adventures to IUnlockState
This commit is contained in:
parent
1ba18e54bf
commit
4651397808
2 changed files with 24 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue