Combo highlight config, tooltips, nameplates, hotbars fixes
- Combo highlight: configurable color, glow, line style (solid/dashed/dotted), thickness - Tooltips: font selection, scaling slider, improved wrap/cramping handling - Nameplates: custom quest icons with config, position smoothing fix for jitter - Hotbars: hide keybinds on empty slots, combo highlight within icon bounds - HudHelper: restore default nameplates on plugin disable Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -176,6 +176,57 @@ namespace HSUI.Helpers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Draw a rect outline with optional glow and line style (solid, dashed, dotted).</summary>
|
||||
public static void DrawComboHighlightRect(ImDrawListPtr drawList, Vector2 min, Vector2 max, uint color, float thickness, bool showGlow, int lineStyle)
|
||||
{
|
||||
const float inset = 2f;
|
||||
Vector2 innerMin = min + new Vector2(inset, inset);
|
||||
Vector2 innerMax = max - new Vector2(inset, inset);
|
||||
if (innerMax.X <= innerMin.X || innerMax.Y <= innerMin.Y) return;
|
||||
|
||||
if (showGlow)
|
||||
{
|
||||
for (int g = 5; g >= 1; g--)
|
||||
{
|
||||
float o = g;
|
||||
uint alpha = (uint)(byte)(70 * (6 - g)) << 24;
|
||||
drawList.AddRect(innerMin - new Vector2(o, o), innerMax + new Vector2(o, o),
|
||||
alpha | (color & 0x00FFFFFF), 0, ImDrawFlags.None, 2f);
|
||||
}
|
||||
}
|
||||
|
||||
if (lineStyle == 0) // Solid
|
||||
{
|
||||
drawList.AddRect(innerMin, innerMax, color, 0, ImDrawFlags.None, thickness);
|
||||
return;
|
||||
}
|
||||
|
||||
// Dashed or Dotted: draw each side as segments
|
||||
float dashLen = lineStyle == 1 ? 4f : 2f;
|
||||
float gapLen = lineStyle == 1 ? 3f : 3f;
|
||||
float step = dashLen + gapLen;
|
||||
|
||||
void DrawSegmentedLine(Vector2 a, Vector2 b)
|
||||
{
|
||||
Vector2 d = b - a;
|
||||
float len = d.Length();
|
||||
if (len < 0.001f) return;
|
||||
Vector2 u = d / len;
|
||||
float t = 0;
|
||||
while (t < len)
|
||||
{
|
||||
float tEnd = Math.Min(t + dashLen, len);
|
||||
drawList.AddLine(a + u * t, a + u * tEnd, color, thickness);
|
||||
t += step;
|
||||
}
|
||||
}
|
||||
|
||||
DrawSegmentedLine(innerMin, new Vector2(innerMax.X, innerMin.Y)); // top
|
||||
DrawSegmentedLine(new Vector2(innerMax.X, innerMin.Y), innerMax); // right
|
||||
DrawSegmentedLine(innerMax, new Vector2(innerMin.X, innerMax.Y)); // bottom
|
||||
DrawSegmentedLine(new Vector2(innerMin.X, innerMax.Y), innerMin); // left
|
||||
}
|
||||
|
||||
public static void DrawIcon(uint iconId, Vector2 position, Vector2 size, bool drawBorder, uint color, ImDrawListPtr drawList)
|
||||
{
|
||||
IDalamudTextureWrap? texture = TexturesHelper.GetTextureFromIconId(iconId);
|
||||
|
||||
Reference in New Issue
Block a user