2022-04-30 21:31:11 -04:00
|
|
|
#include "ImGuiHelpers.h"
|
2022-07-31 21:40:26 -04:00
|
|
|
#include "../../../../libultraship/libultraship/ImGuiImpl.h"
|
2022-04-30 21:31:11 -04:00
|
|
|
|
|
|
|
// Adds a text tooltip for the previous ImGui item
|
|
|
|
void SetLastItemHoverText(const std::string& text) {
|
|
|
|
if (ImGui::IsItemHovered()) {
|
|
|
|
ImGui::BeginTooltip();
|
2022-07-31 21:40:26 -04:00
|
|
|
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
|
2022-04-30 21:31:11 -04:00
|
|
|
ImGui::EndTooltip();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adds a "?" next to the previous ImGui item with a custom tooltip
|
|
|
|
void InsertHelpHoverText(const std::string& text) {
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
|
|
|
if (ImGui::IsItemHovered()) {
|
|
|
|
ImGui::BeginTooltip();
|
2022-07-31 21:40:26 -04:00
|
|
|
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
|
2022-04-30 21:31:11 -04:00
|
|
|
ImGui::EndTooltip();
|
|
|
|
}
|
|
|
|
}
|