From a5b758f1f4750821c2e38a2394a88abab14a5799 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 26 Sep 2023 17:21:07 -0400 Subject: [PATCH] armoury: Add loading label to make it clearer --- armoury/src/gearview.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/armoury/src/gearview.cpp b/armoury/src/gearview.cpp index 61f1a09..4176c08 100644 --- a/armoury/src/gearview.cpp +++ b/armoury/src/gearview.cpp @@ -22,7 +22,19 @@ GearView::GearView(GameData* data, FileCache& cache) : data(data), cache(cache) setLayout(layout); mdlPart->requestUpdate = [this] { - ImGui::Text("Hello, world!"); + auto &io = ImGui::GetIO(); + if (updating) { + if (ImGui::Begin("Loading", nullptr, ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoInputs)) { + ImGui::SetWindowPos(ImVec2(0, 0)); + ImGui::SetWindowSize(io.DisplaySize); + + const char *loadingLabel{"Loading gear..."}; + ImGui::SetCursorPosX((io.DisplaySize.x - ImGui::CalcTextSize(loadingLabel).x) * 0.5f); + ImGui::SetCursorPosY((io.DisplaySize.y - ImGui::CalcTextSize(loadingLabel).y) * 0.5f); + ImGui::Text("%s", loadingLabel); + } + ImGui::End(); + } if (updating) { return;