Initial release: HSUI v1.0.0.0 - HUD replacement with configurable hotbars
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Lumina.Excel;
|
||||
using static Dalamud.Plugin.Services.ITextureProvider;
|
||||
|
||||
namespace HSUI.Helpers
|
||||
{
|
||||
public class TexturesHelper
|
||||
{
|
||||
public static IDalamudTextureWrap? GetTexture<T>(uint rowId, uint stackCount = 0, bool hdIcon = true) where T : struct, IExcelRow<T>
|
||||
{
|
||||
ExcelSheet<T> sheet = Plugin.DataManager.GetExcelSheet<T>();
|
||||
return sheet == null ? null : GetTexture<T>(sheet.GetRow(rowId), stackCount, hdIcon);
|
||||
}
|
||||
|
||||
public static IDalamudTextureWrap? GetTexture<T>(dynamic row, uint stackCount = 0, bool hdIcon = true) where T : struct, IExcelRow<T>
|
||||
{
|
||||
dynamic iconId = row.Icon;
|
||||
return GetTextureFromIconId(iconId, stackCount, hdIcon);
|
||||
}
|
||||
|
||||
public static IDalamudTextureWrap? GetTextureFromIconId(uint iconId, uint stackCount = 0, bool hdIcon = true)
|
||||
{
|
||||
GameIconLookup lookup = new GameIconLookup(iconId + stackCount, false, hdIcon);
|
||||
return Plugin.TextureProvider.GetFromGameIcon(lookup).GetWrapOrDefault();
|
||||
}
|
||||
|
||||
public static IDalamudTextureWrap? GetTextureFromPath(string path)
|
||||
{
|
||||
return Plugin.TextureProvider.GetFromGame(path).GetWrapOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user