diff --git a/ActionTimelineEx/Helpers/DrawHelper.cs b/ActionTimelineEx/Helpers/DrawHelper.cs index 8ef9583..ab5c34a 100644 --- a/ActionTimelineEx/Helpers/DrawHelper.cs +++ b/ActionTimelineEx/Helpers/DrawHelper.cs @@ -1,7 +1,6 @@ using Dalamud.Interface.Textures; using Dalamud.Interface.Textures.TextureWraps; using ECommons.DalamudServices; -using ECommons.ImGuiMethods; using ImGuiNET; using Lumina.Data.Files; using System.Numerics; @@ -11,37 +10,6 @@ namespace ActionTimeline.Helpers; internal static class DrawHelper { - private static readonly Vector2 _uv1 = new (96 * 5 / 852f, 0), - _uv2 = new ((96 * 5 + 144) / 852f, 0.5f); - - private static IDalamudTextureWrap? _roundTex; - public static void Init() - { - var tex = Svc.Data.GetFile("ui/uld/icona_frame_hr1.tex"); - if (tex == null) return; - byte[] imageData = tex.ImageData; - byte[] array = new byte[imageData.Length]; - - for (int i = 0; i < imageData.Length; i += 4) - { - array[i] = array[i + 1] = array[i + 2] = byte.MaxValue; - array[i + 3] = imageData[i + 3]; - } - - _roundTex = Svc.Texture.CreateFromRaw(RawImageSpecification.Rgba32(tex!.Header.Width, tex!.Header.Height), array); - } - - public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, float size, uint lightCol) - { - if(_roundTex == null) return; - - var pixPerUnit = size / 82; - - var outPos = position - new Vector2(pixPerUnit * 31, pixPerUnit * 31); - drawList.AddImage(_roundTex.ImGuiHandle, outPos, outPos + new Vector2(pixPerUnit * 144, pixPerUnit * 154), - _uv1, _uv2, lightCol); - } - public static void DrawActionIcon(this ImDrawListPtr drawList, uint iconId, bool isHq, Vector2 position, float size) { IDalamudTextureWrap? texture = GetTextureFromIconId(iconId, isHq); diff --git a/ActionTimelineEx/Plugin.cs b/ActionTimelineEx/Plugin.cs index fcd20db..5585505 100644 --- a/ActionTimelineEx/Plugin.cs +++ b/ActionTimelineEx/Plugin.cs @@ -73,7 +73,6 @@ public Plugin(IDalamudPluginInterface pluginInterface) Svc.PluginInterface.UiBuilder.OpenMainUi += OpenConfigUi; TimelineManager.Initialize(); - DrawHelper.Init(); try { diff --git a/ActionTimelineEx/Timeline/TimelineItem.cs b/ActionTimelineEx/Timeline/TimelineItem.cs index 7731b84..e69b1a3 100644 --- a/ActionTimelineEx/Timeline/TimelineItem.cs +++ b/ActionTimelineEx/Timeline/TimelineItem.cs @@ -4,6 +4,7 @@ using Dalamud.Interface.Textures.TextureWraps; using ImGuiNET; using System.Numerics; +using XIVConfigUI; namespace ActionTimelineEx.Timeline; @@ -191,7 +192,7 @@ private void DrawItemWithCenter(ImDrawListPtr drawList, Vector2 centerPos, Vecto DamageType.CriticalDirect => ImGui.ColorConvertFloat4ToU32(setting.CriticalDirectColor), _ => 0u, }; - drawList.DrawDamage(centerPos - iconSize / 2 * setting.RealDownDirection, iconSize, lightCol); + drawList.DrawSlotHighlight(centerPos - iconSize / 2 * setting.RealDownDirection, iconSize, lightCol); } return; diff --git a/XIVConfigUI b/XIVConfigUI index 975d08e..ef640bd 160000 --- a/XIVConfigUI +++ b/XIVConfigUI @@ -1 +1 @@ -Subproject commit 975d08e576da43a03dc1dee10f583520b57ab213 +Subproject commit ef640bd493163e6e883822b0f4bb18aeaa7b2a20