mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-25 14:11:48 +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;
|
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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue