refactor: update custom imgui component setup

This commit is contained in:
kalilistic 2021-04-09 23:29:08 -04:00
parent 2a585e8d5d
commit 1c66c2a3de
9 changed files with 141 additions and 206 deletions

View 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();
}
}
}