From 8670afe848804f7c7f0fbc2914f2f246c1b5b7be Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Sun, 4 Aug 2024 14:05:27 +0200 Subject: [PATCH] T-panel now shows with FPS-panel --- source/main/gui/GUIManager.cpp | 2 +- source/main/gui/panels/GUI_SimPerfStats.cpp | 8 +++----- source/main/gui/panels/GUI_VehicleInfoTPanel.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/main/gui/GUIManager.cpp b/source/main/gui/GUIManager.cpp index 3ad63a3f8d..d920d26123 100644 --- a/source/main/gui/GUIManager.cpp +++ b/source/main/gui/GUIManager.cpp @@ -163,7 +163,7 @@ void GUIManager::DrawSimGuiBuffered(GfxActor* player_gfx_actor) { this->DrawCommonGui(); - if (player_gfx_actor && !this->SimPerfStats.IsVisible()) + if (player_gfx_actor) { this->VehicleInfoTPanel.Draw(player_gfx_actor); } diff --git a/source/main/gui/panels/GUI_SimPerfStats.cpp b/source/main/gui/panels/GUI_SimPerfStats.cpp index 57f8cff308..b7965b6a2d 100644 --- a/source/main/gui/panels/GUI_SimPerfStats.cpp +++ b/source/main/gui/panels/GUI_SimPerfStats.cpp @@ -46,10 +46,12 @@ void SimPerfStats::Draw() const Ogre::RenderTarget::FrameStats& stats = App::GetAppContext()->GetRenderWindow()->getStatistics(); - std::string title = "FPS"; + std::string title = fmt::format("FPS: {:5.2}, Batch: {:5}, Tri: {:6}", stats.lastFPS, stats.batchCount, stats.triangleCount); ImGui::SetCursorPosX((ImGui::GetWindowSize().x - ImGui::CalcTextSize(title.c_str()).x) * 0.5f); ImGui::Text(title.c_str()); + ImGui::Separator(); + std::string a = "Current"; ImGui::SetCursorPosX((histogram_size.x + (3 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(a.c_str()).x) * 0.5f); ImGui::Text("%s", _LC("SimPerfStats", a.c_str())); @@ -77,10 +79,6 @@ void SimPerfStats::Draw() ImGui::SameLine(); ImGui::PlotHistogram("", &stats.bestFPS, 1, 0, this->Convert(stats.bestFPS).c_str(), 0.f, stats.bestFPS, histogram_size); - ImGui::Separator(); - ImGui::Text("%s%zu", _LC("SimPerfStats", "Triangle count: "), stats.triangleCount); - ImGui::Text("%s%zu", _LC("SimPerfStats", "Batch count: "), stats.batchCount); - ImGui::End(); ImGui::PopStyleColor(1); // WindowBg } diff --git a/source/main/gui/panels/GUI_VehicleInfoTPanel.cpp b/source/main/gui/panels/GUI_VehicleInfoTPanel.cpp index ca0f82625a..f77f62645c 100644 --- a/source/main/gui/panels/GUI_VehicleInfoTPanel.cpp +++ b/source/main/gui/panels/GUI_VehicleInfoTPanel.cpp @@ -88,7 +88,7 @@ void VehicleInfoTPanel::Draw(RoR::GfxActor* actorx) ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar; - ImGui::SetNextWindowPos(ImVec2(theme.screen_edge_padding.x, (theme.screen_edge_padding.y + 150))); + ImGui::SetNextWindowPos(ImVec2(theme.screen_edge_padding.x, (theme.screen_edge_padding.y + 110))); switch (m_visibility_mode) { case TPANELMODE_OPAQUE: