mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-10-03 06:38:53 +00:00
Source: MP Turn Counter
This commit is contained in:
parent
59a3ef26ce
commit
53905e689d
7 changed files with 32 additions and 2 deletions
|
@ -35,6 +35,7 @@ const Info<bool> GFX_SHOW_SPEED{{System::GFX, "Settings", "ShowSpeed"}, false};
|
||||||
const Info<bool> GFX_SHOW_SPEED_COLORS{{System::GFX, "Settings", "ShowSpeedColors"}, true};
|
const Info<bool> GFX_SHOW_SPEED_COLORS{{System::GFX, "Settings", "ShowSpeedColors"}, true};
|
||||||
const Info<int> GFX_PERF_SAMP_WINDOW{{System::GFX, "Settings", "PerfSampWindowMS"}, 1000};
|
const Info<int> GFX_PERF_SAMP_WINDOW{{System::GFX, "Settings", "PerfSampWindowMS"}, 1000};
|
||||||
const Info<bool> GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false};
|
const Info<bool> GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false};
|
||||||
|
const Info<bool> GFX_SHOW_MP_TURN{{System::GFX, "Settings", "ShowMPTurn"}, true};
|
||||||
const Info<bool> GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, false};
|
const Info<bool> GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, false};
|
||||||
const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"},
|
const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"},
|
||||||
false};
|
false};
|
||||||
|
|
|
@ -38,6 +38,7 @@ extern const Info<bool> GFX_SHOW_SPEED;
|
||||||
extern const Info<bool> GFX_SHOW_SPEED_COLORS;
|
extern const Info<bool> GFX_SHOW_SPEED_COLORS;
|
||||||
extern const Info<int> GFX_PERF_SAMP_WINDOW;
|
extern const Info<int> GFX_PERF_SAMP_WINDOW;
|
||||||
extern const Info<bool> GFX_SHOW_NETPLAY_PING;
|
extern const Info<bool> GFX_SHOW_NETPLAY_PING;
|
||||||
|
extern const Info<bool> GFX_SHOW_MP_TURN;
|
||||||
extern const Info<bool> GFX_SHOW_NETPLAY_MESSAGES;
|
extern const Info<bool> GFX_SHOW_NETPLAY_MESSAGES;
|
||||||
extern const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE;
|
extern const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE;
|
||||||
extern const Info<bool> GFX_OVERLAY_STATS;
|
extern const Info<bool> GFX_OVERLAY_STATS;
|
||||||
|
|
|
@ -88,6 +88,7 @@ void GeneralWidget::CreateWidgets()
|
||||||
auto* m_options_layout = new QGridLayout();
|
auto* m_options_layout = new QGridLayout();
|
||||||
|
|
||||||
m_show_ping = new GraphicsBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
|
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 =
|
m_autoadjust_window_size =
|
||||||
new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
|
new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
|
||||||
m_show_messages =
|
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_messages, 0, 1);
|
||||||
m_options_layout->addWidget(m_show_ping, 1, 1);
|
m_options_layout->addWidget(m_show_ping, 1, 1);
|
||||||
|
m_options_layout->addWidget(m_show_turn_count, 2, 0);
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation"));
|
auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation"));
|
||||||
|
|
|
@ -50,6 +50,7 @@ private:
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
GraphicsBool* m_show_ping;
|
GraphicsBool* m_show_ping;
|
||||||
|
GraphicsBool* m_show_turn_count;
|
||||||
GraphicsBool* m_autoadjust_window_size;
|
GraphicsBool* m_autoadjust_window_size;
|
||||||
GraphicsBool* m_show_messages;
|
GraphicsBool* m_show_messages;
|
||||||
GraphicsBool* m_render_main_window;
|
GraphicsBool* m_render_main_window;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Core/HW/VideoInterface.h"
|
#include "Core/HW/VideoInterface.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
|
#include "Core/MarioPartyNetplay/Gamestate.h"
|
||||||
|
|
||||||
PerformanceMetrics g_perf_metrics;
|
PerformanceMetrics g_perf_metrics;
|
||||||
|
|
||||||
|
@ -93,7 +94,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
const double speed = GetSpeed();
|
const double speed = GetSpeed();
|
||||||
|
|
||||||
// Change Color based on % Speed
|
// 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)
|
if (g_ActiveConfig.bShowSpeedColors)
|
||||||
{
|
{
|
||||||
r = 1.0 - (speed - 0.8) / 0.2;
|
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;
|
const float window_width = 93.f * backbuffer_scale;
|
||||||
float window_y = window_padding;
|
float window_y = window_padding;
|
||||||
float window_x = ImGui::GetIO().DisplaySize.x - 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_width = 50.f * backbuffer_scale + 3.f * window_width + 2.f * window_padding;
|
||||||
const float graph_height =
|
const float graph_height =
|
||||||
std::min(200.f * backbuffer_scale, ImGui::GetIO().DisplaySize.y - 85.f * backbuffer_scale);
|
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)
|
if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes)
|
||||||
{
|
{
|
||||||
int count = g_ActiveConfig.bShowVPS + 2 * g_ActiveConfig.bShowVTimes;
|
int count = g_ActiveConfig.bShowVPS + 2 * g_ActiveConfig.bShowVTimes;
|
||||||
|
|
|
@ -88,6 +88,7 @@ void VideoConfig::Refresh()
|
||||||
bShowSpeedColors = Config::Get(Config::GFX_SHOW_SPEED_COLORS);
|
bShowSpeedColors = Config::Get(Config::GFX_SHOW_SPEED_COLORS);
|
||||||
iPerfSampleUSec = Config::Get(Config::GFX_PERF_SAMP_WINDOW) * 1000;
|
iPerfSampleUSec = Config::Get(Config::GFX_PERF_SAMP_WINDOW) * 1000;
|
||||||
bShowNetPlayPing = Config::Get(Config::GFX_SHOW_NETPLAY_PING);
|
bShowNetPlayPing = Config::Get(Config::GFX_SHOW_NETPLAY_PING);
|
||||||
|
bShowMPTurn = Config::Get(Config::GFX_SHOW_MP_TURN);
|
||||||
bShowNetPlayMessages = Config::Get(Config::GFX_SHOW_NETPLAY_MESSAGES);
|
bShowNetPlayMessages = Config::Get(Config::GFX_SHOW_NETPLAY_MESSAGES);
|
||||||
bLogRenderTimeToFile = Config::Get(Config::GFX_LOG_RENDER_TIME_TO_FILE);
|
bLogRenderTimeToFile = Config::Get(Config::GFX_LOG_RENDER_TIME_TO_FILE);
|
||||||
bOverlayStats = Config::Get(Config::GFX_OVERLAY_STATS);
|
bOverlayStats = Config::Get(Config::GFX_OVERLAY_STATS);
|
||||||
|
|
|
@ -112,6 +112,7 @@ struct VideoConfig final
|
||||||
bool bShowSpeedColors = false;
|
bool bShowSpeedColors = false;
|
||||||
int iPerfSampleUSec = 0;
|
int iPerfSampleUSec = 0;
|
||||||
bool bShowNetPlayPing = false;
|
bool bShowNetPlayPing = false;
|
||||||
|
bool bShowMPTurn = true;
|
||||||
bool bShowNetPlayMessages = false;
|
bool bShowNetPlayMessages = false;
|
||||||
bool bOverlayStats = false;
|
bool bOverlayStats = false;
|
||||||
bool bOverlayProjStats = false;
|
bool bOverlayProjStats = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue