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) 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"); m_analog_mode ? "analog" : "digital");
} }
} }
@ -95,7 +95,7 @@ void AnalogController::SetButtonState(Button button, bool pressed)
{ {
if (m_analog_locked) 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"); m_analog_mode ? "analog" : "digital");
} }
else else
@ -155,7 +155,7 @@ void AnalogController::SetAnalogMode(bool enabled)
return; return;
Log_InfoPrintf("Controller %u switched to %s mode.", m_index + 1u, enabled ? "analog" : "digital"); 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"); enabled ? "analog" : "digital");
m_analog_mode = enabled; m_analog_mode = enabled;
} }

View File

@ -284,7 +284,7 @@ bool HostInterface::LoadState(const char* filename)
if (!stream) if (!stream)
return false; return false;
AddFormattedOSDMessage(2.0f, "Loading state from '%s'...", filename); AddFormattedOSDMessage(5.0f, "Loading state from '%s'...", filename);
if (!System::IsShutdown()) if (!System::IsShutdown())
{ {
@ -323,7 +323,7 @@ bool HostInterface::SaveState(const char* filename)
} }
else else
{ {
AddFormattedOSDMessage(2.0f, "State saved to '%s'.", filename); AddFormattedOSDMessage(5.0f, "State saved to '%s'.", filename);
stream->Commit(); stream->Commit();
} }
@ -451,7 +451,8 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.gpu_renderer != old_settings.gpu_renderer || if (g_settings.gpu_renderer != old_settings.gpu_renderer ||
g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device) 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)" : ""); g_settings.gpu_use_debug_device ? " (debug)" : "");
RecreateSystem(); RecreateSystem();
} }
@ -460,8 +461,10 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
g_settings.audio_buffer_size != old_settings.audio_buffer_size) g_settings.audio_buffer_size != old_settings.audio_buffer_size)
{ {
if (g_settings.audio_backend != old_settings.audio_backend) 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)); Settings::GetAudioBackendName(g_settings.audio_backend));
}
DebugAssert(m_audio_stream); DebugAssert(m_audio_stream);
m_audio_stream.reset(); m_audio_stream.reset();
CreateAudioStream(); CreateAudioStream();
@ -473,7 +476,7 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.cpu_execution_mode != old_settings.cpu_execution_mode) 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)); Settings::GetCPUExecutionModeName(g_settings.cpu_execution_mode));
CPU::CodeCache::SetUseRecompiler(g_settings.cpu_execution_mode == CPUExecutionMode::Recompiler); 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 && if (g_settings.cpu_execution_mode == CPUExecutionMode::Recompiler &&
g_settings.cpu_recompiler_memory_exceptions != old_settings.cpu_recompiler_memory_exceptions) 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"); g_settings.cpu_recompiler_memory_exceptions ? "enabled" : "disabled");
CPU::CodeCache::Flush(); CPU::CodeCache::Flush();
} }
@ -508,7 +511,8 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
{ {
if (g_settings.IsUsingCodeCache()) 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(); CPU::CodeCache::Flush();
} }
@ -660,7 +664,7 @@ void HostInterface::ToggleSoftwareRendering()
const GPURenderer new_renderer = g_gpu->IsHardwareRenderer() ? GPURenderer::Software : g_settings.gpu_renderer; 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); System::RecreateGPU(new_renderer);
} }
@ -672,7 +676,7 @@ void HostInterface::ModifyResolutionScale(s32 increment)
return; return;
g_settings.gpu_resolution_scale = new_resolution_scale; 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_WIDTH * g_settings.gpu_resolution_scale,
GPU::VRAM_HEIGHT * 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) if (g_settings.load_devices_from_save_states)
{ {
g_host_interface->AddFormattedOSDMessage( 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(state_controller_type), i + 1u,
Settings::GetControllerTypeName(controller_type)); Settings::GetControllerTypeName(controller_type));
@ -69,7 +69,7 @@ bool Pad::DoState(StateWrapper& sw)
} }
else 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); Settings::GetControllerTypeName(state_controller_type), i + 1u);
// we still need to read the save state controller state // 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()) 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); i + 1u);
card = MemoryCard::Open(g_host_interface->GetSharedMemoryCardPath(i)); card = MemoryCard::Open(g_host_interface->GetSharedMemoryCardPath(i));
} }
@ -1333,7 +1333,7 @@ bool RemoveMediaPathFromPlaylist(u32 index)
if (GetMediaPlaylistIndex() == 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(); g_cdrom.RemoveMedia();
} }
@ -1348,7 +1348,7 @@ bool ReplaceMediaPathFromPlaylist(u32 index, const std::string_view& path)
if (GetMediaPlaylistIndex() == index) 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(); g_cdrom.RemoveMedia();
s_media_playlist[index] = path; s_media_playlist[index] = path;

View File

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