Misc: Change various icons

This commit is contained in:
Stenzek
2024-08-25 23:17:05 +10:00
parent f30844cc40
commit e8b787fb57
9 changed files with 47 additions and 42 deletions

View File

@ -33,6 +33,7 @@
#include "util/platform_misc.h"
#include "util/state_wrapper.h"
#include "IconsEmoji.h"
#include "IconsFontAwesome5.h"
#include "IconsPromptFont.h"
#include "fmt/format.h"
@ -2486,7 +2487,7 @@ void Achievements::DrawAchievement(const rc_client_achievement_t* cheevo)
// Just use the lock for standard achievements.
case RC_CLIENT_ACHIEVEMENT_TYPE_STANDARD:
default:
right_icon_text = is_unlocked ? ICON_FA_LOCK_OPEN : ICON_FA_LOCK;
right_icon_text = is_unlocked ? ICON_EMOJI_UNLOCKED : ICON_FA_LOCK;
break;
}

View File

@ -27,6 +27,7 @@
#include <sstream>
#include <type_traits>
#include "IconsEmoji.h"
#include "IconsFontAwesome5.h"
Log_SetChannel(GameDatabase);
@ -458,13 +459,13 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
#define APPEND_MESSAGE(msg) \
do \
{ \
messages.append("\n \u2022 "); \
messages.append("\n \u2022 "); \
messages.append(msg); \
} while (0)
#define APPEND_MESSAGE_FMT(...) \
do \
{ \
messages.append("\n \u2022 "); \
messages.append("\n \u2022 "); \
messages.append_format(__VA_ARGS__); \
} while (0)
@ -650,7 +651,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
else if (settings.gpu_pgxp_enable && settings.gpu_pgxp_vertex_cache)
{
Host::AddIconOSDMessage(
"gamedb_force_pgxp_vertex_cache", ICON_FA_EXCLAMATION_TRIANGLE,
"gamedb_force_pgxp_vertex_cache", ICON_EMOJI_WARNING,
TRANSLATE_STR(
"GameDatabase",
"PGXP Vertex Cache is enabled, but it is not required for this game. This may cause rendering errors."),
@ -664,11 +665,10 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
#ifndef __ANDROID__
APPEND_MESSAGE(TRANSLATE_SV("GameDatabase", "PGXP CPU mode enabled."));
#else
Host::AddIconOSDMessage(
"gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP,
"This game requires PGXP CPU mode, which increases system requirements.\n" ICON_FA_EXCLAMATION_TRIANGLE
" If the game runs too slow, disable PGXP for this game.",
Host::OSD_WARNING_DURATION);
Host::AddIconOSDMessage("gamedb_force_pgxp_cpu", ICON_EMOJI_WARNING,
"This game requires PGXP CPU mode, which increases system requirements.\n"
" If the game runs too slow, disable PGXP for this game.",
Host::OSD_WARNING_DURATION);
#endif
}
@ -677,7 +677,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
else if (settings.UsingPGXPCPUMode())
{
Host::AddIconOSDMessage(
"gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP,
"gamedb_force_pgxp_cpu", ICON_EMOJI_WARNING,
TRANSLATE_STR("GameDatabase",
"PGXP CPU mode is enabled, but it is not required for this game. This may cause rendering errors."),
Host::OSD_WARNING_DURATION);
@ -720,8 +720,8 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (!messages.empty())
{
Host::AddIconOSDMessage(
"GameDBCompatibility", ICON_FA_MICROCHIP,
fmt::format("{}{}", TRANSLATE_SV("GameDatabase", "Compatibility settings for this game have been applied:"),
"GameDBCompatibility", ICON_EMOJI_INFORMATION,
fmt::format("{}{}", TRANSLATE_SV("GameDatabase", "Compatibility settings for this game have been applied."),
messages.view()),
Host::OSD_WARNING_DURATION);
}

View File

@ -28,7 +28,7 @@
#include "common/small_string.h"
#include "common/string_util.h"
#include "IconsFontAwesome5.h"
#include "IconsEmoji.h"
#include "fmt/format.h"
#include <cmath>
@ -2526,7 +2526,7 @@ bool CompressAndWriteTextureToFile(u32 width, u32 height, std::string filename,
{
// Use a 60 second timeout to give it plenty of time to actually save.
osd_key = fmt::format("ScreenshotSaver_{}", filename);
Host::AddIconOSDMessage(osd_key, ICON_FA_CAMERA,
Host::AddIconOSDMessage(osd_key, ICON_EMOJI_CAMERA_WITH_FLASH,
fmt::format(TRANSLATE_FS("GPU", "Saving screenshot to '{}'."), Path::GetFileName(filename)),
60.0f);
}
@ -2577,7 +2577,7 @@ bool CompressAndWriteTextureToFile(u32 width, u32 height, std::string filename,
if (!osd_key.empty())
{
Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_CAMERA,
Host::AddIconOSDMessage(std::move(osd_key), ICON_EMOJI_CAMERA,
fmt::format(result ? TRANSLATE_FS("GPU", "Saved screenshot to '{}'.") :
TRANSLATE_FS("GPU", "Failed to save screenshot to '{}'."),
Path::GetFileName(filename),

View File

@ -23,6 +23,7 @@
#include "common/timer.h"
#include "IconsFontAwesome5.h"
#include "IconsEmoji.h"
#include <cmath>
@ -536,12 +537,12 @@ DEFINE_HOTKEY("AudioMute", TRANSLATE_NOOP("Hotkeys", "Audio"), TRANSLATE_NOOP("H
SPU::GetOutputStream()->SetOutputVolume(volume);
if (g_settings.audio_output_muted)
{
Host::AddIconOSDMessage("AudioControlHotkey", ICON_FA_VOLUME_MUTE,
Host::AddIconOSDMessage("AudioControlHotkey", ICON_EMOJI_MUTED_SPEAKER,
TRANSLATE_STR("OSDMessage", "Volume: Muted"), 5.0f);
}
else
{
Host::AddIconOSDMessage("AudioControlHotkey", ICON_FA_VOLUME_UP,
Host::AddIconOSDMessage("AudioControlHotkey", ICON_EMOJI_MEDIUM_VOLUME_SPEAKER,
fmt::format(TRANSLATE_FS("OSDMessage", "Volume: {}%"), volume), 5.0f);
}
}
@ -552,7 +553,7 @@ DEFINE_HOTKEY("AudioCDAudioMute", TRANSLATE_NOOP("Hotkeys", "Audio"), TRANSLATE_
{
g_settings.cdrom_mute_cd_audio = !g_settings.cdrom_mute_cd_audio;
Host::AddIconOSDMessage(
"AudioControlHotkey", g_settings.cdrom_mute_cd_audio ? ICON_FA_VOLUME_MUTE : ICON_FA_VOLUME_UP,
"AudioControlHotkey", g_settings.cdrom_mute_cd_audio ? ICON_EMOJI_MUTED_SPEAKER : ICON_EMOJI_MEDIUM_VOLUME_SPEAKER,
g_settings.cdrom_mute_cd_audio ? TRANSLATE_STR("OSDMessage", "CD Audio Muted.") :
TRANSLATE_STR("OSDMessage", "CD Audio Unmuted."),
2.0f);
@ -568,7 +569,7 @@ DEFINE_HOTKEY("AudioVolumeUp", TRANSLATE_NOOP("Hotkeys", "Audio"), TRANSLATE_NOO
g_settings.audio_output_volume = volume;
g_settings.audio_fast_forward_volume = volume;
SPU::GetOutputStream()->SetOutputVolume(volume);
Host::AddIconOSDMessage("AudioControlHotkey", ICON_FA_VOLUME_UP,
Host::AddIconOSDMessage("AudioControlHotkey", ICON_EMOJI_HIGH_VOLUME_SPEAKER,
fmt::format(TRANSLATE_FS("OSDMessage", "Volume: {}%"), volume), 5.0f);
}
})
@ -582,7 +583,7 @@ DEFINE_HOTKEY("AudioVolumeDown", TRANSLATE_NOOP("Hotkeys", "Audio"), TRANSLATE_N
g_settings.audio_output_volume = volume;
g_settings.audio_fast_forward_volume = volume;
SPU::GetOutputStream()->SetOutputVolume(volume);
Host::AddIconOSDMessage("AudioControlHotkey", ICON_FA_VOLUME_DOWN,
Host::AddIconOSDMessage("AudioControlHotkey", ICON_EMOJI_MEDIUM_VOLUME_SPEAKER,
fmt::format(TRANSLATE_FS("OSDMessage", "Volume: {}%"), volume), 5.0f);
}
})

View File

@ -31,7 +31,7 @@
#include "common/thirdparty/SmallVector.h"
#include "common/timer.h"
#include "IconsFontAwesome5.h"
#include "IconsEmoji.h"
#include "fmt/chrono.h"
#include "imgui.h"
#include "imgui_internal.h"
@ -389,7 +389,7 @@ void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, float
const bool rewinding = System::IsRewinding();
if (rewinding || System::IsFastForwardEnabled() || System::IsTurboEnabled())
{
text.assign(rewinding ? ICON_FA_FAST_BACKWARD : ICON_FA_FAST_FORWARD);
text.assign(rewinding ? ICON_EMOJI_FAST_REVERSE : ICON_EMOJI_FAST_FORWARD);
DRAW_LINE(standard_font, text, IM_COL32(255, 255, 255, 255));
}
}
@ -397,7 +397,7 @@ void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, float
else if (g_settings.display_show_status_indicators && state == System::State::Paused &&
!FullscreenUI::HasActiveWindow())
{
text.assign(ICON_FA_PAUSE);
text.assign(ICON_EMOJI_PAUSE);
DRAW_LINE(standard_font, text, IM_COL32(255, 255, 255, 255));
}
@ -508,7 +508,7 @@ void ImGuiManager::DrawMediaCaptureOverlay(float& position_y, float scale, float
ImFont* const standard_font = ImGuiManager::GetStandardFont();
ImDrawList* dl = ImGui::GetBackgroundDrawList();
static constexpr const char* ICON = ICON_FA_VIDEO;
static constexpr const char* ICON = ICON_EMOJI_MOVIE_CAMERA;
const time_t elapsed_time = cap->GetElapsedTime();
const TinyString text_msg = TinyString::from_format(" {:02d}:{:02d}:{:02d}", elapsed_time / 3600,
(elapsed_time % 3600) / 60, (elapsed_time % 3600) % 60);
@ -1155,7 +1155,7 @@ void SaveStateSelectorUI::LoadCurrentSlot()
else
{
Host::AddIconOSDMessage(
"LoadState", ICON_FA_SD_CARD,
"LoadState", ICON_EMOJI_FLOPPY_DISK,
IsCurrentSlotGlobal() ?
fmt::format(TRANSLATE_FS("SaveStateSelectorUI", "No save state found in Global Slot {}."), GetCurrentSlot()) :
fmt::format(TRANSLATE_FS("SaveStateSelectorUI", "No save state found in Slot {}."), GetCurrentSlot()),
@ -1173,7 +1173,7 @@ void SaveStateSelectorUI::SaveCurrentSlot()
Error error;
if (!System::SaveState(path.c_str(), &error, g_settings.create_save_state_backups))
{
Host::AddIconOSDMessage("SaveState", ICON_FA_EXCLAMATION_TRIANGLE,
Host::AddIconOSDMessage("SaveState", ICON_EMOJI_WARNING,
fmt::format(TRANSLATE_FS("OSDMessage", "Failed to save state to slot {0}:\n{1}"),
GetCurrentSlot(), error.GetDescription()),
Host::OSD_ERROR_DURATION);
@ -1194,7 +1194,7 @@ void SaveStateSelectorUI::ShowSlotOSDMessage()
date = TRANSLATE_STR("SaveStateSelectorUI", "no save yet");
Host::AddIconOSDMessage(
"ShowSlotOSDMessage", ICON_FA_SEARCH,
"ShowSlotOSDMessage", ICON_EMOJI_MAGNIFIYING_GLASS_TILTED_LEFT,
IsCurrentSlotGlobal() ?
fmt::format(TRANSLATE_FS("SaveStateSelectorUI", "Global Save Slot {0} selected ({1})."), GetCurrentSlot(), date) :
fmt::format(TRANSLATE_FS("SaveStateSelectorUI", "Save Slot {0} selected ({1})."), GetCurrentSlot(), date),

View File

@ -2,7 +2,6 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "system.h"
#include "IconsFontAwesome5.h"
#include "achievements.h"
#include "bios.h"
#include "bus.h"
@ -60,6 +59,9 @@
#include "common/string_util.h"
#include "common/threading.h"
#include "IconsEmoji.h"
#include "IconsFontAwesome5.h"
#include "cpuinfo.h"
#include "fmt/chrono.h"
#include "fmt/format.h"
@ -2589,7 +2591,7 @@ bool System::LoadState(const char* path, Error* error, bool save_undo_state)
INFO_LOG("Loading state from '{}'...", path);
Host::AddIconOSDMessage(
"load_state", ICON_FA_FOLDER_OPEN,
"load_state", ICON_EMOJI_OPEN_THE_FOLDER,
fmt::format(TRANSLATE_FS("OSDMessage", "Loading state from '{}'..."), Path::GetFileName(path)),
Host::OSD_INFO_DURATION);
@ -2923,7 +2925,7 @@ bool System::SaveState(const char* path, Error* error, bool backup_existing_save
return false;
}
Host::AddIconOSDMessage("save_state", ICON_FA_SAVE,
Host::AddIconOSDMessage("save_state", ICON_EMOJI_FLOPPY_DISK,
fmt::format(TRANSLATE_FS("OSDMessage", "State saved to '{}'."), Path::GetFileName(path)),
5.0f);
@ -4508,7 +4510,7 @@ void System::WarnAboutUnsafeSettings()
{
if (g_settings.cpu_overclock_active)
{
append(ICON_FA_MICROCHIP,
append(ICON_EMOJI_WARNING,
SmallString::from_format(
TRANSLATE_FS("System", "CPU clock speed is set to {}% ({} / {}). This may crash games."),
g_settings.GetCPUOverclockPercent(), g_settings.cpu_overclock_numerator,
@ -4516,14 +4518,14 @@ void System::WarnAboutUnsafeSettings()
}
if (g_settings.cdrom_read_speedup > 1)
{
append(ICON_FA_COMPACT_DISC,
append(ICON_EMOJI_WARNING,
SmallString::from_format(
TRANSLATE_FS("System", "CD-ROM read speedup set to {}x (effective speed {}x). This may crash games."),
g_settings.cdrom_read_speedup, g_settings.cdrom_read_speedup * 2));
}
if (g_settings.cdrom_seek_speedup != 1)
{
append(ICON_FA_COMPACT_DISC,
append(ICON_EMOJI_WARNING,
SmallString::from_format(TRANSLATE_FS("System", "CD-ROM seek speedup set to {}. This may crash games."),
(g_settings.cdrom_seek_speedup == 0) ?
TinyString(TRANSLATE_SV("System", "Instant")) :
@ -4537,19 +4539,21 @@ void System::WarnAboutUnsafeSettings()
{
if (g_settings.gpu_multisamples != 1)
{
append(ICON_FA_MAGIC,
append(ICON_EMOJI_WARNING,
TRANSLATE_SV("System", "Multisample anti-aliasing is enabled, some games may not render correctly."));
}
if (g_settings.gpu_resolution_scale > 1 && g_settings.gpu_force_round_texcoords)
{
append(
ICON_FA_MAGIC,
ICON_EMOJI_WARNING,
TRANSLATE_SV("System", "Round upscaled texture coordinates is enabled. This may cause rendering errors."));
}
}
if (g_settings.enable_8mb_ram)
append(ICON_FA_MICROCHIP,
TRANSLATE_SV("System", "8MB RAM is enabled, this may be incompatible with some games."));
{
append(ICON_EMOJI_WARNING,
TRANSLATE_SV("System", "8MB RAM is enabled, this may be incompatible with some games."));
}
}
else
{
@ -4558,7 +4562,7 @@ void System::WarnAboutUnsafeSettings()
if (!g_settings.apply_compatibility_settings)
{
append(ICON_FA_GAMEPAD,
append(ICON_EMOJI_WARNING,
TRANSLATE_STR("System", "Compatibility settings are not enabled. Some games may not function correctly."));
}