mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Add IDataManager (#1292)
This commit is contained in:
parent
b216b6d80a
commit
40aa70d05f
2 changed files with 215 additions and 127 deletions
|
|
@ -8,6 +8,7 @@ using System.Threading;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.IoC;
|
using Dalamud.IoC;
|
||||||
using Dalamud.IoC.Internal;
|
using Dalamud.IoC.Internal;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Dalamud.Utility.Timing;
|
using Dalamud.Utility.Timing;
|
||||||
using ImGuiScene;
|
using ImGuiScene;
|
||||||
|
|
@ -27,7 +28,10 @@ namespace Dalamud.Data;
|
||||||
[PluginInterface]
|
[PluginInterface]
|
||||||
[InterfaceVersion("1.0")]
|
[InterfaceVersion("1.0")]
|
||||||
[ServiceManager.BlockingEarlyLoadedService]
|
[ServiceManager.BlockingEarlyLoadedService]
|
||||||
public sealed class DataManager : IDisposable, IServiceType
|
#pragma warning disable SA1015
|
||||||
|
[ResolveVia<IDataManager>]
|
||||||
|
#pragma warning restore SA1015
|
||||||
|
public sealed class DataManager : IDisposable, IServiceType, IDataManager
|
||||||
{
|
{
|
||||||
private const string IconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}.tex";
|
private const string IconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}.tex";
|
||||||
private const string HighResolutionIconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}_hr1.tex";
|
private const string HighResolutionIconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}_hr1.tex";
|
||||||
|
|
@ -127,75 +131,43 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets the current game client language.
|
|
||||||
/// </summary>
|
|
||||||
public ClientLanguage Language { get; private set; }
|
public ClientLanguage Language { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets the OpCodes sent by the server to the client.
|
|
||||||
/// </summary>
|
|
||||||
public ReadOnlyDictionary<string, ushort> ServerOpCodes { get; private set; }
|
public ReadOnlyDictionary<string, ushort> ServerOpCodes { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets the OpCodes sent by the client to the server.
|
|
||||||
/// </summary>
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public ReadOnlyDictionary<string, ushort> ClientOpCodes { get; private set; }
|
public ReadOnlyDictionary<string, ushort> ClientOpCodes { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets a <see cref="Lumina"/> object which gives access to any excel/game data.
|
|
||||||
/// </summary>
|
|
||||||
public GameData GameData { get; private set; }
|
public GameData GameData { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets an <see cref="ExcelModule"/> object which gives access to any of the game's sheet data.
|
|
||||||
/// </summary>
|
|
||||||
public ExcelModule Excel => this.GameData.Excel;
|
public ExcelModule Excel => this.GameData.Excel;
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets a value indicating whether Game Data is ready to be read.
|
|
||||||
/// </summary>
|
|
||||||
public bool IsDataReady { get; private set; }
|
public bool IsDataReady { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Gets a value indicating whether the game data files have been modified by another third-party tool.
|
|
||||||
/// </summary>
|
|
||||||
public bool HasModifiedGameDataFiles { get; private set; }
|
public bool HasModifiedGameDataFiles { get; private set; }
|
||||||
|
|
||||||
#region Lumina Wrappers
|
#region Lumina Wrappers
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type.
|
|
||||||
/// </summary>
|
|
||||||
/// <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
|
public ExcelSheet<T>? GetExcelSheet<T>() where T : ExcelRow
|
||||||
=> this.Excel.GetSheet<T>();
|
=> this.Excel.GetSheet<T>();
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type with a specified language.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language">Language of the sheet to get.</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
|
public ExcelSheet<T>? GetExcelSheet<T>(ClientLanguage language) where T : ExcelRow
|
||||||
=> this.Excel.GetSheet<T>(language.ToLumina());
|
=> this.Excel.GetSheet<T>(language.ToLumina());
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="FileResource"/> with the given path.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path inside of the game files.</param>
|
|
||||||
/// <returns>The <see cref="FileResource"/> of the file.</returns>
|
|
||||||
public FileResource? GetFile(string path)
|
public FileResource? GetFile(string path)
|
||||||
=> this.GetFile<FileResource>(path);
|
=> this.GetFile<FileResource>(path);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="FileResource"/> with the given path, of the given type.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T">The type of resource.</typeparam>
|
|
||||||
/// <param name="path">The path inside of the game files.</param>
|
|
||||||
/// <returns>The <see cref="FileResource"/> of the file.</returns>
|
|
||||||
public T? GetFile<T>(string path) where T : FileResource
|
public T? GetFile<T>(string path) where T : FileResource
|
||||||
{
|
{
|
||||||
var filePath = GameData.ParseFilePath(path);
|
var filePath = GameData.ParseFilePath(path);
|
||||||
|
|
@ -204,11 +176,7 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
return this.GameData.Repositories.TryGetValue(filePath.Repository, out var repository) ? repository.GetFile<T>(filePath.Category, filePath) : default;
|
return this.GameData.Repositories.TryGetValue(filePath.Repository, out var repository) ? repository.GetFile<T>(filePath.Category, filePath) : default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Check if the file with the given path exists within the game's index files.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path inside of the game files.</param>
|
|
||||||
/// <returns>True if the file exists.</returns>
|
|
||||||
public bool FileExists(string path)
|
public bool FileExists(string path)
|
||||||
=> this.GameData.FileExists(path);
|
=> this.GameData.FileExists(path);
|
||||||
|
|
||||||
|
|
@ -217,25 +185,15 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="iconId">The icon ID.</param>
|
/// <param name="iconId">The icon ID.</param>
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
/// todo: remove in api9 in favor of GetIcon(uint iconId, bool highResolution)
|
/// TODO(v9): remove in api9 in favor of GetIcon(uint iconId, bool highResolution)
|
||||||
public TexFile? GetIcon(uint iconId)
|
public TexFile? GetIcon(uint iconId)
|
||||||
=> this.GetIcon(this.Language, iconId, false);
|
=> this.GetIcon(this.Language, iconId, false);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TexFile"/> containing the icon with the given ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <param name="highResolution">Return high resolution version.</param>
|
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
|
||||||
public TexFile? GetIcon(uint iconId, bool highResolution)
|
public TexFile? GetIcon(uint iconId, bool highResolution)
|
||||||
=> this.GetIcon(this.Language, iconId, highResolution);
|
=> this.GetIcon(this.Language, iconId, highResolution);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given quality.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isHq">A value indicating whether the icon should be HQ.</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
|
||||||
public TexFile? GetIcon(bool isHq, uint iconId)
|
public TexFile? GetIcon(bool isHq, uint iconId)
|
||||||
{
|
{
|
||||||
var type = isHq ? "hq/" : string.Empty;
|
var type = isHq ? "hq/" : string.Empty;
|
||||||
|
|
@ -248,17 +206,11 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
/// <param name="iconLanguage">The requested language.</param>
|
/// <param name="iconLanguage">The requested language.</param>
|
||||||
/// <param name="iconId">The icon ID.</param>
|
/// <param name="iconId">The icon ID.</param>
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
/// todo: remove in api9 in favor of GetIcon(ClientLanguage iconLanguage, uint iconId, bool highResolution)
|
/// TODO(v9): remove in api9 in favor of GetIcon(ClientLanguage iconLanguage, uint iconId, bool highResolution)
|
||||||
public TexFile? GetIcon(ClientLanguage iconLanguage, uint iconId)
|
public TexFile? GetIcon(ClientLanguage iconLanguage, uint iconId)
|
||||||
=> this.GetIcon(iconLanguage, iconId, false);
|
=> this.GetIcon(iconLanguage, iconId, false);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given language.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconLanguage">The requested language.</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <param name="highResolution">Return high resolution version.</param>
|
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
|
||||||
public TexFile? GetIcon(ClientLanguage iconLanguage, uint iconId, bool highResolution)
|
public TexFile? GetIcon(ClientLanguage iconLanguage, uint iconId, bool highResolution)
|
||||||
{
|
{
|
||||||
var type = iconLanguage switch
|
var type = iconLanguage switch
|
||||||
|
|
@ -279,17 +231,11 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
||||||
/// <param name="iconId">The icon ID.</param>
|
/// <param name="iconId">The icon ID.</param>
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
/// todo: remove in api9 in favor of GetIcon(string? type, uint iconId, bool highResolution)
|
/// TODO(v9): remove in api9 in favor of GetIcon(string? type, uint iconId, bool highResolution)
|
||||||
public TexFile? GetIcon(string? type, uint iconId)
|
public TexFile? GetIcon(string? type, uint iconId)
|
||||||
=> this.GetIcon(type, iconId, false);
|
=> this.GetIcon(type, iconId, false);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given type.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <param name="highResolution">Return high resolution version.</param>
|
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
|
||||||
public TexFile? GetIcon(string? type, uint iconId, bool highResolution)
|
public TexFile? GetIcon(string? type, uint iconId, bool highResolution)
|
||||||
{
|
{
|
||||||
var format = highResolution ? HighResolutionIconFileFormat : IconFileFormat;
|
var format = highResolution ? HighResolutionIconFileFormat : IconFileFormat;
|
||||||
|
|
@ -310,27 +256,15 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TexFile"/> containing the HQ icon with the given ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
|
||||||
public TexFile? GetHqIcon(uint iconId)
|
public TexFile? GetHqIcon(uint iconId)
|
||||||
=> this.GetIcon(true, iconId);
|
=> this.GetIcon(true, iconId);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get the passed <see cref="TexFile"/> as a drawable ImGui TextureWrap.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tex">The Lumina <see cref="TexFile"/>.</param>
|
|
||||||
/// <returns>A <see cref="TextureWrap"/> that can be used to draw the texture.</returns>
|
|
||||||
public TextureWrap? GetImGuiTexture(TexFile? tex)
|
public TextureWrap? GetImGuiTexture(TexFile? tex)
|
||||||
=> tex == null ? null : Service<InterfaceManager>.Get().LoadImageRaw(tex.GetRgbaImageData(), tex.Header.Width, tex.Header.Height, 4);
|
=> tex == null ? null : Service<InterfaceManager>.Get().LoadImageRaw(tex.GetRgbaImageData(), tex.Header.Width, tex.Header.Height, 4);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get the passed texture path as a drawable ImGui TextureWrap.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The internal path to the texture.</param>
|
|
||||||
/// <returns>A <see cref="TextureWrap"/> that can be used to draw the texture.</returns>
|
|
||||||
public TextureWrap? GetImGuiTexture(string path)
|
public TextureWrap? GetImGuiTexture(string path)
|
||||||
=> this.GetImGuiTexture(this.GetFile<TexFile>(path));
|
=> this.GetImGuiTexture(this.GetFile<TexFile>(path));
|
||||||
|
|
||||||
|
|
@ -339,59 +273,33 @@ public sealed class DataManager : IDisposable, IServiceType
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="iconId">The icon ID.</param>
|
/// <param name="iconId">The icon ID.</param>
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
/// todo: remove in api9 in favor of GetImGuiTextureIcon(uint iconId, bool highResolution)
|
/// TODO(v9): remove in api9 in favor of GetImGuiTextureIcon(uint iconId, bool highResolution)
|
||||||
public TextureWrap? GetImGuiTextureIcon(uint iconId)
|
public TextureWrap? GetImGuiTextureIcon(uint iconId)
|
||||||
=> this.GetImGuiTexture(this.GetIcon(iconId, false));
|
=> this.GetImGuiTexture(this.GetIcon(iconId, false));
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <param name="highResolution">Return the high resolution version.</param>
|
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
|
||||||
public TextureWrap? GetImGuiTextureIcon(uint iconId, bool highResolution)
|
public TextureWrap? GetImGuiTextureIcon(uint iconId, bool highResolution)
|
||||||
=> this.GetImGuiTexture(this.GetIcon(iconId, highResolution));
|
=> this.GetImGuiTexture(this.GetIcon(iconId, highResolution));
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given quality.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isHq">A value indicating whether the icon should be HQ.</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
|
||||||
public TextureWrap? GetImGuiTextureIcon(bool isHq, uint iconId)
|
public TextureWrap? GetImGuiTextureIcon(bool isHq, uint iconId)
|
||||||
=> this.GetImGuiTexture(this.GetIcon(isHq, iconId));
|
=> this.GetImGuiTexture(this.GetIcon(isHq, iconId));
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given language.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconLanguage">The requested language.</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
|
||||||
public TextureWrap? GetImGuiTextureIcon(ClientLanguage iconLanguage, uint iconId)
|
public TextureWrap? GetImGuiTextureIcon(ClientLanguage iconLanguage, uint iconId)
|
||||||
=> this.GetImGuiTexture(this.GetIcon(iconLanguage, iconId));
|
=> this.GetImGuiTexture(this.GetIcon(iconLanguage, iconId));
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given type.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
|
||||||
public TextureWrap? GetImGuiTextureIcon(string type, uint iconId)
|
public TextureWrap? GetImGuiTextureIcon(string type, uint iconId)
|
||||||
=> this.GetImGuiTexture(this.GetIcon(type, iconId));
|
=> this.GetImGuiTexture(this.GetIcon(type, iconId));
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Get a <see cref="TextureWrap"/> containing the HQ icon with the given ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="iconId">The icon ID.</param>
|
|
||||||
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
|
||||||
public TextureWrap? GetImGuiTextureHqIcon(uint iconId)
|
public TextureWrap? GetImGuiTextureHqIcon(uint iconId)
|
||||||
=> this.GetImGuiTexture(this.GetHqIcon(iconId));
|
=> this.GetImGuiTexture(this.GetHqIcon(iconId));
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc/>
|
||||||
/// Dispose this DataManager.
|
|
||||||
/// </summary>
|
|
||||||
void IDisposable.Dispose()
|
void IDisposable.Dispose()
|
||||||
{
|
{
|
||||||
this.luminaCancellationTokenSource.Cancel();
|
this.luminaCancellationTokenSource.Cancel();
|
||||||
|
|
|
||||||
180
Dalamud/Plugin/Services/IDataManager.cs
Normal file
180
Dalamud/Plugin/Services/IDataManager.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using ImGuiScene;
|
||||||
|
using Lumina;
|
||||||
|
using Lumina.Data;
|
||||||
|
using Lumina.Data.Files;
|
||||||
|
using Lumina.Excel;
|
||||||
|
|
||||||
|
namespace Dalamud.Plugin.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This class provides data for Dalamud-internal features, but can also be used by plugins if needed.
|
||||||
|
/// </summary>
|
||||||
|
public interface IDataManager
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current game client language.
|
||||||
|
/// </summary>
|
||||||
|
public ClientLanguage Language { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the OpCodes sent by the server to the client.
|
||||||
|
/// </summary>
|
||||||
|
public ReadOnlyDictionary<string, ushort> ServerOpCodes { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the OpCodes sent by the client to the server.
|
||||||
|
/// </summary>
|
||||||
|
public ReadOnlyDictionary<string, ushort> ClientOpCodes { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a <see cref="Lumina"/> object which gives access to any excel/game data.
|
||||||
|
/// </summary>
|
||||||
|
public GameData GameData { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an <see cref="ExcelModule"/> object which gives access to any of the game's sheet data.
|
||||||
|
/// </summary>
|
||||||
|
public ExcelModule Excel { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether Game Data is ready to be read.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDataReady { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the game data files have been modified by another third-party tool.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasModifiedGameDataFiles { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type.
|
||||||
|
/// </summary>
|
||||||
|
/// <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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type with a specified language.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="language">Language of the sheet to get.</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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="FileResource"/> with the given path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The path inside of the game files.</param>
|
||||||
|
/// <returns>The <see cref="FileResource"/> of the file.</returns>
|
||||||
|
public FileResource? GetFile(string path);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="FileResource"/> with the given path, of the given type.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The type of resource.</typeparam>
|
||||||
|
/// <param name="path">The path inside of the game files.</param>
|
||||||
|
/// <returns>The <see cref="FileResource"/> of the file.</returns>
|
||||||
|
public T? GetFile<T>(string path) where T : FileResource;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the file with the given path exists within the game's index files.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The path inside of the game files.</param>
|
||||||
|
/// <returns>True if the file exists.</returns>
|
||||||
|
public bool FileExists(string path);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TexFile"/> containing the icon with the given ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <param name="highResolution">Return high resolution version.</param>
|
||||||
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
|
public TexFile? GetIcon(uint iconId, bool highResolution = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given language.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconLanguage">The requested language.</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <param name="highResolution">Return high resolution version.</param>
|
||||||
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
|
public TexFile? GetIcon(ClientLanguage iconLanguage, uint iconId, bool highResolution = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <param name="highResolution">Return high resolution version.</param>
|
||||||
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
|
public TexFile? GetIcon(string? type, uint iconId, bool highResolution = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <param name="highResolution">Return the high resolution version.</param>
|
||||||
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
|
public TextureWrap? GetImGuiTextureIcon(uint iconId, bool highResolution = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TexFile"/> containing the icon with the given ID, of the given quality.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isHq">A value indicating whether the icon should be HQ.</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
|
public TexFile? GetIcon(bool isHq, uint iconId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TexFile"/> containing the HQ icon with the given ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||||
|
public TexFile? GetHqIcon(uint iconId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the passed <see cref="TexFile"/> as a drawable ImGui TextureWrap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tex">The Lumina <see cref="TexFile"/>.</param>
|
||||||
|
/// <returns>A <see cref="TextureWrap"/> that can be used to draw the texture.</returns>
|
||||||
|
public TextureWrap? GetImGuiTexture(TexFile? tex);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the passed texture path as a drawable ImGui TextureWrap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The internal path to the texture.</param>
|
||||||
|
/// <returns>A <see cref="TextureWrap"/> that can be used to draw the texture.</returns>
|
||||||
|
public TextureWrap? GetImGuiTexture(string path);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given quality.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isHq">A value indicating whether the icon should be HQ.</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
|
public TextureWrap? GetImGuiTextureIcon(bool isHq, uint iconId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given language.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconLanguage">The requested language.</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
|
public TextureWrap? GetImGuiTextureIcon(ClientLanguage iconLanguage, uint iconId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TextureWrap"/> containing the icon with the given ID, of the given type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">The type of the icon (e.g. 'hq' to get the HQ variant of an item icon).</param>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
|
public TextureWrap? GetImGuiTextureIcon(string type, uint iconId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="TextureWrap"/> containing the HQ icon with the given ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="iconId">The icon ID.</param>
|
||||||
|
/// <returns>The <see cref="TextureWrap"/> containing the icon.</returns>
|
||||||
|
public TextureWrap? GetImGuiTextureHqIcon(uint iconId);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue