mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 00:07:49 +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);
|
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/>
|
/// <inheritdoc/>
|
||||||
public bool IsAetherCurrentUnlocked(AetherCurrent row)
|
public bool IsAetherCurrentUnlocked(AetherCurrent row)
|
||||||
{
|
{
|
||||||
|
|
@ -527,6 +536,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
if (rowRef.TryGetValue<ActionSheet>(out var actionRow))
|
if (rowRef.TryGetValue<ActionSheet>(out var actionRow))
|
||||||
return this.IsActionUnlocked(actionRow);
|
return this.IsActionUnlocked(actionRow);
|
||||||
|
|
||||||
|
if (rowRef.TryGetValue<Adventure>(out var adventureRow))
|
||||||
|
return this.IsAdventureComplete(adventureRow);
|
||||||
|
|
||||||
if (rowRef.TryGetValue<AetherCurrent>(out var aetherCurrentRow))
|
if (rowRef.TryGetValue<AetherCurrent>(out var aetherCurrentRow))
|
||||||
return this.IsAetherCurrentUnlocked(aetherCurrentRow);
|
return this.IsAetherCurrentUnlocked(aetherCurrentRow);
|
||||||
|
|
||||||
|
|
@ -714,6 +726,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
// Do not check for Achievements or Titles here!
|
// Do not check for Achievements or Titles here!
|
||||||
|
|
||||||
this.UpdateUnlocksForSheet<ActionSheet>();
|
this.UpdateUnlocksForSheet<ActionSheet>();
|
||||||
|
this.UpdateUnlocksForSheet<Adventure>();
|
||||||
this.UpdateUnlocksForSheet<AetherCurrent>();
|
this.UpdateUnlocksForSheet<AetherCurrent>();
|
||||||
this.UpdateUnlocksForSheet<AetherCurrentCompFlgSet>();
|
this.UpdateUnlocksForSheet<AetherCurrentCompFlgSet>();
|
||||||
this.UpdateUnlocksForSheet<AozAction>();
|
this.UpdateUnlocksForSheet<AozAction>();
|
||||||
|
|
@ -760,7 +773,6 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
// For some other day:
|
// For some other day:
|
||||||
// - FishingSpot
|
// - FishingSpot
|
||||||
// - Spearfishing
|
// - Spearfishing
|
||||||
// - Adventure (Sightseeing)
|
|
||||||
// - MinerFolkloreTome
|
// - MinerFolkloreTome
|
||||||
// - BotanistFolkloreTome
|
// - BotanistFolkloreTome
|
||||||
// - FishingFolkloreTome
|
// - FishingFolkloreTome
|
||||||
|
|
@ -851,6 +863,9 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool IsActionUnlocked(ActionSheet row) => this.unlockStateService.IsActionUnlocked(row);
|
public bool IsActionUnlocked(ActionSheet row) => this.unlockStateService.IsActionUnlocked(row);
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public bool IsAdventureComplete(Adventure row) => this.unlockStateService.IsAdventureComplete(row);
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row) => this.unlockStateService.IsAetherCurrentCompFlgSetUnlocked(row);
|
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>
|
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||||
bool IsActionUnlocked(Lumina.Excel.Sheets.Action row);
|
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>
|
/// <summary>
|
||||||
/// Determines whether the specified AetherCurrentCompFlgSet is unlocked.
|
/// Determines whether the specified AetherCurrentCompFlgSet is unlocked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue