mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 11:59:21 +01:00
Merge pull request #2508 from Haselnussbomber/excel-bump
Update Lumina and Lumina.Excel
This commit is contained in:
commit
355ad64eb9
5 changed files with 43 additions and 87 deletions
|
|
@ -3,9 +3,9 @@ using Lumina.Excel.Sheets;
|
|||
namespace Dalamud.Game.UnlockState;
|
||||
|
||||
/// <summary>
|
||||
/// Enum for <see cref="ItemAction.Type"/>.
|
||||
/// Enum for <see cref="ItemAction.Action"/>.
|
||||
/// </summary>
|
||||
internal enum ItemActionType : ushort
|
||||
internal enum ItemActionAction : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// No item action.
|
||||
|
|
@ -158,67 +158,23 @@ internal unsafe class RecipeData : IInternalDisposableService
|
|||
{
|
||||
noteBookDivisionIndex++;
|
||||
|
||||
// For future Lumina.Excel update, replace with:
|
||||
// if (!notebookDivisionRow.AllowedCraftTypes[craftType])
|
||||
// continue;
|
||||
|
||||
switch (craftTypeRow.RowId)
|
||||
{
|
||||
case 0 when !noteBookDivisionRow.CRPCraft: continue;
|
||||
case 1 when !noteBookDivisionRow.BSMCraft: continue;
|
||||
case 2 when !noteBookDivisionRow.ARMCraft: continue;
|
||||
case 3 when !noteBookDivisionRow.GSMCraft: continue;
|
||||
case 4 when !noteBookDivisionRow.LTWCraft: continue;
|
||||
case 5 when !noteBookDivisionRow.WVRCraft: continue;
|
||||
case 6 when !noteBookDivisionRow.ALCCraft: continue;
|
||||
case 7 when !noteBookDivisionRow.CULCraft: continue;
|
||||
}
|
||||
if (!noteBookDivisionRow.AllowedCraftTypes[craftType])
|
||||
continue;
|
||||
|
||||
if (noteBookDivisionRow.GatheringOpeningLevel != byte.MaxValue)
|
||||
continue;
|
||||
|
||||
// For future Lumina.Excel update, replace with:
|
||||
// if (notebookDivisionRow.RequiresSecretRecipeBookGroupUnlock)
|
||||
if (noteBookDivisionRow.Unknown1)
|
||||
if (noteBookDivisionRow.RequiresSecretRecipeBookGroupUnlock)
|
||||
{
|
||||
var secretRecipeBookUnlocked = false;
|
||||
|
||||
// For future Lumina.Excel update, iterate over notebookDivisionRow.SecretRecipeBookGroups
|
||||
for (var i = 0; i < 2; i++)
|
||||
foreach (var secretRecipeBookGroup in noteBookDivisionRow.SecretRecipeBookGroups)
|
||||
{
|
||||
// For future Lumina.Excel update, replace with:
|
||||
// if (secretRecipeBookGroup.RowId == 0 || !secretRecipeBookGroup.IsValid)
|
||||
// continue;
|
||||
var secretRecipeBookGroupRowId = i switch
|
||||
{
|
||||
0 => noteBookDivisionRow.Unknown2,
|
||||
1 => noteBookDivisionRow.Unknown2,
|
||||
_ => default,
|
||||
};
|
||||
|
||||
if (secretRecipeBookGroupRowId == 0)
|
||||
if (secretRecipeBookGroup.RowId == 0 || !secretRecipeBookGroup.IsValid)
|
||||
continue;
|
||||
|
||||
if (!this.dataManager.GetExcelSheet<SecretRecipeBookGroup>().TryGetRow(secretRecipeBookGroupRowId, out var secretRecipeBookGroupRow))
|
||||
continue;
|
||||
|
||||
// For future Lumina.Excel update, replace with:
|
||||
// var bitIndex = secretRecipeBookGroup.Value.UnlockBitIndex[craftType];
|
||||
|
||||
var bitIndex = craftType switch
|
||||
{
|
||||
0 => secretRecipeBookGroupRow.Unknown0,
|
||||
1 => secretRecipeBookGroupRow.Unknown1,
|
||||
2 => secretRecipeBookGroupRow.Unknown2,
|
||||
3 => secretRecipeBookGroupRow.Unknown3,
|
||||
4 => secretRecipeBookGroupRow.Unknown4,
|
||||
5 => secretRecipeBookGroupRow.Unknown5,
|
||||
6 => secretRecipeBookGroupRow.Unknown6,
|
||||
7 => secretRecipeBookGroupRow.Unknown7,
|
||||
_ => default,
|
||||
};
|
||||
|
||||
if (PlayerState.Instance()->UnlockedSecretRecipeBooksBitArray.Get(bitIndex))
|
||||
var bitIndex = secretRecipeBookGroup.Value.SecretRecipeBook[craftType].RowId;
|
||||
if (PlayerState.Instance()->UnlockedSecretRecipeBooksBitArray.Get((int)bitIndex))
|
||||
{
|
||||
secretRecipeBookUnlocked = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
/// <inheritdoc/>
|
||||
public bool IsEmjVoiceNpcUnlocked(EmjVoiceNpc row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.Unknown26);
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -217,7 +217,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
{
|
||||
return this.dataManager.GetExcelSheet<EmjVoiceNpc>().TryGetRow(row.RowId, out var emjVoiceNpcRow)
|
||||
&& this.IsEmjVoiceNpcUnlocked(emjVoiceNpcRow)
|
||||
&& QuestManager.IsQuestComplete(row.Unknown1);
|
||||
&& QuestManager.IsQuestComplete(row.UnlockQuest.RowId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -264,47 +264,47 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
|
||||
// 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)
|
||||
switch ((ItemActionAction)row.ItemAction.Value.Action.RowId)
|
||||
{
|
||||
case ItemActionType.Companion:
|
||||
case ItemActionAction.Companion:
|
||||
return UIState.Instance()->IsCompanionUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.BuddyEquip:
|
||||
case ItemActionAction.BuddyEquip:
|
||||
return UIState.Instance()->Buddy.CompanionInfo.IsBuddyEquipUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.Mount:
|
||||
case ItemActionAction.Mount:
|
||||
return PlayerState.Instance()->IsMountUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.SecretRecipeBook:
|
||||
case ItemActionAction.SecretRecipeBook:
|
||||
return PlayerState.Instance()->IsSecretRecipeBookUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.UnlockLink:
|
||||
case ItemActionType.OccultRecords:
|
||||
case ItemActionAction.UnlockLink:
|
||||
case ItemActionAction.OccultRecords:
|
||||
return UIState.Instance()->IsUnlockLinkUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.TripleTriadCard when row.AdditionalData.Is<TripleTriadCard>():
|
||||
case ItemActionAction.TripleTriadCard when row.AdditionalData.Is<TripleTriadCard>():
|
||||
return UIState.Instance()->IsTripleTriadCardUnlocked((ushort)row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.FolkloreTome:
|
||||
case ItemActionAction.FolkloreTome:
|
||||
return PlayerState.Instance()->IsFolkloreBookUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.OrchestrionRoll when row.AdditionalData.Is<Orchestrion>():
|
||||
case ItemActionAction.OrchestrionRoll when row.AdditionalData.Is<Orchestrion>():
|
||||
return PlayerState.Instance()->IsOrchestrionRollUnlocked(row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.FramersKit:
|
||||
case ItemActionAction.FramersKit:
|
||||
return PlayerState.Instance()->IsFramersKitUnlocked(row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.Ornament:
|
||||
case ItemActionAction.Ornament:
|
||||
return PlayerState.Instance()->IsOrnamentUnlocked(row.ItemAction.Value.Data[0]);
|
||||
|
||||
case ItemActionType.Glasses:
|
||||
case ItemActionAction.Glasses:
|
||||
return PlayerState.Instance()->IsGlassesUnlocked((ushort)row.AdditionalData.RowId);
|
||||
|
||||
case ItemActionType.SoulShards when PublicContentOccultCrescent.GetState() is var occultCrescentState && occultCrescentState != null:
|
||||
case ItemActionAction.SoulShards when PublicContentOccultCrescent.GetState() is var occultCrescentState && occultCrescentState != null:
|
||||
var supportJobId = (byte)row.ItemAction.Value.Data[0];
|
||||
return supportJobId < occultCrescentState->SupportJobLevels.Length && occultCrescentState->SupportJobLevels[supportJobId] != 0;
|
||||
|
||||
case ItemActionType.CompanySealVouchers:
|
||||
case ItemActionAction.CompanySealVouchers:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
/// <inheritdoc/>
|
||||
public bool IsMKDLoreUnlocked(MKDLore row)
|
||||
{
|
||||
return this.IsUnlockLinkUnlocked(row.Unknown2);
|
||||
return this.IsUnlockLinkUnlocked(row.UnlockLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -414,20 +414,20 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
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
|
||||
or ItemActionType.OccultRecords
|
||||
or ItemActionType.SoulShards;
|
||||
return (ItemActionAction)row.ItemAction.Value.Action.RowId
|
||||
is ItemActionAction.Companion
|
||||
or ItemActionAction.BuddyEquip
|
||||
or ItemActionAction.Mount
|
||||
or ItemActionAction.SecretRecipeBook
|
||||
or ItemActionAction.UnlockLink
|
||||
or ItemActionAction.TripleTriadCard
|
||||
or ItemActionAction.FolkloreTome
|
||||
or ItemActionAction.OrchestrionRoll
|
||||
or ItemActionAction.FramersKit
|
||||
or ItemActionAction.Ornament
|
||||
or ItemActionAction.Glasses
|
||||
or ItemActionAction.OccultRecords
|
||||
or ItemActionAction.SoulShards;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<PackageVersion Include="CheapLoc" Version="1.1.8" />
|
||||
<PackageVersion Include="MinSharp" Version="1.0.4" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageVersion Include="Lumina" Version="6.5.1" />
|
||||
<PackageVersion Include="Lumina" Version="7.1.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="10.0.0" />
|
||||
<PackageVersion Include="System.Reactive" Version="6.1.0" />
|
||||
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="10.0.0" />
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5d01489c34f33a3d645f49085d7fc0065a1ac801
|
||||
Subproject commit 4650ad332dd22aeff0d1f7ac33845b1c2aca4f8d
|
||||
Loading…
Add table
Add a link
Reference in a new issue