Update to Lumina 5 (new Excel parsing) (#2022)

* Refactor and upgrade to new excel design

* Obsolete ExcelResolver<T> and use only RowRef<T>

* Better benchmarking for Lumina

* Add custom game-supported RSV provider

* Refactor and move Lazy<T> and nullable/cached row objects to RowRefs

* Convert IRSVProvider to delegate, resolve strings by default

* Split IExcelRow into IExcelSubrow

* Extra lumina documentation

* Minor RSV CS fixes

* Fix UIGlowPayload warning

* Fix rebase

* Update to Lumina 5
This commit is contained in:
Asriel Camora 2024-10-20 19:59:03 -07:00 committed by GitHub
parent 08d8605871
commit 0b9af0e3f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 460 additions and 403 deletions

View file

@ -599,7 +599,7 @@ internal class LocalPlugin : IAsyncDisposable
// Changes to Lumina should be upstreamed if feasible, and if there is a desire to re-add unpinned Lumina we
// will need to put this behind some kind of feature flag somewhere.
config.SharedAssemblies.Add((typeof(Lumina.GameData).Assembly.GetName(), true));
config.SharedAssemblies.Add((typeof(Lumina.Excel.ExcelSheetImpl).Assembly.GetName(), true));
config.SharedAssemblies.Add((typeof(Lumina.Excel.Sheets.Addon).Assembly.GetName(), true));
}
private void EnsureLoader()

View file

@ -61,7 +61,7 @@ public interface IClientState
/// <summary>
/// Event that gets fired when a duty is ready.
/// </summary>
public event Action<Lumina.Excel.GeneratedSheets.ContentFinderCondition> CfPop;
public event Action<Lumina.Excel.Sheets.ContentFinderCondition> CfPop;
/// <summary>
/// Gets the language of the client.

View file

@ -5,7 +5,9 @@ using Dalamud.Game;
using Lumina;
using Lumina.Data;
using Lumina.Data.Structs.Excel;
using Lumina.Excel;
using Lumina.Excel.Exceptions;
namespace Dalamud.Plugin.Services;
@ -37,17 +39,38 @@ public interface IDataManager
/// <summary>
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type.
/// </summary>
/// <param name="language">Language of the sheet to get. Leave <see langword="null"/> or empty to use the default language.</param>
/// <param name="name">Explicitly provide the name of the sheet to get. Leave <see langword="null"/> to use <typeparamref name="T"/>'s sheet name. Explicit names are necessary for quest/dungeon/cutscene sheets.</param>
/// <typeparam name="T">The excel sheet type to get.</typeparam>
/// <returns>The <see cref="ExcelSheet{T}"/>, giving access to game rows.</returns>
public ExcelSheet<T>? GetExcelSheet<T>() where T : ExcelRow;
/// <remarks>
/// If the sheet type you want has subrows, use <see cref="GetSubrowExcelSheet{T}(ClientLanguage?, string?)"/> instead.
/// </remarks>
/// <exception cref="SheetNameEmptyException">Sheet name was not specified neither via <typeparamref name="T"/>'s <see cref="SheetAttribute.Name"/> nor <paramref name="name"/>.</exception>
/// <exception cref="SheetAttributeMissingException"><typeparamref name="T"/> does not have a valid <see cref="SheetAttribute"/>.</exception>
/// <exception cref="SheetNotFoundException">Sheet does not exist.</exception>
/// <exception cref="MismatchedColumnHashException">Sheet had a mismatched column hash.</exception>
/// <exception cref="UnsupportedLanguageException">Sheet does not support <paramref name="language" /> nor <see cref="Language.None"/>.</exception>
/// <exception cref="NotSupportedException">Sheet was not a <see cref="ExcelVariant.Default"/>.</exception>
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelRow<T>;
/// <summary>
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type with a specified language.
/// Get a <see cref="SubrowExcelSheet{T}"/> with the given Excel sheet row type.
/// </summary>
/// <param name="language">Language of the sheet to get.</param>
/// <param name="language">Language of the sheet to get. Leave <see langword="null"/> or empty to use the default language.</param>
/// <param name="name">Explicitly provide the name of the sheet to get. Leave <see langword="null"/> to use <typeparamref name="T"/>'s sheet name. Explicit names are necessary for quest/dungeon/cutscene sheets.</param>
/// <typeparam name="T">The excel sheet type to get.</typeparam>
/// <returns>The <see cref="ExcelSheet{T}"/>, giving access to game rows.</returns>
public ExcelSheet<T>? GetExcelSheet<T>(ClientLanguage language) where T : ExcelRow;
/// <returns>The <see cref="SubrowExcelSheet{T}"/>, giving access to game rows.</returns>
/// <remarks>
/// If the sheet type you want has only rows, use <see cref="GetExcelSheet{T}(ClientLanguage?, string?)"/> instead.
/// </remarks>
/// <exception cref="SheetNameEmptyException">Sheet name was not specified neither via <typeparamref name="T"/>'s <see cref="SheetAttribute.Name"/> nor <paramref name="name"/>.</exception>
/// <exception cref="SheetAttributeMissingException"><typeparamref name="T"/> does not have a valid <see cref="SheetAttribute"/>.</exception>
/// <exception cref="SheetNotFoundException">Sheet does not exist.</exception>
/// <exception cref="MismatchedColumnHashException">Sheet had a mismatched column hash.</exception>
/// <exception cref="UnsupportedLanguageException">Sheet does not support <paramref name="language" /> nor <see cref="Language.None"/>.</exception>
/// <exception cref="NotSupportedException">Sheet was not a <see cref="ExcelVariant.Subrows"/>.</exception>
public SubrowExcelSheet<T> GetSubrowExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelSubrow<T>;
/// <summary>
/// Get a <see cref="FileResource"/> with the given path.