diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 148bd78593..a39b5a3520 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -35,6 +35,7 @@ const Info GFX_SHOW_SPEED{{System::GFX, "Settings", "ShowSpeed"}, false}; const Info GFX_SHOW_SPEED_COLORS{{System::GFX, "Settings", "ShowSpeedColors"}, true}; const Info GFX_PERF_SAMP_WINDOW{{System::GFX, "Settings", "PerfSampWindowMS"}, 1000}; const Info GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false}; +const Info GFX_SHOW_MP_TURN{{System::GFX, "Settings", "ShowMPTurn"}, true}; const Info GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, false}; const Info GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"}, false}; diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index c1f301a4a9..a73787be10 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -38,6 +38,7 @@ extern const Info GFX_SHOW_SPEED; extern const Info GFX_SHOW_SPEED_COLORS; extern const Info GFX_PERF_SAMP_WINDOW; extern const Info GFX_SHOW_NETPLAY_PING; +extern const Info GFX_SHOW_MP_TURN; extern const Info GFX_SHOW_NETPLAY_MESSAGES; extern const Info GFX_LOG_RENDER_TIME_TO_FILE; extern const Info GFX_OVERLAY_STATS; diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index 27a2c16e56..b9908b10d3 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -88,6 +88,7 @@ void GeneralWidget::CreateWidgets() auto* m_options_layout = new QGridLayout(); m_show_ping = new GraphicsBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING); + m_show_turn_count = new GraphicsBool(tr("Show MP Turn"), Config::GFX_SHOW_MP_TURN); m_autoadjust_window_size = new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE); m_show_messages = @@ -101,6 +102,7 @@ void GeneralWidget::CreateWidgets() m_options_layout->addWidget(m_show_messages, 0, 1); m_options_layout->addWidget(m_show_ping, 1, 1); + m_options_layout->addWidget(m_show_turn_count, 2, 0); // Other auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation")); diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h index 7b8fa2622e..02eabf4dc8 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h @@ -50,6 +50,7 @@ private: // Options GraphicsBool* m_show_ping; + GraphicsBool* m_show_turn_count; GraphicsBool* m_autoadjust_window_size; GraphicsBool* m_show_messages; GraphicsBool* m_render_main_window; diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index a3d41c9872..53a43d3c6b 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -12,6 +12,7 @@ #include "Core/HW/VideoInterface.h" #include "Core/System.h" #include "VideoCommon/VideoConfig.h" +#include "Core/MarioPartyNetplay/Gamestate.h" PerformanceMetrics g_perf_metrics; @@ -93,7 +94,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) const double speed = GetSpeed(); // Change Color based on % Speed - float r = 0.0f, g = 1.0f, b = 1.0f; + float r = 1.0f, g = 0.55f, b = 0.00f; + if (g_ActiveConfig.bShowSpeedColors) { r = 1.0 - (speed - 0.8) / 0.2; @@ -105,7 +107,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) const float window_width = 93.f * backbuffer_scale; float window_y = window_padding; float window_x = ImGui::GetIO().DisplaySize.x - window_padding; - + float window_x_turn = 100.0f; + float window_y_turn = 8.0f; const float graph_width = 50.f * backbuffer_scale + 3.f * window_width + 2.f * window_padding; const float graph_height = std::min(200.f * backbuffer_scale, ImGui::GetIO().DisplaySize.y - 85.f * backbuffer_scale); @@ -239,6 +242,26 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) } } + if (g_ActiveConfig.bShowMPTurn && CurrentState.IsMarioParty && CurrentState.Board && CurrentState.Boards) + { + float window_height = (30.f) * backbuffer_scale; + + // Position in the top-left corner of the screen. + ImGui::SetNextWindowPos(ImVec2(window_x_turn, window_y_turn), ImGuiCond_Always, + ImVec2(1.0f, 0.0f)); + ImGui::SetNextWindowSize(ImVec2(window_width, window_height)); + ImGui::SetNextWindowBgAlpha(bg_alpha); + + if (ImGui::Begin("MPStats", nullptr, imgui_flags)) + { + if (g_ActiveConfig.bShowMPTurn && CurrentState.IsMarioParty && CurrentState.Board && CurrentState.Boards) + ImGui::TextColored(ImVec4(r, g, b, 1.0f), "Turn: %d/%d", + mpn_read_value(CurrentState.Addresses->CurrentTurn, 1), + mpn_read_value(CurrentState.Addresses->TotalTurns, 1)); + ImGui::End(); + } + } + if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes) { int count = g_ActiveConfig.bShowVPS + 2 * g_ActiveConfig.bShowVTimes; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 38ee680bf3..9b6cd83a74 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -88,6 +88,7 @@ void VideoConfig::Refresh() bShowSpeedColors = Config::Get(Config::GFX_SHOW_SPEED_COLORS); iPerfSampleUSec = Config::Get(Config::GFX_PERF_SAMP_WINDOW) * 1000; bShowNetPlayPing = Config::Get(Config::GFX_SHOW_NETPLAY_PING); + bShowMPTurn = Config::Get(Config::GFX_SHOW_MP_TURN); bShowNetPlayMessages = Config::Get(Config::GFX_SHOW_NETPLAY_MESSAGES); bLogRenderTimeToFile = Config::Get(Config::GFX_LOG_RENDER_TIME_TO_FILE); bOverlayStats = Config::Get(Config::GFX_OVERLAY_STATS); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index a479276e6c..f8c9b2ceef 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -112,6 +112,7 @@ struct VideoConfig final bool bShowSpeedColors = false; int iPerfSampleUSec = 0; bool bShowNetPlayPing = false; + bool bShowMPTurn = true; bool bShowNetPlayMessages = false; bool bOverlayStats = false; bool bOverlayProjStats = false;