mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-25 06:01:49 +01:00
Add Leve support to IUnlockState
This commit is contained in:
parent
98ef505b38
commit
63741ab37a
2 changed files with 23 additions and 0 deletions
|
|
@ -310,6 +310,15 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
return nativeRow != null && UIState.Instance()->IsItemActionUnlocked(nativeRow) == 1;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsLeveCompleted(Leve row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return QuestManager.Instance()->IsLevequestComplete((ushort)row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMJILandmarkUnlocked(MJILandmark row)
|
||||
{
|
||||
|
|
@ -524,6 +533,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
if (rowRef.TryGetValue<Item>(out var itemRow))
|
||||
return this.IsItemUnlocked(itemRow);
|
||||
|
||||
if (rowRef.TryGetValue<Leve>(out var leveRow))
|
||||
return this.IsLeveCompleted(leveRow);
|
||||
|
||||
if (rowRef.TryGetValue<MJILandmark>(out var mjiLandmarkRow))
|
||||
return this.IsMJILandmarkUnlocked(mjiLandmarkRow);
|
||||
|
||||
|
|
@ -656,6 +668,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
// Not implemented:
|
||||
// - DescriptionPage: quite complex
|
||||
// - QuestAcceptAdditionCondition: ignored
|
||||
// - Leve: AgentUpdateFlag.UnlocksUpdate is not set and the completed status can be unset again!
|
||||
|
||||
// For some other day:
|
||||
// - FishingSpot
|
||||
|
|
@ -814,6 +827,9 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat
|
|||
/// <inheritdoc/>
|
||||
public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsLeveCompleted(Leve row) => this.unlockStateService.IsLeveCompleted(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row);
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,13 @@ public interface IUnlockState : IDalamudService
|
|||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsItemUnlocked(Item row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Leve is completed.
|
||||
/// </summary>
|
||||
/// <param name="row">The Leve row to check.</param>
|
||||
/// <returns><see langword="true"/> if completed; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsLeveCompleted(Leve row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified McGuffin is unlocked.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue