System: Add missing icons to some OSD messages

This commit is contained in:
Stenzek 2023-11-05 22:28:53 +10:00
parent f27a28b58c
commit 928d137111
No known key found for this signature in database

View file

@ -3242,25 +3242,29 @@ bool System::InsertMedia(const char* path)
std::unique_ptr<CDImage> image = CDImage::Open(path, g_settings.cdrom_load_image_patches, &error); std::unique_ptr<CDImage> image = CDImage::Open(path, g_settings.cdrom_load_image_patches, &error);
if (!image) if (!image)
{ {
Host::AddFormattedOSDMessage(10.0f, TRANSLATE("OSDMessage", "Failed to open disc image '%s': %s."), path, Host::AddIconOSDMessage(
error.GetDescription().c_str()); "DiscInserted", ICON_FA_COMPACT_DISC,
fmt::format(TRANSLATE_FS("OSDMessage", "Failed to open disc image '{}': {}."), path, error.GetDescription()),
Host::OSD_ERROR_DURATION);
return false; return false;
} }
const DiscRegion region = GetRegionForImage(image.get()); const DiscRegion region = GetRegionForImage(image.get());
UpdateRunningGame(path, image.get(), false); UpdateRunningGame(path, image.get(), false);
CDROM::InsertMedia(std::move(image), region); CDROM::InsertMedia(std::move(image), region);
Log_InfoPrintf("Inserted media from %s (%s, %s)", s_running_game_path.c_str(), s_running_game_serial.c_str(), Log_InfoFmt("Inserted media from {} ({}, {})", s_running_game_path, s_running_game_serial, s_running_game_title);
s_running_game_title.c_str());
if (g_settings.cdrom_load_image_to_ram) if (g_settings.cdrom_load_image_to_ram)
CDROM::PrecacheMedia(); CDROM::PrecacheMedia();
Host::AddFormattedOSDMessage(10.0f, TRANSLATE("OSDMessage", "Inserted disc '%s' (%s)."), s_running_game_title.c_str(), Host::AddIconOSDMessage(
s_running_game_serial.c_str()); "DiscInserted", ICON_FA_COMPACT_DISC,
fmt::format(TRANSLATE_FS("OSDMessage", "Inserted disc '{}' ({})."), s_running_game_title, s_running_game_serial),
Host::OSD_INFO_DURATION);
if (g_settings.HasAnyPerGameMemoryCards()) if (g_settings.HasAnyPerGameMemoryCards())
{ {
Host::AddOSDMessage(TRANSLATE_STR("System", "Game changed, reloading memory cards."), 10.0f); Host::AddIconOSDMessage("ReloadMemoryCardsFromGameChange", ICON_FA_SD_CARD,
TRANSLATE_STR("System", "Game changed, reloading memory cards."), Host::OSD_INFO_DURATION);
UpdatePerGameMemoryCards(); UpdatePerGameMemoryCards();
} }
@ -3486,9 +3490,11 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
const bool recreate_device = (g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device || const bool recreate_device = (g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device ||
g_settings.gpu_threaded_presentation != old_settings.gpu_threaded_presentation); g_settings.gpu_threaded_presentation != old_settings.gpu_threaded_presentation);
Host::AddFormattedOSDMessage(5.0f, TRANSLATE("OSDMessage", "Switching to %s%s GPU renderer."), Host::AddIconOSDMessage("RendererSwitch", ICON_FA_PAINT_ROLLER,
Settings::GetRendererName(g_settings.gpu_renderer), fmt::format(TRANSLATE_FS("OSDMessage", "Switching to {}{} GPU renderer."),
g_settings.gpu_use_debug_device ? " (debug)" : ""); Settings::GetRendererName(g_settings.gpu_renderer),
g_settings.gpu_use_debug_device ? " (debug)" : ""),
Host::OSD_INFO_DURATION);
RecreateGPU(g_settings.gpu_renderer, recreate_device); RecreateGPU(g_settings.gpu_renderer, recreate_device);
} }
@ -3510,8 +3516,10 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
{ {
if (g_settings.audio_backend != old_settings.audio_backend) if (g_settings.audio_backend != old_settings.audio_backend)
{ {
Host::AddFormattedOSDMessage(5.0f, TRANSLATE("OSDMessage", "Switching to %s audio backend."), Host::AddIconOSDMessage("AudioBackendSwitch", ICON_FA_HEADPHONES,
Settings::GetAudioBackendName(g_settings.audio_backend)); fmt::format(TRANSLATE_FS("OSDMessage", "Switching to {} audio backend."),
Settings::GetAudioBackendName(g_settings.audio_backend)),
Host::OSD_INFO_DURATION);
} }
SPU::RecreateOutputStream(); SPU::RecreateOutputStream();
@ -3532,10 +3540,11 @@ void System::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 ||
g_settings.cpu_fastmem_mode != old_settings.cpu_fastmem_mode) g_settings.cpu_fastmem_mode != old_settings.cpu_fastmem_mode)
{ {
Host::AddOSDMessage(fmt::format(TRANSLATE_FS("OSDMessage", "Switching to {} CPU execution mode."), Host::AddIconOSDMessage("CPUExecutionModeSwitch", ICON_FA_MICROCHIP,
TRANSLATE_SV("CPUExecutionMode", Settings::GetCPUExecutionModeDisplayName( fmt::format(TRANSLATE_FS("OSDMessage", "Switching to {} CPU execution mode."),
g_settings.cpu_execution_mode))), TRANSLATE_SV("CPUExecutionMode", Settings::GetCPUExecutionModeDisplayName(
5.0f); g_settings.cpu_execution_mode))),
Host::OSD_INFO_DURATION);
CPU::ExecutionModeChanged(); CPU::ExecutionModeChanged();
if (old_settings.cpu_execution_mode != CPUExecutionMode::Interpreter) if (old_settings.cpu_execution_mode != CPUExecutionMode::Interpreter)
CPU::CodeCache::Shutdown(); CPU::CodeCache::Shutdown();
@ -3550,7 +3559,9 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.cpu_recompiler_icache != old_settings.cpu_recompiler_icache || g_settings.cpu_recompiler_icache != old_settings.cpu_recompiler_icache ||
g_settings.bios_tty_logging != old_settings.bios_tty_logging)) g_settings.bios_tty_logging != old_settings.bios_tty_logging))
{ {
Host::AddOSDMessage(TRANSLATE_STR("OSDMessage", "Recompiler options changed, flushing all blocks."), 5.0f); Host::AddIconOSDMessage("CPUFlushAllBlocks", ICON_FA_MICROCHIP,
TRANSLATE_STR("OSDMessage", "Recompiler options changed, flushing all blocks."),
Host::OSD_INFO_DURATION);
CPU::ExecutionModeChanged(); CPU::ExecutionModeChanged();
CPU::CodeCache::Reset(); CPU::CodeCache::Reset();