Merge 5f11afce5e
into 897d3efbd0
This commit is contained in:
commit
bdbb40fd1e
|
@ -17,6 +17,10 @@
|
|||
#include <libultraship/libultra/types.h>
|
||||
#include "soh/Enhancements/cosmetics/CosmeticsEditor.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
namespace UIWidgets {
|
||||
|
||||
// MARK: - Layout Helper
|
||||
|
@ -28,7 +32,7 @@ namespace UIWidgets {
|
|||
std::string newText(text);
|
||||
const size_t tipLength = newText.length();
|
||||
int lastSpace = -1;
|
||||
int currentLineLength = 0;
|
||||
unsigned int currentLineLength = 0;
|
||||
for (unsigned int currentCharacter = 0; currentCharacter < tipLength; currentCharacter++) {
|
||||
if (newText[currentCharacter] == '\n') {
|
||||
currentLineLength = 0;
|
||||
|
@ -56,7 +60,9 @@ namespace UIWidgets {
|
|||
void SetLastItemHoverText(const std::string& text) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("%s", WrappedText(text, 60));
|
||||
char* hoverTextWrapped = WrappedText(text, 60);
|
||||
ImGui::Text("%s", hoverTextWrapped);
|
||||
free(hoverTextWrapped);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +70,9 @@ namespace UIWidgets {
|
|||
void SetLastItemHoverText(const char* text) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("%s", WrappedText(text, 60));
|
||||
char* hoverTextWrapped = WrappedText(text, 60);
|
||||
ImGui::Text("%s", hoverTextWrapped);
|
||||
free(hoverTextWrapped);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +83,9 @@ namespace UIWidgets {
|
|||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("%s", WrappedText(text, 60));
|
||||
char* hoverTextWrapped = WrappedText(text, 60);
|
||||
ImGui::Text("%s", hoverTextWrapped);
|
||||
free(hoverTextWrapped);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +95,9 @@ namespace UIWidgets {
|
|||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("%s", WrappedText(text, 60));
|
||||
char* hoverTextWrapped = WrappedText(text, 60);
|
||||
ImGui::Text("%s", hoverTextWrapped);
|
||||
free(hoverTextWrapped);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +107,9 @@ namespace UIWidgets {
|
|||
|
||||
void Tooltip(const char* text) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("%s", WrappedText(text));
|
||||
char* tooltipWrapped = WrappedText(text);
|
||||
ImGui::SetTooltip("%s", tooltipWrapped);
|
||||
free(tooltipWrapped);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue