CommonHostInterface: Add FF/Rewind/Pause indicators to non-fullscreen-UI

This commit is contained in:
Connor McLaughlin 2021-08-10 23:45:07 +10:00
parent 4f190aa902
commit 1acaff2160

View file

@ -1,4 +1,5 @@
#include "common_host_interface.h" #include "common_host_interface.h"
#include "IconsFontAwesome5.h"
#include "common/assert.h" #include "common/assert.h"
#include "common/audio_stream.h" #include "common/audio_stream.h"
#include "common/byte_stream.h" #include "common/byte_stream.h"
@ -1197,7 +1198,7 @@ void CommonHostInterface::DrawImGuiWindows()
void CommonHostInterface::DrawFPSWindow() void CommonHostInterface::DrawFPSWindow()
{ {
if (!(g_settings.display_show_fps | g_settings.display_show_vps | g_settings.display_show_speed | if (!(g_settings.display_show_fps | g_settings.display_show_vps | g_settings.display_show_speed |
g_settings.display_show_resolution)) g_settings.display_show_resolution | System::IsPaused() | IsFastForwardEnabled() | IsTurboEnabled()))
{ {
return; return;
} }
@ -1265,6 +1266,13 @@ void CommonHostInterface::DrawFPSWindow()
text.Format("%ux%u (%s)", effective_width, effective_height, interlaced ? "interlaced" : "progressive"); text.Format("%ux%u (%s)", effective_width, effective_height, interlaced ? "interlaced" : "progressive");
DRAW_LINE(IM_COL32(255, 255, 255, 255)); DRAW_LINE(IM_COL32(255, 255, 255, 255));
} }
const bool rewinding = System::IsRewinding();
if (rewinding || IsFastForwardEnabled() || IsTurboEnabled())
{
text.Assign(rewinding ? ICON_FA_FAST_BACKWARD : ICON_FA_FAST_FORWARD);
DRAW_LINE(IM_COL32(255, 255, 255, 255));
}
} }
#undef DRAW_LINE #undef DRAW_LINE
@ -2061,13 +2069,6 @@ void CommonHostInterface::SetFastForwardEnabled(bool enabled)
m_fast_forward_enabled = enabled; m_fast_forward_enabled = enabled;
UpdateSpeedLimiterState(); UpdateSpeedLimiterState();
if (!m_fullscreen_ui_enabled)
{
AddOSDMessage(enabled ? TranslateStdString("OSDMessage", "Fast forwarding...") :
TranslateStdString("OSDMessage", "Stopped fast forwarding."),
2.0f);
}
} }
void CommonHostInterface::SetTurboEnabled(bool enabled) void CommonHostInterface::SetTurboEnabled(bool enabled)
@ -2077,13 +2078,6 @@ void CommonHostInterface::SetTurboEnabled(bool enabled)
m_turbo_enabled = enabled; m_turbo_enabled = enabled;
UpdateSpeedLimiterState(); UpdateSpeedLimiterState();
if (!m_fullscreen_ui_enabled)
{
AddOSDMessage(enabled ? TranslateStdString("OSDMessage", "Turboing...") :
TranslateStdString("OSDMessage", "Stopped turboing."),
2.0f);
}
} }
void CommonHostInterface::SetRewindState(bool enabled) void CommonHostInterface::SetRewindState(bool enabled)