Add Leve support to IUnlockState

This commit is contained in:
Haselnussbomber 2026-01-11 01:44:59 +01:00
parent 98ef505b38
commit 63741ab37a
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
2 changed files with 23 additions and 0 deletions

View file

@ -310,6 +310,15 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
return nativeRow != null && UIState.Instance()->IsItemActionUnlocked(nativeRow) == 1; 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/> /// <inheritdoc/>
public bool IsMJILandmarkUnlocked(MJILandmark row) public bool IsMJILandmarkUnlocked(MJILandmark row)
{ {
@ -524,6 +533,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
if (rowRef.TryGetValue<Item>(out var itemRow)) if (rowRef.TryGetValue<Item>(out var itemRow))
return this.IsItemUnlocked(itemRow); return this.IsItemUnlocked(itemRow);
if (rowRef.TryGetValue<Leve>(out var leveRow))
return this.IsLeveCompleted(leveRow);
if (rowRef.TryGetValue<MJILandmark>(out var mjiLandmarkRow)) if (rowRef.TryGetValue<MJILandmark>(out var mjiLandmarkRow))
return this.IsMJILandmarkUnlocked(mjiLandmarkRow); return this.IsMJILandmarkUnlocked(mjiLandmarkRow);
@ -656,6 +668,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
// Not implemented: // Not implemented:
// - DescriptionPage: quite complex // - DescriptionPage: quite complex
// - QuestAcceptAdditionCondition: ignored // - QuestAcceptAdditionCondition: ignored
// - Leve: AgentUpdateFlag.UnlocksUpdate is not set and the completed status can be unset again!
// For some other day: // For some other day:
// - FishingSpot // - FishingSpot
@ -814,6 +827,9 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat
/// <inheritdoc/> /// <inheritdoc/>
public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row); public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row);
/// <inheritdoc/>
public bool IsLeveCompleted(Leve row) => this.unlockStateService.IsLeveCompleted(row);
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row); public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row);

View file

@ -205,6 +205,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 IsItemUnlocked(Item row); 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> /// <summary>
/// Determines whether the specified McGuffin is unlocked. /// Determines whether the specified McGuffin is unlocked.
/// </summary> /// </summary>