2022-04-30 20:31:11 -05:00
|
|
|
#include "ImGuiHelpers.h"
|
2022-07-31 18:40:26 -07:00
|
|
|
#include "../../../../libultraship/libultraship/ImGuiImpl.h"
|
2022-04-30 20:31:11 -05:00
|
|
|
|
|
|
|
// Adds a text tooltip for the previous ImGui item
|
|
|
|
void SetLastItemHoverText(const std::string& text) {
|
|
|
|
if (ImGui::IsItemHovered()) {
|
|
|
|
ImGui::BeginTooltip();
|
2022-07-31 18:40:26 -07:00
|
|
|
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
|
2022-04-30 20:31:11 -05: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 18:40:26 -07:00
|
|
|
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
|
2022-04-30 20:31:11 -05:00
|
|
|
ImGui::EndTooltip();
|
|
|
|
}
|
|
|
|
}
|
2022-07-31 17:59:51 +02:00
|
|
|
|
2022-08-02 13:38:17 +02:00
|
|
|
void PaddedSeparator(bool padTop, bool padBottom, float extraVerticalPadding) {
|
|
|
|
if (padTop) {
|
|
|
|
ImGui::Dummy(ImVec2(0.0f, extraVerticalPadding));
|
2022-07-31 17:59:51 +02:00
|
|
|
}
|
|
|
|
ImGui::Separator();
|
2022-08-02 13:38:17 +02:00
|
|
|
if (padBottom) {
|
|
|
|
ImGui::Dummy(ImVec2(0.0f, extraVerticalPadding));
|
2022-07-31 17:59:51 +02:00
|
|
|
}
|
2022-07-31 18:26:18 +02:00
|
|
|
}
|