mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Add IUnlockState service
This commit is contained in:
parent
3c3eb9159c
commit
6ade5b21cf
3 changed files with 1171 additions and 0 deletions
76
Dalamud/Game/ItemActionType.cs
Normal file
76
Dalamud/Game/ItemActionType.cs
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Dalamud.Game;
|
||||
|
||||
/// <summary>
|
||||
/// Enum for <see cref="ItemAction.Type"/>.
|
||||
/// </summary>
|
||||
public enum ItemActionType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to unlock a companion (minion).
|
||||
/// </summary>
|
||||
Companion = 853,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock a chocobo companion barding.
|
||||
/// </summary>
|
||||
BuddyEquip = 1013,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock a mount.
|
||||
/// </summary>
|
||||
Mount = 1322,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock recipes from a crafting recipe book.
|
||||
/// </summary>
|
||||
SecretRecipeBook = 2136,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock various types of content (e.g. Riding Maps, Blue Mage Totems, Emotes, Hairstyles).
|
||||
/// </summary>
|
||||
UnlockLink = 2633,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock a Triple Triad Card.
|
||||
/// </summary>
|
||||
TripleTriadCard = 3357,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock gathering nodes of a Folklore Tome.
|
||||
/// </summary>
|
||||
FolkloreTome = 4107,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock an Orchestrion Roll.
|
||||
/// </summary>
|
||||
OrchestrionRoll = 25183,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock portrait designs.
|
||||
/// </summary>
|
||||
FramersKit = 29459,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock Bozjan Field Notes. These are server-side but are cached client-side.
|
||||
/// </summary>
|
||||
FieldNotes = 19743,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock an Ornament (fashion accessory).
|
||||
/// </summary>
|
||||
Ornament = 20086,
|
||||
|
||||
/// <summary>
|
||||
/// Used to unlock glasses.
|
||||
/// </summary>
|
||||
Glasses = 37312,
|
||||
|
||||
/// <summary>
|
||||
/// Used for Company Seal Vouchers, which convert the item into Company Seals when used.<br/>
|
||||
/// Can be used only if in a Grand Company.<br/>
|
||||
/// IsUnlocked always returns false.
|
||||
/// </summary>
|
||||
CompanySealVouchers = 41120,
|
||||
}
|
||||
798
Dalamud/Game/UnlockState/UnlockState.cs
Normal file
798
Dalamud/Game/UnlockState/UnlockState.cs
Normal file
|
|
@ -0,0 +1,798 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Game.Gui;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.IoC.Internal;
|
||||
using Dalamud.Logging.Internal;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||
using FFXIVClientStructs.FFXIV.Component.Exd;
|
||||
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
using ActionSheet = Lumina.Excel.Sheets.Action;
|
||||
using InstanceContentSheet = Lumina.Excel.Sheets.InstanceContent;
|
||||
using PublicContentSheet = Lumina.Excel.Sheets.PublicContent;
|
||||
|
||||
namespace Dalamud.Game.UnlockState;
|
||||
|
||||
/// <summary>
|
||||
/// This class provides unlock state of various content in the game.
|
||||
/// </summary>
|
||||
[ServiceManager.EarlyLoadedService]
|
||||
internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||
{
|
||||
private static readonly ModuleLog Log = new(nameof(UnlockState));
|
||||
|
||||
private readonly ConcurrentDictionary<Type, HashSet<uint>> cachedUnlockedRowIds = [];
|
||||
|
||||
[ServiceManager.ServiceDependency]
|
||||
private readonly DataManager dataManager = Service<DataManager>.Get();
|
||||
|
||||
[ServiceManager.ServiceDependency]
|
||||
private readonly ClientState.ClientState clientState = Service<ClientState.ClientState>.Get();
|
||||
|
||||
[ServiceManager.ServiceDependency]
|
||||
private readonly GameGui gameGui = Service<GameGui>.Get();
|
||||
|
||||
[ServiceManager.ServiceConstructor]
|
||||
private UnlockState()
|
||||
{
|
||||
this.clientState.Login += this.UpdateUnlocks;
|
||||
this.clientState.Logout += this.OnLogout;
|
||||
this.gameGui.UnlocksUpdate += this.UpdateUnlocks;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event IUnlockState.UnlockDelegate Unlock;
|
||||
|
||||
private bool IsLoaded => PlayerState.Instance()->IsLoaded;
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IInternalDisposableService.DisposeService()
|
||||
{
|
||||
this.clientState.Login -= this.UpdateUnlocks;
|
||||
this.clientState.Logout -= this.OnLogout;
|
||||
this.gameGui.UnlocksUpdate -= this.UpdateUnlocks;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsActionUnlocked(ActionSheet row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAetherCurrentUnlocked(AetherCurrent row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsAetherCurrentUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsAetherCurrentZoneComplete(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAozActionUnlocked(AozAction row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
if (row.RowId == 0 || !row.Action.IsValid)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsUnlockLinkUnlockedOrQuestCompleted(row.Action.Value.UnlockLink.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerBgUnlocked(BannerBg row)
|
||||
{
|
||||
return row.UnlockCondition.IsValid && this.IsBannerConditionUnlocked(row.UnlockCondition.Value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerConditionUnlocked(BannerCondition row)
|
||||
{
|
||||
if (row.RowId == 0)
|
||||
return false;
|
||||
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
var rowPtr = ExdModule.GetBannerConditionByIndex(row.RowId);
|
||||
if (rowPtr == null)
|
||||
return false;
|
||||
|
||||
return ExdModule.GetBannerConditionUnlockState(rowPtr) == 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerDecorationUnlocked(BannerDecoration row)
|
||||
{
|
||||
return row.UnlockCondition.IsValid && this.IsBannerConditionUnlocked(row.UnlockCondition.Value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerFacialUnlocked(BannerFacial row)
|
||||
{
|
||||
return row.UnlockCondition.IsValid && this.IsBannerConditionUnlocked(row.UnlockCondition.Value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerFrameUnlocked(BannerFrame row)
|
||||
{
|
||||
return row.UnlockCondition.IsValid && this.IsBannerConditionUnlocked(row.UnlockCondition.Value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerTimelineUnlocked(BannerTimeline row)
|
||||
{
|
||||
return row.UnlockCondition.IsValid && this.IsBannerConditionUnlocked(row.UnlockCondition.Value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBuddyActionUnlocked(BuddyAction row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBuddyEquipUnlocked(BuddyEquip row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->Buddy.CompanionInfo.IsBuddyEquipUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCharaMakeCustomizeUnlocked(CharaMakeCustomize row)
|
||||
{
|
||||
return row.IsPurchasable && this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsChocoboTaxiUnlocked(ChocoboTaxi row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsChocoboTaxiStandUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCompanionUnlocked(Companion row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsCompanionUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCraftActionUnlocked(CraftAction row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.QuestRequirement.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCSBonusContentTypeUnlocked(CSBonusContentType row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsEmoteUnlocked(Emote row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsGeneralActionUnlocked(GeneralAction row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsGlassesUnlocked(Glasses row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsGlassesUnlocked((ushort)row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsHowToUnlocked(HowTo row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsHowToUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsInstanceContentUnlocked(InstanceContentSheet row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.IsInstanceContentUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public unsafe bool IsItemUnlocked(Item row)
|
||||
{
|
||||
if (row.ItemAction.RowId == 0)
|
||||
return false;
|
||||
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
// To avoid the ExdModule.GetItemRowById call, which can return null if the excel page
|
||||
// is not loaded, we're going to imitate the IsItemActionUnlocked call first:
|
||||
switch ((ItemActionType)row.ItemAction.Value.Type)
|
||||
{
|
||||
case ItemActionType.Companion:
|
||||
return UIState.Instance()->IsCompanionUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.BuddyEquip:
|
||||
return UIState.Instance()->Buddy.CompanionInfo.IsBuddyEquipUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.Mount:
|
||||
return PlayerState.Instance()->IsMountUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.SecretRecipeBook:
|
||||
return PlayerState.Instance()->IsSecretRecipeBookUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.UnlockLink:
|
||||
return UIState.Instance()->IsUnlockLinkUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.TripleTriadCard when row.AdditionalData.Is<TripleTriadCard>():
|
||||
return UIState.Instance()->IsTripleTriadCardUnlocked((ushort)row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.FolkloreTome:
|
||||
return PlayerState.Instance()->IsFolkloreBookUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.OrchestrionRoll when row.AdditionalData.Is<Orchestrion>():
|
||||
return PlayerState.Instance()->IsOrchestrionRollUnlocked(row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.FramersKit:
|
||||
return PlayerState.Instance()->IsFramersKitUnlocked(row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.Ornament:
|
||||
return PlayerState.Instance()->IsOrnamentUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.Glasses:
|
||||
return PlayerState.Instance()->IsGlassesUnlocked((ushort)row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.CompanySealVouchers:
|
||||
return false;
|
||||
}
|
||||
|
||||
var nativeRow = ExdModule.GetItemRowById(row.RowId);
|
||||
return nativeRow != null && UIState.Instance()->IsItemActionUnlocked(nativeRow) == 1;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMcGuffinUnlocked(McGuffin row)
|
||||
{
|
||||
return PlayerState.Instance()->IsMcGuffinUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMJILandmarkUnlocked(MJILandmark row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMountUnlocked(Mount row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsMountUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsNotebookDivisionUnlocked(NotebookDivision row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.QuestUnlock.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsOrchestrionUnlocked(Orchestrion row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsOrchestrionRollUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsOrnamentUnlocked(Ornament row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsOrnamentUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsPerformUnlocked(Perform row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked((uint)row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsPublicContentUnlocked(PublicContentSheet row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.IsPublicContentUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSecretRecipeBookUnlocked(SecretRecipeBook row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return PlayerState.Instance()->IsSecretRecipeBookUnlocked(row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsTraitUnlocked(Trait row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.Quest.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsTripleTriadCardUnlocked(TripleTriadCard row)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsTripleTriadCardUnlocked((ushort)row.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsItemUnlockable(Item row)
|
||||
{
|
||||
if (row.ItemAction.RowId == 0)
|
||||
return false;
|
||||
|
||||
return (ItemActionType)row.ItemAction.Value.Type is
|
||||
ItemActionType.Companion or
|
||||
ItemActionType.BuddyEquip or
|
||||
ItemActionType.Mount or
|
||||
ItemActionType.SecretRecipeBook or
|
||||
ItemActionType.UnlockLink or
|
||||
ItemActionType.TripleTriadCard or
|
||||
ItemActionType.FolkloreTome or
|
||||
ItemActionType.OrchestrionRoll or
|
||||
ItemActionType.FramersKit or
|
||||
ItemActionType.Ornament or
|
||||
ItemActionType.Glasses;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsRowRefUnlocked<T>(RowRef<T> rowRef) where T : struct, IExcelRow<T>
|
||||
{
|
||||
return this.IsRowRefUnlocked((RowRef)rowRef);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsRowRefUnlocked(RowRef rowRef)
|
||||
{
|
||||
if (!this.IsLoaded || rowRef.IsUntyped)
|
||||
return false;
|
||||
|
||||
if (rowRef.TryGetValue<ActionSheet>(out var actionRow))
|
||||
return this.IsActionUnlocked(actionRow);
|
||||
|
||||
if (rowRef.TryGetValue<AetherCurrent>(out var aetherCurrentRow))
|
||||
return this.IsAetherCurrentUnlocked(aetherCurrentRow);
|
||||
|
||||
if (rowRef.TryGetValue<AetherCurrentCompFlgSet>(out var aetherCurrentCompFlgSetRow))
|
||||
return this.IsAetherCurrentCompFlgSetUnlocked(aetherCurrentCompFlgSetRow);
|
||||
|
||||
if (rowRef.TryGetValue<AozAction>(out var aozActionRow))
|
||||
return this.IsAozActionUnlocked(aozActionRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerBg>(out var bannerBgRow))
|
||||
return this.IsBannerBgUnlocked(bannerBgRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerCondition>(out var bannerConditionRow))
|
||||
return this.IsBannerConditionUnlocked(bannerConditionRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerDecoration>(out var bannerDecorationRow))
|
||||
return this.IsBannerDecorationUnlocked(bannerDecorationRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerFacial>(out var bannerFacialRow))
|
||||
return this.IsBannerFacialUnlocked(bannerFacialRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerFrame>(out var bannerFrameRow))
|
||||
return this.IsBannerFrameUnlocked(bannerFrameRow);
|
||||
|
||||
if (rowRef.TryGetValue<BannerTimeline>(out var bannerTimelineRow))
|
||||
return this.IsBannerTimelineUnlocked(bannerTimelineRow);
|
||||
|
||||
if (rowRef.TryGetValue<BuddyAction>(out var buddyActionRow))
|
||||
return this.IsBuddyActionUnlocked(buddyActionRow);
|
||||
|
||||
if (rowRef.TryGetValue<BuddyEquip>(out var buddyEquipRow))
|
||||
return this.IsBuddyEquipUnlocked(buddyEquipRow);
|
||||
|
||||
if (rowRef.TryGetValue<CSBonusContentType>(out var csBonusContentTypeRow))
|
||||
return this.IsCSBonusContentTypeUnlocked(csBonusContentTypeRow);
|
||||
|
||||
if (rowRef.TryGetValue<CharaMakeCustomize>(out var charaMakeCustomizeRow))
|
||||
return this.IsCharaMakeCustomizeUnlocked(charaMakeCustomizeRow);
|
||||
|
||||
if (rowRef.TryGetValue<ChocoboTaxi>(out var chocoboTaxiRow))
|
||||
return this.IsChocoboTaxiUnlocked(chocoboTaxiRow);
|
||||
|
||||
if (rowRef.TryGetValue<Companion>(out var companionRow))
|
||||
return this.IsCompanionUnlocked(companionRow);
|
||||
|
||||
if (rowRef.TryGetValue<CraftAction>(out var craftActionRow))
|
||||
return this.IsCraftActionUnlocked(craftActionRow);
|
||||
|
||||
if (rowRef.TryGetValue<Emote>(out var emoteRow))
|
||||
return this.IsEmoteUnlocked(emoteRow);
|
||||
|
||||
if (rowRef.TryGetValue<GeneralAction>(out var generalActionRow))
|
||||
return this.IsGeneralActionUnlocked(generalActionRow);
|
||||
|
||||
if (rowRef.TryGetValue<Glasses>(out var glassesRow))
|
||||
return this.IsGlassesUnlocked(glassesRow);
|
||||
|
||||
if (rowRef.TryGetValue<HowTo>(out var howToRow))
|
||||
return this.IsHowToUnlocked(howToRow);
|
||||
|
||||
if (rowRef.TryGetValue<InstanceContentSheet>(out var instanceContentRow))
|
||||
return this.IsInstanceContentUnlocked(instanceContentRow);
|
||||
|
||||
if (rowRef.TryGetValue<Item>(out var itemRow))
|
||||
return this.IsItemUnlocked(itemRow);
|
||||
|
||||
if (rowRef.TryGetValue<MJILandmark>(out var mjiLandmarkRow))
|
||||
return this.IsMJILandmarkUnlocked(mjiLandmarkRow);
|
||||
|
||||
if (rowRef.TryGetValue<McGuffin>(out var mcGuffinRow))
|
||||
return this.IsMcGuffinUnlocked(mcGuffinRow);
|
||||
|
||||
if (rowRef.TryGetValue<Mount>(out var mountRow))
|
||||
return this.IsMountUnlocked(mountRow);
|
||||
|
||||
if (rowRef.TryGetValue<NotebookDivision>(out var notebookDivisionRow))
|
||||
return this.IsNotebookDivisionUnlocked(notebookDivisionRow);
|
||||
|
||||
if (rowRef.TryGetValue<Orchestrion>(out var orchestrionRow))
|
||||
return this.IsOrchestrionUnlocked(orchestrionRow);
|
||||
|
||||
if (rowRef.TryGetValue<Ornament>(out var ornamentRow))
|
||||
return this.IsOrnamentUnlocked(ornamentRow);
|
||||
|
||||
if (rowRef.TryGetValue<Perform>(out var performRow))
|
||||
return this.IsPerformUnlocked(performRow);
|
||||
|
||||
if (rowRef.TryGetValue<PublicContentSheet>(out var publicContentRow))
|
||||
return this.IsPublicContentUnlocked(publicContentRow);
|
||||
|
||||
if (rowRef.TryGetValue<SecretRecipeBook>(out var secretRecipeBookRow))
|
||||
return this.IsSecretRecipeBookUnlocked(secretRecipeBookRow);
|
||||
|
||||
if (rowRef.TryGetValue<Trait>(out var traitRow))
|
||||
return this.IsTraitUnlocked(traitRow);
|
||||
|
||||
if (rowRef.TryGetValue<TripleTriadCard>(out var tripleTriadCardRow))
|
||||
return this.IsTripleTriadCardUnlocked(tripleTriadCardRow);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsUnlockLinkUnlocked(ushort unlockLink)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
if (unlockLink == 0)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsUnlockLinkUnlocked(unlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsUnlockLinkUnlocked(uint unlockLink)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return false;
|
||||
|
||||
if (unlockLink == 0)
|
||||
return false;
|
||||
|
||||
return UIState.Instance()->IsUnlockLinkUnlockedOrQuestCompleted(unlockLink);
|
||||
}
|
||||
|
||||
private void UpdateUnlocks()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.UpdateUnlocks(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Error during initial unlock check");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnLogout(int type, int code)
|
||||
{
|
||||
this.cachedUnlockedRowIds.Clear();
|
||||
}
|
||||
|
||||
private void UpdateUnlocks(bool fireEvent)
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return;
|
||||
|
||||
this.UpdateUnlocksForSheet<ActionSheet>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<AetherCurrent>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<AetherCurrentCompFlgSet>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<AozAction>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerBg>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerCondition>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerDecoration>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerFacial>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerFrame>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BannerTimeline>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BuddyAction>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<BuddyEquip>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<CSBonusContentType>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<CharaMakeCustomize>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<ChocoboTaxi>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Companion>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<CraftAction>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Emote>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<GeneralAction>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Glasses>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<HowTo>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<InstanceContentSheet>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Item>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<MJILandmark>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<McGuffin>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Mount>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<NotebookDivision>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Orchestrion>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Ornament>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Perform>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<PublicContentSheet>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<SecretRecipeBook>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<Trait>(fireEvent);
|
||||
this.UpdateUnlocksForSheet<TripleTriadCard>(fireEvent);
|
||||
|
||||
// Not implemented:
|
||||
// - DescriptionPage: quite complex
|
||||
// - QuestAcceptAdditionCondition: ignored
|
||||
|
||||
// For some other day:
|
||||
// - FishingSpot
|
||||
// - Spearfishing
|
||||
// - Adventure (Sightseeing)
|
||||
// - Recipes
|
||||
// - MinerFolkloreTome
|
||||
// - BotanistFolkloreTome
|
||||
// - FishingFolkloreTome
|
||||
// - VVD or is that unlocked via quest?
|
||||
// - VVDNotebookContents?
|
||||
// - FramersKit (is that just an Item?)
|
||||
// - ... more?
|
||||
|
||||
// Probably not happening, because it requires fetching data from server:
|
||||
// - Achievements
|
||||
// - Titles
|
||||
// - Bozjan Field Notes
|
||||
}
|
||||
|
||||
private void UpdateUnlocksForSheet<T>(bool fireEvent = true) where T : struct, IExcelRow<T>
|
||||
{
|
||||
var unlockedRowIds = this.cachedUnlockedRowIds.GetOrAdd(typeof(T), _ => []);
|
||||
|
||||
foreach (var row in this.dataManager.GetExcelSheet<T>())
|
||||
{
|
||||
if (unlockedRowIds.Contains(row.RowId))
|
||||
continue;
|
||||
|
||||
var rowRef = LuminaUtils.CreateRef<T>(row.RowId);
|
||||
|
||||
if (!this.IsRowRefUnlocked(rowRef))
|
||||
continue;
|
||||
|
||||
unlockedRowIds.Add(row.RowId);
|
||||
|
||||
if (fireEvent)
|
||||
{
|
||||
Log.Verbose("Unlock detected: {row}", $"{typeof(T).Name}#{row.RowId}");
|
||||
|
||||
foreach (var action in Delegate.EnumerateInvocationList(this.Unlock))
|
||||
{
|
||||
try
|
||||
{
|
||||
action((RowRef)rowRef);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Exception during raise of {handler}", action.Method);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plugin-scoped version of a <see cref="UnlockState"/> service.
|
||||
/// </summary>
|
||||
[PluginInterface]
|
||||
[ServiceManager.ScopedService]
|
||||
#pragma warning disable SA1015
|
||||
[ResolveVia<IUnlockState>]
|
||||
#pragma warning restore SA1015
|
||||
internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockState
|
||||
{
|
||||
[ServiceManager.ServiceDependency]
|
||||
private readonly UnlockState unlockStateService = Service<UnlockState>.Get();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UnlockStatePluginScoped"/> class.
|
||||
/// </summary>
|
||||
internal UnlockStatePluginScoped()
|
||||
{
|
||||
this.unlockStateService.Unlock += this.UnlockForward;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event IUnlockState.UnlockDelegate? Unlock;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsActionUnlocked(ActionSheet row) => this.unlockStateService.IsActionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row) => this.unlockStateService.IsAetherCurrentCompFlgSetUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAetherCurrentUnlocked(AetherCurrent row) => this.unlockStateService.IsAetherCurrentUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsAozActionUnlocked(AozAction row) => this.unlockStateService.IsAozActionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerBgUnlocked(BannerBg row) => this.unlockStateService.IsBannerBgUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerConditionUnlocked(BannerCondition row) => this.unlockStateService.IsBannerConditionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerDecorationUnlocked(BannerDecoration row) => this.unlockStateService.IsBannerDecorationUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerFacialUnlocked(BannerFacial row) => this.unlockStateService.IsBannerFacialUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerFrameUnlocked(BannerFrame row) => this.unlockStateService.IsBannerFrameUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBannerTimelineUnlocked(BannerTimeline row) => this.unlockStateService.IsBannerTimelineUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBuddyActionUnlocked(BuddyAction row) => this.unlockStateService.IsBuddyActionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsBuddyEquipUnlocked(BuddyEquip row) => this.unlockStateService.IsBuddyEquipUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCharaMakeCustomizeUnlocked(CharaMakeCustomize row) => this.unlockStateService.IsCharaMakeCustomizeUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsChocoboTaxiUnlocked(ChocoboTaxi row) => this.unlockStateService.IsChocoboTaxiUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCompanionUnlocked(Companion row) => this.unlockStateService.IsCompanionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCraftActionUnlocked(CraftAction row) => this.unlockStateService.IsCraftActionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCSBonusContentTypeUnlocked(CSBonusContentType row) => this.unlockStateService.IsCSBonusContentTypeUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsEmoteUnlocked(Emote row) => this.unlockStateService.IsEmoteUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsGeneralActionUnlocked(GeneralAction row) => this.unlockStateService.IsGeneralActionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsGlassesUnlocked(Glasses row) => this.unlockStateService.IsGlassesUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsHowToUnlocked(HowTo row) => this.unlockStateService.IsHowToUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsInstanceContentUnlocked(InstanceContentSheet row) => this.unlockStateService.IsInstanceContentUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsItemUnlockable(Item row) => this.unlockStateService.IsItemUnlockable(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMcGuffinUnlocked(McGuffin row) => this.unlockStateService.IsMcGuffinUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMountUnlocked(Mount row) => this.unlockStateService.IsMountUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsNotebookDivisionUnlocked(NotebookDivision row) => this.unlockStateService.IsNotebookDivisionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsOrchestrionUnlocked(Orchestrion row) => this.unlockStateService.IsOrchestrionUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsOrnamentUnlocked(Ornament row) => this.unlockStateService.IsOrnamentUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsPerformUnlocked(Perform row) => this.unlockStateService.IsPerformUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsPublicContentUnlocked(PublicContentSheet row) => this.unlockStateService.IsPublicContentUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsRowRefUnlocked(RowRef rowRef) => this.unlockStateService.IsRowRefUnlocked(rowRef);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsRowRefUnlocked<T>(RowRef<T> rowRef) where T : struct, IExcelRow<T> => this.unlockStateService.IsRowRefUnlocked(rowRef);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSecretRecipeBookUnlocked(SecretRecipeBook row) => this.unlockStateService.IsSecretRecipeBookUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsTraitUnlocked(Trait row) => this.unlockStateService.IsTraitUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsTripleTriadCardUnlocked(TripleTriadCard row) => this.unlockStateService.IsTripleTriadCardUnlocked(row);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsUnlockLinkUnlocked(uint unlockLink) => this.unlockStateService.IsUnlockLinkUnlocked(unlockLink);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsUnlockLinkUnlocked(ushort unlockLink) => this.unlockStateService.IsUnlockLinkUnlocked(unlockLink);
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IInternalDisposableService.DisposeService()
|
||||
{
|
||||
this.unlockStateService.Unlock -= this.UnlockForward;
|
||||
}
|
||||
|
||||
private void UnlockForward(RowRef rowRef) => this.Unlock?.Invoke(rowRef);
|
||||
}
|
||||
297
Dalamud/Plugin/Services/IUnlockState.cs
Normal file
297
Dalamud/Plugin/Services/IUnlockState.cs
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Dalamud.Plugin.Services;
|
||||
|
||||
#pragma warning disable SA1400 // Access modifier should be declared: Interface members are public by default
|
||||
|
||||
/// <summary>
|
||||
/// Interface for determining unlock state of various content in the game.
|
||||
/// </summary>
|
||||
public interface IUnlockState
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegate type used for the <see cref="Unlock"/> event.
|
||||
/// </summary>
|
||||
/// <param name="rowRef">A RowRef of the unlocked thing.</param>
|
||||
delegate void UnlockDelegate(RowRef rowRef);
|
||||
|
||||
/// <summary>
|
||||
/// Event triggered when something was unlocked.
|
||||
/// </summary>
|
||||
event UnlockDelegate? Unlock;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Action is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Action row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsActionUnlocked(Lumina.Excel.Sheets.Action row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified AetherCurrentCompFlgSet is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The AetherCurrentCompFlgSet row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsAetherCurrentCompFlgSetUnlocked(AetherCurrentCompFlgSet row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified AetherCurrent is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The AetherCurrent row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsAetherCurrentUnlocked(AetherCurrent row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified AozAction (Blue Mage Action) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The AozAction row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsAozActionUnlocked(AozAction row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerBg (Portrait Backgrounds) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerBg row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerBgUnlocked(BannerBg row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerCondition is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerCondition row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerConditionUnlocked(BannerCondition row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerDecoration (Portrait Accents) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerDecoration row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerDecorationUnlocked(BannerDecoration row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerFacial (Portrait Expressions) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerFacial row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerFacialUnlocked(BannerFacial row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerFrame (Portrait Frames) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerFrame row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerFrameUnlocked(BannerFrame row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BannerTimeline (Portrait Poses) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BannerTimeline row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBannerTimelineUnlocked(BannerTimeline row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BuddyAction (Action of the players Chocobo Companion) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BuddyAction row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBuddyActionUnlocked(BuddyAction row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified BuddyEquip (Equipment of the players Chocobo Companion) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The BuddyEquip row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsBuddyEquipUnlocked(BuddyEquip row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified CharaMakeCustomize (Hairstyles and Face Paint patterns) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The CharaMakeCustomize row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsCharaMakeCustomizeUnlocked(CharaMakeCustomize row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified ChocoboTaxi (Chocobokeeps of the Chocobo Porter service) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The ChocoboTaxi row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsChocoboTaxiUnlocked(ChocoboTaxi row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Companion (Minions) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Companion row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsCompanionUnlocked(Companion row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified CraftAction is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The CraftAction row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsCraftActionUnlocked(CraftAction row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified CSBonusContentType is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The CSBonusContentType row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsCSBonusContentTypeUnlocked(CSBonusContentType row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Emote is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Emote row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsEmoteUnlocked(Emote row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified GeneralAction is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The GeneralAction row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsGeneralActionUnlocked(GeneralAction row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Glasses is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Glasses row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsGlassesUnlocked(Glasses row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified HowTo is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The HowTo row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsHowToUnlocked(HowTo row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified InstanceContent is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The InstanceContent row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsInstanceContentUnlocked(InstanceContent row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Item is considered unlockable.
|
||||
/// </summary>
|
||||
/// <param name="row">The Item row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlockable; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsItemUnlockable(Item row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Item is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Item row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsItemUnlocked(Item row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified McGuffin is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The McGuffin row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsMcGuffinUnlocked(McGuffin row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified MJILandmark (Island Sanctuary landmark) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The MJILandmark row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsMJILandmarkUnlocked(MJILandmark row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Mount is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Mount row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsMountUnlocked(Mount row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified NotebookDivision (Categories in Crafting/Gathering Log) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The NotebookDivision row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsNotebookDivisionUnlocked(NotebookDivision row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Orchestrion roll is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Orchestrion row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsOrchestrionUnlocked(Orchestrion row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Ornament (Fashion Accessories) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Ornament row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsOrnamentUnlocked(Ornament row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Perform (Performance Instruments) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Perform row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsPerformUnlocked(Perform row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified PublicContent is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The PublicContent row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsPublicContentUnlocked(PublicContent row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the underlying RowRef type is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="rowRef">The RowRef to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsRowRefUnlocked(RowRef rowRef);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the underlying RowRef type is unlocked.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the Excel row.</typeparam>
|
||||
/// <param name="rowRef">The RowRef to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsRowRefUnlocked<T>(RowRef<T> rowRef) where T : struct, IExcelRow<T>;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified SecretRecipeBook (Master Recipe Books) is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The SecretRecipeBook row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsSecretRecipeBookUnlocked(SecretRecipeBook row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified Trait is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The Trait row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsTraitUnlocked(Trait row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified TripleTriadCard is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="row">The TripleTriadCard row to check.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsTripleTriadCardUnlocked(TripleTriadCard row);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified unlock link is unlocked or quest is completed.
|
||||
/// </summary>
|
||||
/// <param name="unlockLink">The unlock link id or quest id (quest ids in this case are over 65536).</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsUnlockLinkUnlocked(uint unlockLink);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified unlock link is unlocked.
|
||||
/// </summary>
|
||||
/// <param name="unlockLink">The unlock link id.</param>
|
||||
/// <returns><see langword="true"/> if unlocked; otherwise, <see langword="false"/>.</returns>
|
||||
bool IsUnlockLinkUnlocked(ushort unlockLink);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue