mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Added hint when patterns are still loading
This commit is contained in:
@@ -245,4 +245,5 @@ namespace ImGui {
|
||||
bool DimmedIconButton(const char *symbol, ImVec4 color, ImVec2 size_arg = ImVec2(0, 0));
|
||||
bool DimmedIconToggle(const char *icon, bool *v);
|
||||
|
||||
void TextOverlay(const char *text, ImVec2 pos);
|
||||
}
|
||||
@@ -810,4 +810,17 @@ namespace ImGui {
|
||||
return toggled;
|
||||
}
|
||||
|
||||
void TextOverlay(const char *text, ImVec2 pos) {
|
||||
const auto textSize = ImGui::CalcTextSize(text);
|
||||
const auto textPos = pos - textSize / 2;
|
||||
const auto margin = ImGui::GetStyle().FramePadding * 2;
|
||||
const auto textRect = ImRect(textPos - margin, textPos + textSize + margin);
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
|
||||
drawList->AddRectFilled(textRect.Min, textRect.Max, ImGui::GetColorU32(ImGuiCol_WindowBg) | 0xFF000000);
|
||||
drawList->AddRect(textRect.Min, textRect.Max, ImGui::GetColorU32(ImGuiCol_Border));
|
||||
drawList->AddText(textPos, ImGui::GetColorU32(ImGuiCol_Text), text);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user