feat: add support to load textures from files

This commit is contained in:
goat 2023-08-02 18:46:44 +02:00
parent 8df9821f0e
commit 22a6261c98
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
4 changed files with 116 additions and 33 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.IO;
using Dalamud.Interface.Internal;
using Lumina.Data.Files;
@ -58,7 +59,18 @@ public interface ITextureProvider
/// <param name="path">The path to the texture in the game's VFS.</param>
/// <param name="keepAlive">Prevent Dalamud from automatically unloading this texture to save memory. Usually does not need to be set.</param>
/// <returns>Null, if the icon does not exist, or a texture wrap that can be used to render the texture.</returns>
public IDalamudTextureWrap? GetTextureFromGamePath(string path, bool keepAlive = false);
public IDalamudTextureWrap? GetTextureFromGame(string path, bool keepAlive = false);
/// <summary>
/// Get a texture handle for the image or texture, specified by the passed FileInfo.
/// You may only specify paths on the native file system.
///
/// This API can load .png and .tex files.
/// </summary>
/// <param name="file">The FileInfo describing the image or texture file.</param>
/// <param name="keepAlive">Prevent Dalamud from automatically unloading this texture to save memory. Usually does not need to be set.</param>
/// <returns>Null, if the file does not exist, or a texture wrap that can be used to render the texture.</returns>
public IDalamudTextureWrap? GetTextureFromFile(FileInfo file, bool keepAlive = false);
/// <summary>
/// Get a texture handle for the specified Lumina TexFile.