v1.0.8.23: Main Menu bar; Duty List transparent background
Made-with: Cursor
This commit is contained in:
@@ -88,8 +88,17 @@ namespace HSUI.Helpers
|
||||
|
||||
private bool _dataIsValid = false;
|
||||
|
||||
/// <summary>Set when an HUD element (e.g. Main Menu) has the mouse over it this frame. World object tooltip will not show.</summary>
|
||||
private bool _mouseOverHudElement = false;
|
||||
|
||||
private const float IconSize = 24f;
|
||||
|
||||
/// <summary>Call when the mouse is over an interactive HUD element so world object tooltip is not shown.</summary>
|
||||
public void NotifyMouseOverHudElement()
|
||||
{
|
||||
_mouseOverHudElement = true;
|
||||
}
|
||||
|
||||
public void ShowTooltipOnCursor(string text, string? title = null, uint id = 0, string name = "", uint? iconId = null, TooltipIdKind idKind = TooltipIdKind.None, List<TooltipSegment>? formattedText = null)
|
||||
{
|
||||
ShowTooltip(text, ImGui.GetMousePos(), title, id, name, iconId, idKind, formattedText);
|
||||
@@ -114,7 +123,13 @@ namespace HSUI.Helpers
|
||||
_currentIconId = iconId;
|
||||
_formattedSegments = formattedText;
|
||||
|
||||
// calcualte title size
|
||||
// When showing a simple tooltip with no title (e.g. HUD), clear previous title/body so we don't mix with last frame's world tooltip
|
||||
if (title == null)
|
||||
{
|
||||
_currentTooltipTitle = null;
|
||||
}
|
||||
|
||||
// calculate title size
|
||||
_titleSize = Vector2.Zero;
|
||||
if (title != null)
|
||||
{
|
||||
@@ -199,19 +214,17 @@ namespace HSUI.Helpers
|
||||
/// </summary>
|
||||
public void ShowWorldObjectTooltip()
|
||||
{
|
||||
// Don't overwrite if an HUD element already set a tooltip this frame (e.g. Main Menu icon)
|
||||
if (_dataIsValid)
|
||||
return;
|
||||
// Don't show world tooltip when mouse is over an interactive HUD element (e.g. Main Menu bar)
|
||||
if (_mouseOverHudElement)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_worldTooltipConfig ??= ConfigurationManager.Instance.GetConfigObject<WorldObjectTooltipConfig>();
|
||||
if (_worldTooltipConfig == null || !_worldTooltipConfig.Enabled)
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Config not ready yet or not found - silently skip
|
||||
if (_config.DebugTooltips)
|
||||
Plugin.Logger.Warning($"[HSUI Tooltip] WorldObjectTooltipConfig not available: {ex.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
IGameObject? mouseOverTarget = Plugin.TargetManager.MouseOverTarget;
|
||||
if (mouseOverTarget == null)
|
||||
@@ -294,6 +307,13 @@ namespace HSUI.Helpers
|
||||
{
|
||||
ShowTooltipOnCursor(body, name, 0, "", iconId);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Config not ready yet or not found - silently skip
|
||||
if (_config.DebugTooltips)
|
||||
Plugin.Logger.Warning($"[HSUI Tooltip] WorldObjectTooltipConfig not available: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe uint? GetWorldObjectIconId(IGameObject gameObject)
|
||||
@@ -310,6 +330,7 @@ namespace HSUI.Helpers
|
||||
public void RemoveTooltip()
|
||||
{
|
||||
_dataIsValid = false;
|
||||
_mouseOverHudElement = false;
|
||||
_formattedSegments = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user