Skip to content

Commit

Permalink
T-panel now shows with FPS-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Aug 4, 2024
1 parent 02a6cbc commit 8670afe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/main/gui/GUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 3 additions & 5 deletions source/main/gui/panels/GUI_SimPerfStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion source/main/gui/panels/GUI_VehicleInfoTPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8670afe

Please sign in to comment.