Skip to content

Commit

Permalink
Added tooltips (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
3HMonkey authored Nov 10, 2023
1 parent 6bbc30c commit a4498af
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CentrED/UI/Windows/MinimapWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ public override void Draw()

var cursorPosition = ImGui.GetCursorPos();

//tooltip for button what shows the key


if (ImGui.Button($"{key}", new Vector2(75, 19)))
{
CEDGame.MapManager.Position = new Point(value.X, value.Y);
}
Tooltip(key);

ImGui.SetCursorPos(cursorPosition + new Vector2(ImGui.GetItemRectSize().X, 0));


Expand Down Expand Up @@ -163,4 +168,14 @@ public override void Draw()
ImGui.Text(_coordsText);
ImGui.End();
}

public static void Tooltip(string tooltip)
{
if (ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
ImGui.Text(tooltip);
ImGui.EndTooltip();
}
}
}

0 comments on commit a4498af

Please sign in to comment.