mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-14 11:57:42 +01:00
refactor: update custom imgui component setup
This commit is contained in:
parent
2a585e8d5d
commit
1c66c2a3de
9 changed files with 141 additions and 206 deletions
28
Dalamud/Interface/Components/ImGuiComponents.HelpMarker.cs
Normal file
28
Dalamud/Interface/Components/ImGuiComponents.HelpMarker.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Class containing various methods providing ImGui components.
|
||||
/// </summary>
|
||||
public static partial class ImGuiComponents
|
||||
{
|
||||
/// <summary>
|
||||
/// HelpMarker component to add a help icon with text on hover.
|
||||
/// </summary>
|
||||
/// <param name="helpText">The text to display on hover.</param>
|
||||
public static void HelpMarker(string helpText)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.PushFont(UiBuilder.IconFont);
|
||||
ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString());
|
||||
ImGui.PopFont();
|
||||
if (!ImGui.IsItemHovered()) return;
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.PushTextWrapPos(ImGui.GetFontSize() * 35.0f);
|
||||
ImGui.TextUnformatted(helpText);
|
||||
ImGui.PopTextWrapPos();
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue