Switch some messages to the OSD and increase durations

This commit is contained in:
Connor McLaughlin 2020-08-15 23:39:46 +10:00
parent 810b359234
commit f5fb8186c7
5 changed files with 23 additions and 19 deletions

View File

@ -53,7 +53,7 @@ bool AnalogController::DoState(StateWrapper& sw)
if (old_analog_mode != m_analog_mode)
{
g_host_interface->AddFormattedOSDMessage(2.0f, "Controller %u switched to %s mode.", m_index + 1u,
g_host_interface->AddFormattedOSDMessage(5.0f, "Controller %u switched to %s mode.", m_index + 1u,
m_analog_mode ? "analog" : "digital");
}
}
@ -95,7 +95,7 @@ void AnalogController::SetButtonState(Button button, bool pressed)
{
if (m_analog_locked)
{
g_host_interface->AddFormattedOSDMessage(2.0f, "Controller %u is locked to %s mode by the game.", m_index + 1u,
g_host_interface->AddFormattedOSDMessage(5.0f, "Controller %u is locked to %s mode by the game.", m_index + 1u,
m_analog_mode ? "analog" : "digital");
}
else
@ -155,7 +155,7 @@ void AnalogController::SetAnalogMode(bool enabled)
return;
Log_InfoPrintf("Controller %u switched to %s mode.", m_index + 1u, enabled ? "analog" : "digital");
g_host_interface->AddFormattedOSDMessage(2.0f, "Controller %u switched to %s mode.", m_index + 1u,
g_host_interface->AddFormattedOSDMessage(5.0f, "Controller %u switched to %s mode.", m_index + 1u,
enabled ? "analog" : "digital");
m_analog_mode = enabled;
}

View File

@ -284,7 +284,7 @@ bool HostInterface::LoadState(const char* filename)
if (!stream)
return false;
AddFormattedOSDMessage(2.0f, "Loading state from '%s'...", filename);
AddFormattedOSDMessage(5.0f, "Loading state from '%s'...", filename);
if (!System::IsShutdown())
{
@ -323,7 +323,7 @@ bool HostInterface::SaveState(const char* filename)
}
else
{
AddFormattedOSDMessage(2.0f, "State saved to '%s'.", filename);
AddFormattedOSDMessage(5.0f, "State saved to '%s'.", filename);
stream->Commit();
}
@ -451,7 +451,8 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.gpu_renderer != old_settings.gpu_renderer ||
g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device)
{
ReportFormattedMessage("Switching to %s%s GPU renderer.", Settings::GetRendererName(g_settings.gpu_renderer),
AddFormattedOSDMessage(5.0f, "Switching to %s%s GPU renderer.",
Settings::GetRendererName(g_settings.gpu_renderer),
g_settings.gpu_use_debug_device ? " (debug)" : "");
RecreateSystem();
}
@ -460,8 +461,10 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
g_settings.audio_buffer_size != old_settings.audio_buffer_size)
{
if (g_settings.audio_backend != old_settings.audio_backend)
ReportFormattedMessage("Switching to %s audio backend.",
{
AddFormattedOSDMessage(5.0f, "Switching to %s audio backend.",
Settings::GetAudioBackendName(g_settings.audio_backend));
}
DebugAssert(m_audio_stream);
m_audio_stream.reset();
CreateAudioStream();
@ -473,7 +476,7 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.cpu_execution_mode != old_settings.cpu_execution_mode)
{
ReportFormattedMessage("Switching to %s CPU execution mode.",
AddFormattedOSDMessage(5.0f, "Switching to %s CPU execution mode.",
Settings::GetCPUExecutionModeName(g_settings.cpu_execution_mode));
CPU::CodeCache::SetUseRecompiler(g_settings.cpu_execution_mode == CPUExecutionMode::Recompiler);
}
@ -481,7 +484,7 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.cpu_execution_mode == CPUExecutionMode::Recompiler &&
g_settings.cpu_recompiler_memory_exceptions != old_settings.cpu_recompiler_memory_exceptions)
{
ReportFormattedMessage("CPU memory exceptions %s, flushing all blocks.",
AddFormattedOSDMessage(5.0f, "CPU memory exceptions %s, flushing all blocks.",
g_settings.cpu_recompiler_memory_exceptions ? "enabled" : "disabled");
CPU::CodeCache::Flush();
}
@ -508,7 +511,8 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
{
if (g_settings.IsUsingCodeCache())
{
ReportFormattedMessage("PGXP %s, recompiling all blocks.", g_settings.gpu_pgxp_enable ? "enabled" : "disabled");
AddFormattedOSDMessage(5.0f, "PGXP %s, recompiling all blocks.",
g_settings.gpu_pgxp_enable ? "enabled" : "disabled");
CPU::CodeCache::Flush();
}
@ -660,7 +664,7 @@ void HostInterface::ToggleSoftwareRendering()
const GPURenderer new_renderer = g_gpu->IsHardwareRenderer() ? GPURenderer::Software : g_settings.gpu_renderer;
AddFormattedOSDMessage(2.0f, "Switching to %s renderer...", Settings::GetRendererDisplayName(new_renderer));
AddFormattedOSDMessage(5.0f, "Switching to %s renderer...", Settings::GetRendererDisplayName(new_renderer));
System::RecreateGPU(new_renderer);
}
@ -672,7 +676,7 @@ void HostInterface::ModifyResolutionScale(s32 increment)
return;
g_settings.gpu_resolution_scale = new_resolution_scale;
AddFormattedOSDMessage(2.0f, "Resolution scale set to %ux (%ux%u)", g_settings.gpu_resolution_scale,
AddFormattedOSDMessage(5.0f, "Resolution scale set to %ux (%ux%u)", g_settings.gpu_resolution_scale,
GPU::VRAM_WIDTH * g_settings.gpu_resolution_scale,
GPU::VRAM_HEIGHT * g_settings.gpu_resolution_scale);

View File

@ -59,7 +59,7 @@ bool Pad::DoState(StateWrapper& sw)
if (g_settings.load_devices_from_save_states)
{
g_host_interface->AddFormattedOSDMessage(
2.0f, "Save state contains controller type %s in port %u, but %s is used. Switching.",
10.0f, "Save state contains controller type %s in port %u, but %s is used. Switching.",
Settings::GetControllerTypeName(state_controller_type), i + 1u,
Settings::GetControllerTypeName(controller_type));
@ -69,7 +69,7 @@ bool Pad::DoState(StateWrapper& sw)
}
else
{
g_host_interface->AddFormattedOSDMessage(2.0f, "Ignoring mismatched controller type %s in port %u.",
g_host_interface->AddFormattedOSDMessage(10.0f, "Ignoring mismatched controller type %s in port %u.",
Settings::GetControllerTypeName(state_controller_type), i + 1u);
// we still need to read the save state controller state

View File

@ -1211,7 +1211,7 @@ void UpdateMemoryCards()
{
if (g_settings.memory_card_paths[i].empty())
{
g_host_interface->AddFormattedOSDMessage(2.0f, "Memory card path for slot %u is missing, using default.",
g_host_interface->AddFormattedOSDMessage(10.0f, "Memory card path for slot %u is missing, using default.",
i + 1u);
card = MemoryCard::Open(g_host_interface->GetSharedMemoryCardPath(i));
}
@ -1333,7 +1333,7 @@ bool RemoveMediaPathFromPlaylist(u32 index)
if (GetMediaPlaylistIndex() == index)
{
g_host_interface->ReportMessage("Removing current media from playlist, removing media from CD-ROM.");
g_host_interface->AddFormattedOSDMessage(10.0f, "Removing current media from playlist, removing media from CD-ROM.");
g_cdrom.RemoveMedia();
}
@ -1348,7 +1348,7 @@ bool ReplaceMediaPathFromPlaylist(u32 index, const std::string_view& path)
if (GetMediaPlaylistIndex() == index)
{
g_host_interface->ReportMessage("Changing current media from playlist, replacing current media.");
g_host_interface->AddFormattedOSDMessage(10.0f, "Changing current media from playlist, replacing current media.");
g_cdrom.RemoveMedia();
s_media_playlist[index] = path;

View File

@ -1237,7 +1237,7 @@ void CommonHostInterface::RegisterGeneralHotkeys()
{
m_speed_limiter_temp_disabled = !m_speed_limiter_temp_disabled;
UpdateSpeedLimiterState();
AddFormattedOSDMessage(1.0f, "Speed limiter %s.",
AddFormattedOSDMessage(2.0f, "Speed limiter %s.",
m_speed_limiter_enabled ? "enabled" : "disabled");
}
});
@ -1303,7 +1303,7 @@ void CommonHostInterface::RegisterGraphicsHotkeys()
{
g_settings.gpu_pgxp_enable = !g_settings.gpu_pgxp_enable;
g_gpu->UpdateSettings();
ReportFormattedMessage("PGXP is now %s.", g_settings.gpu_pgxp_enable ? "enabled" : "disabled");
AddFormattedOSDMessage(5.0f, "PGXP is now %s.", g_settings.gpu_pgxp_enable ? "enabled" : "disabled");
if (g_settings.gpu_pgxp_enable)
PGXP::Initialize();