From ed78a20ea73d4b95a6e86ddf936e252675f3137e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 17 Nov 2024 13:23:03 +1000 Subject: [PATCH] FullscreenUI: More icon replacements --- dep/imgui/include/IconsEmoji.h | 1 + src/core/fullscreen_ui.cpp | 23 +++++++++++++---------- src/util/imgui_glyph_ranges.inl | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dep/imgui/include/IconsEmoji.h b/dep/imgui/include/IconsEmoji.h index 5290f5ffb..9adfd39ef 100644 --- a/dep/imgui/include/IconsEmoji.h +++ b/dep/imgui/include/IconsEmoji.h @@ -28,3 +28,4 @@ #define ICON_EMOJI_LOCKED "\xf0\x9f\x94\x92" #define ICON_EMOJI_UNLOCKED "\xf0\x9f\x94\x93" #define ICON_EMOJI_REFRESH "\xf0\x9f\x94\x84" +#define ICON_EMOJI_PROHIBITED "\xf0\x9f\x9a\xab" diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 2ecc191ab..e703c40a7 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -31,6 +31,7 @@ #include "common/string_util.h" #include "common/timer.h" +#include "IconsEmoji.h" #include "IconsFontAwesome5.h" #include "IconsPromptFont.h" #include "fmt/chrono.h" @@ -2868,7 +2869,7 @@ void FullscreenUI::DrawSettingsWindow() SettingsPage::Cheats, SettingsPage::Graphics, SettingsPage::Audio, SettingsPage::Controller, SettingsPage::MemoryCards, SettingsPage::Achievements, SettingsPage::Advanced}; static constexpr std::array, static_cast(SettingsPage::Count)> titles = { - {{FSUI_NSTR("Summary"), ICON_FA_PARAGRAPH}, + {{FSUI_NSTR("Summary"), ICON_FA_FILE_ALT}, {FSUI_NSTR("Interface Settings"), ICON_FA_TV}, {FSUI_NSTR("Console Settings"), ICON_FA_DICE_D20}, {FSUI_NSTR("Emulation Settings"), ICON_FA_COGS}, @@ -2887,7 +2888,7 @@ void FullscreenUI::DrawSettingsWindow() const bool game_settings = IsEditingGameSettings(GetEditingSettingsInterface()); const u32 count = (game_settings ? static_cast(std::size(per_game_pages)) : static_cast(std::size(global_pages))) - - BoolToUInt32(ShouldShowAdvancedSettings()); + BoolToUInt32(!ShouldShowAdvancedSettings()); const SettingsPage* pages = game_settings ? per_game_pages : global_pages; u32 index = 0; for (u32 i = 0; i < count; i++) @@ -5479,15 +5480,16 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats) if (cheats) { ActiveButton( - FSUI_CSTR( + FSUI_ICONSTR( + ICON_EMOJI_WARNING, "WARNING: Activating cheats can cause unpredictable behavior, crashing, soft-locks, or broken saved games."), false, false, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY); MenuHeading(FSUI_CSTR("Settings")); bool enable_cheats = bsi->GetBoolValue("Cheats", "EnableCheats", false); - if (ToggleButton(FSUI_CSTR("Enable Cheats"), FSUI_CSTR("Enables the cheats that are selected below."), - &enable_cheats)) + if (ToggleButton(FSUI_ICONSTR(ICON_FA_FLASK, "Enable Cheats"), + FSUI_CSTR("Enables the cheats that are selected below."), &enable_cheats)) { if (enable_cheats) bsi->SetBoolValue("Cheats", "EnableCheats", true); @@ -5497,7 +5499,7 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats) } bool load_database_cheats = bsi->GetBoolValue("Cheats", "LoadCheatsFromDatabase", true); - if (ToggleButton(FSUI_CSTR("Load Database Cheats"), + if (ToggleButton(FSUI_ICONSTR(ICON_FA_DATABASE, "Load Database Cheats"), FSUI_CSTR("Enables loading of cheats for this game from DuckStation's database."), &load_database_cheats)) { @@ -5512,7 +5514,7 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats) if (code_list.empty()) { - ActiveButton(FSUI_CSTR("No cheats are available for this game."), false, false, + ActiveButton(FSUI_ICONSTR(ICON_FA_STORE_ALT_SLASH, "No cheats are available for this game."), false, false, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY); } else @@ -5537,13 +5539,14 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats) else { ActiveButton( - FSUI_CSTR("WARNING: Activating game patches can cause unpredictable behavior, crashing, soft-locks, or broken " - "saved games."), + FSUI_ICONSTR(ICON_EMOJI_WARNING, + "WARNING: Activating game patches can cause unpredictable behavior, crashing, soft-locks, or broken " + "saved games."), false, false, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY); if (code_list.empty()) { - ActiveButton(FSUI_CSTR("No patches are available for this game."), false, false, + ActiveButton(FSUI_ICONSTR(ICON_FA_STORE_ALT_SLASH, "No patches are available for this game."), false, false, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY); } else diff --git a/src/util/imgui_glyph_ranges.inl b/src/util/imgui_glyph_ranges.inl index bba76e3b4..2b4f19a4f 100644 --- a/src/util/imgui_glyph_ranges.inl +++ b/src/util/imgui_glyph_ranges.inl @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin // SPDX-License-Identifier: CC-BY-NC-ND-4.0 -static constexpr ImWchar FA_ICON_RANGE[] = { 0xe06f,0xe06f,0xe086,0xe086,0xf002,0xf002,0xf005,0xf005,0xf007,0xf007,0xf00c,0xf00e,0xf011,0xf011,0xf013,0xf013,0xf017,0xf017,0xf019,0xf019,0xf01c,0xf01c,0xf021,0xf021,0xf023,0xf023,0xf025,0xf026,0xf028,0xf028,0xf02e,0xf02e,0xf030,0xf030,0xf03a,0xf03a,0xf03d,0xf03d,0xf04a,0xf04c,0xf050,0xf050,0xf056,0xf056,0xf05e,0xf05e,0xf062,0xf063,0xf065,0xf067,0xf071,0xf071,0xf075,0xf075,0xf077,0xf078,0xf07b,0xf07c,0xf083,0xf085,0xf091,0xf091,0xf0ac,0xf0ae,0xf0b2,0xf0b2,0xf0c3,0xf0c3,0xf0c5,0xf0c5,0xf0c7,0xf0c9,0xf0cb,0xf0cb,0xf0d0,0xf0d0,0xf0dc,0xf0dc,0xf0e0,0xf0e0,0xf0e2,0xf0e2,0xf0e7,0xf0e8,0xf0eb,0xf0eb,0xf0f1,0xf0f1,0xf0f3,0xf0f3,0xf0fe,0xf0fe,0xf110,0xf110,0xf119,0xf119,0xf11b,0xf11c,0xf140,0xf140,0xf146,0xf146,0xf14a,0xf14a,0xf15b,0xf15d,0xf191,0xf192,0xf1ab,0xf1ab,0xf1c5,0xf1c5,0xf1dd,0xf1de,0xf1e6,0xf1e6,0xf1eb,0xf1eb,0xf1f8,0xf1f8,0xf1fb,0xf1fc,0xf201,0xf201,0xf240,0xf240,0xf242,0xf242,0xf245,0xf245,0xf26c,0xf26c,0xf279,0xf279,0xf2c1,0xf2c1,0xf2d0,0xf2d0,0xf2db,0xf2db,0xf2f1,0xf2f2,0xf302,0xf302,0xf31e,0xf31e,0xf338,0xf338,0xf35d,0xf35d,0xf360,0xf360,0xf362,0xf362,0xf3fd,0xf3fd,0xf410,0xf410,0xf422,0xf422,0xf424,0xf424,0xf462,0xf462,0xf466,0xf466,0xf4ce,0xf4ce,0xf500,0xf500,0xf51f,0xf51f,0xf538,0xf538,0xf53f,0xf53f,0xf545,0xf545,0xf547,0xf548,0xf54c,0xf54c,0xf55b,0xf55b,0xf55d,0xf55d,0xf565,0xf565,0xf56e,0xf570,0xf575,0xf575,0xf5a2,0xf5a2,0xf5aa,0xf5aa,0xf5c7,0xf5c7,0xf5cb,0xf5cb,0xf5e7,0xf5e7,0xf5ee,0xf5ee,0xf61f,0xf61f,0xf65d,0xf65e,0xf6a9,0xf6a9,0xf6cf,0xf6cf,0xf70c,0xf70c,0xf70e,0xf70e,0xf78c,0xf78c,0xf794,0xf794,0xf7a0,0xf7a0,0xf7a4,0xf7a5,0xf7c2,0xf7c2,0xf807,0xf807,0xf815,0xf815,0xf818,0xf818,0xf84c,0xf84c,0xf87d,0xf87d,0xf8cc,0xf8cc,0x0,0x0 }; +static constexpr ImWchar FA_ICON_RANGE[] = { 0xe06f,0xe070,0xe086,0xe086,0xf002,0xf002,0xf005,0xf005,0xf007,0xf007,0xf00c,0xf00e,0xf011,0xf011,0xf013,0xf013,0xf017,0xf017,0xf019,0xf019,0xf01c,0xf01c,0xf021,0xf021,0xf023,0xf023,0xf025,0xf026,0xf028,0xf028,0xf02e,0xf02e,0xf030,0xf030,0xf03a,0xf03a,0xf03d,0xf03d,0xf04a,0xf04c,0xf050,0xf050,0xf056,0xf056,0xf05e,0xf05e,0xf062,0xf063,0xf065,0xf067,0xf071,0xf071,0xf075,0xf075,0xf077,0xf078,0xf07b,0xf07c,0xf083,0xf085,0xf091,0xf091,0xf0ac,0xf0ae,0xf0b2,0xf0b2,0xf0c3,0xf0c3,0xf0c5,0xf0c5,0xf0c7,0xf0c9,0xf0cb,0xf0cb,0xf0d0,0xf0d0,0xf0dc,0xf0dc,0xf0e0,0xf0e0,0xf0e2,0xf0e2,0xf0e7,0xf0e8,0xf0eb,0xf0eb,0xf0f1,0xf0f1,0xf0f3,0xf0f3,0xf0fe,0xf0fe,0xf110,0xf110,0xf119,0xf119,0xf11b,0xf11c,0xf140,0xf140,0xf146,0xf146,0xf14a,0xf14a,0xf15b,0xf15d,0xf191,0xf192,0xf1ab,0xf1ab,0xf1c0,0xf1c0,0xf1c5,0xf1c5,0xf1de,0xf1de,0xf1e6,0xf1e6,0xf1eb,0xf1eb,0xf1f8,0xf1f8,0xf1fb,0xf1fc,0xf201,0xf201,0xf240,0xf240,0xf242,0xf242,0xf245,0xf245,0xf26c,0xf26c,0xf279,0xf279,0xf2c1,0xf2c1,0xf2d0,0xf2d0,0xf2db,0xf2db,0xf2f1,0xf2f2,0xf302,0xf302,0xf31e,0xf31e,0xf338,0xf338,0xf35d,0xf35d,0xf360,0xf360,0xf362,0xf362,0xf3fd,0xf3fd,0xf410,0xf410,0xf422,0xf422,0xf424,0xf424,0xf462,0xf462,0xf466,0xf466,0xf4ce,0xf4ce,0xf500,0xf500,0xf51f,0xf51f,0xf538,0xf538,0xf53f,0xf53f,0xf545,0xf545,0xf547,0xf548,0xf54c,0xf54c,0xf55b,0xf55b,0xf55d,0xf55d,0xf565,0xf565,0xf56e,0xf570,0xf575,0xf575,0xf5a2,0xf5a2,0xf5aa,0xf5aa,0xf5c7,0xf5c7,0xf5cb,0xf5cb,0xf5e7,0xf5e7,0xf5ee,0xf5ee,0xf61f,0xf61f,0xf65d,0xf65e,0xf6a9,0xf6a9,0xf6cf,0xf6cf,0xf70c,0xf70c,0xf70e,0xf70e,0xf78c,0xf78c,0xf794,0xf794,0xf7a0,0xf7a0,0xf7a4,0xf7a5,0xf7c2,0xf7c2,0xf807,0xf807,0xf815,0xf815,0xf818,0xf818,0xf84c,0xf84c,0xf87d,0xf87d,0xf8cc,0xf8cc,0x0,0x0 }; static constexpr ImWchar PF_ICON_RANGE[] = { 0x2196,0x2199,0x219e,0x21a1,0x21b0,0x21b3,0x21ba,0x21c3,0x21c7,0x21ca,0x21d0,0x21d4,0x21dc,0x21dd,0x21e0,0x21e3,0x21ed,0x21ee,0x21f7,0x21f8,0x21fa,0x21fb,0x227a,0x227f,0x2284,0x2284,0x2349,0x2349,0x235e,0x235e,0x2360,0x2361,0x2364,0x2366,0x23b2,0x23b4,0x23ce,0x23ce,0x23f4,0x23f7,0x2427,0x243a,0x243c,0x243e,0x2460,0x246b,0x248f,0x248f,0x24f5,0x24fd,0x24ff,0x24ff,0x2717,0x2717,0x278a,0x278e,0x27fc,0x27fc,0xe001,0xe001,0xff21,0xff3a,0x1f52b,0x1f52b,0x0,0x0 };