System: Change "Auto Load Cheats" to "Enable Cheats"

This commit is contained in:
Stenzek 2024-03-03 13:43:04 +10:00
parent f4ffaa1e3c
commit e2024f6175
No known key found for this signature in database
20 changed files with 235 additions and 210 deletions

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#define IMGUI_DEFINE_MATH_OPERATORS
@ -1033,7 +1033,7 @@ void FullscreenUI::DoCheatsMenu()
if (cc.activation == CheatCode::Activation::Manual)
cl->ApplyCode(static_cast<u32>(index));
else
System::SetCheatCodeState(static_cast<u32>(index), checked, true);
System::SetCheatCodeState(static_cast<u32>(index), checked);
};
OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_FROWN, "Cheat List"), true, std::move(options), std::move(callback));
}
@ -2709,16 +2709,10 @@ void FullscreenUI::DrawInterfaceSettingsPage()
bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Inhibit Screensaver"),
FSUI_CSTR("Prevents the screen saver from activating and the host from sleeping while emulation is running."),
"Main", "InhibitScreensaver", true);
DrawToggleSetting(
bsi, FSUI_ICONSTR(ICON_FA_GAMEPAD, "Load Devices From Save States"),
FSUI_CSTR("When enabled, memory cards and controllers will be overwritten when save states are loaded."), "Main",
"LoadDevicesFromSaveStates", false);
DrawToggleSetting(
bsi, FSUI_ICONSTR(ICON_FA_COGS, "Apply Per-Game Settings"),
FSUI_CSTR("When enabled, per-game settings will be applied, and incompatible enhancements will be disabled."),
"Main", "ApplyGameSettings", true);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_FROWN, "Automatically Load Cheats"),
FSUI_CSTR("Automatically loads and applies cheats on game start."), "Main", "AutoLoadCheats", true);
if (DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_PAINT_BRUSH, "Use Light Theme"),
FSUI_CSTR("Uses a light coloured theme instead of the default dark theme."), "Main",
"UseLightFullscreenUITheme", false))
@ -2903,22 +2897,30 @@ void FullscreenUI::DrawConsoleSettingsPage()
MenuHeading(FSUI_CSTR("Console Settings"));
DrawEnumSetting(bsi, FSUI_CSTR("Region"), FSUI_CSTR("Determines the emulated hardware type."), "Console", "Region",
Settings::DEFAULT_CONSOLE_REGION, &Settings::ParseConsoleRegionName, &Settings::GetConsoleRegionName,
&Settings::GetConsoleRegionDisplayName, ConsoleRegion::Count);
DrawEnumSetting(bsi, FSUI_ICONSTR(ICON_FA_GLOBE, "Region"), FSUI_CSTR("Determines the emulated hardware type."),
"Console", "Region", Settings::DEFAULT_CONSOLE_REGION, &Settings::ParseConsoleRegionName,
&Settings::GetConsoleRegionName, &Settings::GetConsoleRegionDisplayName, ConsoleRegion::Count);
DrawToggleSetting(
bsi, FSUI_CSTR("Enable 8MB RAM"),
bsi, FSUI_ICONSTR(ICON_FA_MEMORY, "Enable 8MB RAM"),
FSUI_CSTR("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles."),
"Console", "Enable8MBRAM", false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Disable All Enhancements"),
FSUI_CSTR("Temporarily disables all enhancements, useful when testing."), "Main",
"DisableAllEnhancements", false);
DrawToggleSetting(
bsi, FSUI_ICONSTR(ICON_FA_FROWN, "Enable Cheats"),
FSUI_CSTR("Automatically loads and applies cheats on game start. Cheats can break games and saves."), "Console",
"EnableCheats", false);
MenuHeading(FSUI_CSTR("CPU Emulation"));
DrawEnumSetting(bsi, FSUI_CSTR("Execution Mode"), FSUI_CSTR("Determines how the emulated CPU executes instructions."),
"CPU", "ExecutionMode", Settings::DEFAULT_CPU_EXECUTION_MODE, &Settings::ParseCPUExecutionMode,
DrawEnumSetting(bsi, FSUI_ICONSTR(ICON_FA_BOLT, "Execution Mode"),
FSUI_CSTR("Determines how the emulated CPU executes instructions."), "CPU", "ExecutionMode",
Settings::DEFAULT_CPU_EXECUTION_MODE, &Settings::ParseCPUExecutionMode,
&Settings::GetCPUExecutionModeName, &Settings::GetCPUExecutionModeDisplayName,
CPUExecutionMode::Count);
DrawToggleSetting(bsi, FSUI_CSTR("Enable Overclocking"),
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_TACHOMETER_ALT, "Enable Overclocking"),
FSUI_CSTR("When this option is chosen, the clock speed set below will be used."), "CPU",
"OverclockEnable", false);
@ -2939,37 +2941,34 @@ void FullscreenUI::DrawConsoleSettingsPage()
}
}
DrawToggleSetting(bsi, FSUI_CSTR("Enable Recompiler ICache"),
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MICROCHIP, "Enable Recompiler ICache"),
FSUI_CSTR("Makes games run closer to their console framerate, at a small cost to performance."),
"CPU", "RecompilerICache", false);
MenuHeading(FSUI_CSTR("CD-ROM Emulation"));
DrawIntListSetting(
bsi, FSUI_CSTR("Read Speedup"),
bsi, FSUI_ICONSTR(ICON_FA_COMPACT_DISC, "Read Speedup"),
FSUI_CSTR(
"Speeds up CD-ROM reads by the specified factor. May improve loading speeds in some games, and break others."),
"CDROM", "ReadSpeedup", 1, cdrom_read_speeds.data(), cdrom_read_speeds.size(), true, 1);
DrawIntListSetting(
bsi, FSUI_CSTR("Seek Speedup"),
bsi, FSUI_ICONSTR(ICON_FA_SEARCH, "Seek Speedup"),
FSUI_CSTR(
"Speeds up CD-ROM seeks by the specified factor. May improve loading speeds in some games, and break others."),
"CDROM", "SeekSpeedup", 1, cdrom_seek_speeds.data(), cdrom_seek_speeds.size(), true);
DrawIntRangeSetting(
bsi, FSUI_CSTR("Readahead Sectors"),
bsi, FSUI_ICONSTR(ICON_FA_FAST_FORWARD, "Readahead Sectors"),
FSUI_CSTR("Reduces hitches in emulation by reading/decompressing CD data asynchronously on a worker thread."),
"CDROM", "ReadaheadSectors", Settings::DEFAULT_CDROM_READAHEAD_SECTORS, 0, 32, "%d sectors");
DrawToggleSetting(bsi, FSUI_CSTR("Enable Region Check"),
FSUI_CSTR("Simulates the region check present in original, unmodified consoles."), "CDROM",
"RegionCheck", false);
DrawToggleSetting(
bsi, FSUI_CSTR("Preload Images to RAM"),
bsi, FSUI_ICONSTR(ICON_FA_DOWNLOAD, "Preload Images to RAM"),
FSUI_CSTR("Loads the game image into RAM. Useful for network paths that may become unreliable during gameplay."),
"CDROM", "LoadImageToRAM", false);
DrawToggleSetting(
bsi, FSUI_CSTR("Apply Image Patches"),
bsi, FSUI_ICONSTR(ICON_FA_VEST_PATCHES, "Apply Image Patches"),
FSUI_CSTR("Automatically applies patches to disc images when they are present, currently only PPF is supported."),
"CDROM", "LoadImagePatches", false);
@ -4654,10 +4653,6 @@ void FullscreenUI::DrawAdvancedSettingsPage()
MenuHeading(FSUI_CSTR("Debugging Settings"));
DrawToggleSetting(bsi, FSUI_CSTR("Disable All Enhancements"),
FSUI_CSTR("Temporarily disables all enhancements, useful when testing."), "Main",
"DisableAllEnhancements", false);
DrawToggleSetting(bsi, FSUI_CSTR("Use Debug GPU Device"),
FSUI_CSTR("Enable debugging when supported by the host's renderer API. Only for developer use."),
"GPU", "UseDebugDevice", false);
@ -4675,6 +4670,10 @@ void FullscreenUI::DrawAdvancedSettingsPage()
DrawToggleSetting(bsi, FSUI_CSTR("Create Save State Backups"),
FSUI_CSTR("Renames existing save states when saving to a backup file."), "Main",
"CreateSaveStateBackups", false);
DrawToggleSetting(
bsi, FSUI_ICONSTR(ICON_FA_GAMEPAD, "Load Devices From Save States"),
FSUI_CSTR("When enabled, memory cards and controllers will be overwritten when save states are loaded."), "Main",
"LoadDevicesFromSaveStates", false);
MenuHeading(FSUI_CSTR("Display Settings"));
DrawToggleSetting(bsi, FSUI_CSTR("Show Status Indicators"),
@ -4740,6 +4739,12 @@ void FullscreenUI::DrawAdvancedSettingsPage()
"FastmemMode", Settings::DEFAULT_CPU_FASTMEM_MODE, &Settings::ParseCPUFastmemMode,
&Settings::GetCPUFastmemModeName, &Settings::GetCPUFastmemModeDisplayName, CPUFastmemMode::Count);
MenuHeading(FSUI_CSTR("CD-ROM Emulation"));
DrawToggleSetting(bsi, FSUI_CSTR("Enable Region Check"),
FSUI_CSTR("Simulates the region check present in original, unmodified consoles."), "CDROM",
"RegionCheck", false);
EndMenuButtons();
}
@ -4891,7 +4896,7 @@ void FullscreenUI::DrawPauseMenu()
}
if (ActiveButton(FSUI_ICONSTR(ICON_FA_FROWN_OPEN, "Cheat List"), false,
!System::GetGameSerial().empty() && !Achievements::IsHardcoreModeActive()))
!System::GetGameSerial().empty() && g_settings.enable_cheats))
{
s_current_main_window = MainWindowType::None;
DoCheatsMenu();
@ -6575,9 +6580,8 @@ TRANSLATE_NOOP("FullscreenUI", "Automatic based on window size");
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping completed for {}.");
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping failed for {}.");
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping failed, no devices are available.");
TRANSLATE_NOOP("FullscreenUI", "Automatically Load Cheats");
TRANSLATE_NOOP("FullscreenUI", "Automatically applies patches to disc images when they are present, currently only PPF is supported.");
TRANSLATE_NOOP("FullscreenUI", "Automatically loads and applies cheats on game start.");
TRANSLATE_NOOP("FullscreenUI", "Automatically loads and applies cheats on game start. Cheats can break games and saves.");
TRANSLATE_NOOP("FullscreenUI", "Automatically saves the emulator state when powering down or exiting. You can then resume directly from where you left off next time.");
TRANSLATE_NOOP("FullscreenUI", "Automatically switches to fullscreen mode when the program is started.");
TRANSLATE_NOOP("FullscreenUI", "Avoids calls to C++ code, significantly speeding up the recompiler.");
@ -6691,6 +6695,7 @@ TRANSLATE_NOOP("FullscreenUI", "Emulation Settings");
TRANSLATE_NOOP("FullscreenUI", "Emulation Speed");
TRANSLATE_NOOP("FullscreenUI", "Enable 8MB RAM");
TRANSLATE_NOOP("FullscreenUI", "Enable Achievements");
TRANSLATE_NOOP("FullscreenUI", "Enable Cheats");
TRANSLATE_NOOP("FullscreenUI", "Enable Discord Presence");
TRANSLATE_NOOP("FullscreenUI", "Enable Fast Boot");
TRANSLATE_NOOP("FullscreenUI", "Enable In-Game Overlays");
@ -6706,7 +6711,6 @@ TRANSLATE_NOOP("FullscreenUI", "Enable SDL Input Source");
TRANSLATE_NOOP("FullscreenUI", "Enable Subdirectory Scanning");
TRANSLATE_NOOP("FullscreenUI", "Enable TTY Logging");
TRANSLATE_NOOP("FullscreenUI", "Enable VRAM Write Texture Replacement");
TRANSLATE_NOOP("FullscreenUI", "Enable VSync");
TRANSLATE_NOOP("FullscreenUI", "Enable XInput Input Source");
TRANSLATE_NOOP("FullscreenUI", "Enable debugging when supported by the host's renderer API. Only for developer use.");
TRANSLATE_NOOP("FullscreenUI", "Enables alignment and bus exceptions. Not needed for any known games.");
@ -7075,6 +7079,7 @@ TRANSLATE_NOOP("FullscreenUI", "Uses game-specific settings for controllers for
TRANSLATE_NOOP("FullscreenUI", "Uses perspective-correct interpolation for colors, which can improve visuals in some games.");
TRANSLATE_NOOP("FullscreenUI", "Uses perspective-correct interpolation for texture coordinates, straightening out warped textures.");
TRANSLATE_NOOP("FullscreenUI", "Uses screen positions to resolve PGXP data. May improve visuals in some games.");
TRANSLATE_NOOP("FullscreenUI", "VSync");
TRANSLATE_NOOP("FullscreenUI", "Value: {} | Default: {} | Minimum: {} | Maximum: {}");
TRANSLATE_NOOP("FullscreenUI", "When enabled and logged in, DuckStation will scan for achievements on startup.");
TRANSLATE_NOOP("FullscreenUI", "When enabled, DuckStation will assume all achievements are locked and not send any unlock notifications to the server.");

View File

@ -151,7 +151,7 @@ void Settings::Load(SettingsInterface& si)
load_devices_from_save_states = si.GetBoolValue("Main", "LoadDevicesFromSaveStates", false);
apply_compatibility_settings = si.GetBoolValue("Main", "ApplyCompatibilitySettings", true);
apply_game_settings = si.GetBoolValue("Main", "ApplyGameSettings", true);
auto_load_cheats = si.GetBoolValue("Main", "AutoLoadCheats", true);
enable_cheats = si.GetBoolValue("Console", "EnableCheats", false);
disable_all_enhancements = si.GetBoolValue("Main", "DisableAllEnhancements", false);
enable_discord_presence = si.GetBoolValue("Main", "EnableDiscordPresence", false);
rewind_enable = si.GetBoolValue("Main", "RewindEnable", false);
@ -444,7 +444,7 @@ void Settings::Save(SettingsInterface& si) const
si.SetBoolValue("Main", "LoadDevicesFromSaveStates", load_devices_from_save_states);
si.SetBoolValue("Main", "ApplyCompatibilitySettings", apply_compatibility_settings);
si.SetBoolValue("Main", "ApplyGameSettings", apply_game_settings);
si.SetBoolValue("Main", "AutoLoadCheats", auto_load_cheats);
si.SetBoolValue("Console", "EnableCheats", enable_cheats);
si.SetBoolValue("Main", "DisableAllEnhancements", disable_all_enhancements);
si.SetBoolValue("Main", "EnableDiscordPresence", enable_discord_presence);
si.SetBoolValue("Main", "RewindEnable", rewind_enable);
@ -728,7 +728,7 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages)
(g_settings.fast_forward_speed != 0.0f) ? std::max(g_settings.fast_forward_speed, 1.0f) : 0.0f;
g_settings.turbo_speed = (g_settings.turbo_speed != 0.0f) ? std::max(g_settings.turbo_speed, 1.0f) : 0.0f;
g_settings.rewind_enable = false;
g_settings.auto_load_cheats = false;
g_settings.enable_cheats = false;
if (g_settings.cpu_overclock_enable && g_settings.GetCPUOverclockPercent() < 100)
{
g_settings.cpu_overclock_enable = false;

View File

@ -87,7 +87,7 @@ struct Settings
bool load_devices_from_save_states : 1 = false;
bool apply_compatibility_settings : 1 = true;
bool apply_game_settings : 1 = true;
bool auto_load_cheats : 1 = true;
bool enable_cheats : 1 = true;
bool disable_all_enhancements : 1 = false;
bool enable_discord_presence : 1 = false;
@ -518,6 +518,8 @@ struct Settings
#endif
static constexpr AudioStretchMode DEFAULT_AUDIO_STRETCH_MODE = AudioStretchMode::TimeStretch;
static constexpr bool DEFAULT_SAVE_STATE_COMPRESSION = true;
// Enable console logging by default on Linux platforms.
#if defined(__linux__) && !defined(__ANDROID__)
static constexpr bool DEFAULT_LOG_TO_CONSOLE = true;
@ -527,12 +529,10 @@ struct Settings
// Android doesn't create settings until they're first opened, so we have to override the defaults here.
#ifndef __ANDROID__
static constexpr bool DEFAULT_SAVE_STATE_COMPRESSION = true;
static constexpr bool DEFAULT_SAVE_STATE_BACKUPS = true;
static constexpr bool DEFAULT_FAST_BOOT_VALUE = false;
static constexpr float DEFAULT_DISPLAY_MAX_FPS = 0.0f;
#else
static constexpr bool DEFAULT_SAVE_STATE_COMPRESSION = true;
static constexpr bool DEFAULT_SAVE_STATE_BACKUPS = false;
static constexpr bool DEFAULT_FAST_BOOT_VALUE = true;
static constexpr float DEFAULT_DISPLAY_MAX_FPS = 60.0f;

View File

@ -3400,8 +3400,8 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting)
ApplySettings(true);
s_cheat_list.reset();
if (g_settings.auto_load_cheats && !Achievements::IsHardcoreModeActive())
LoadCheatListFromGameTitle();
if (g_settings.enable_cheats)
LoadCheatList();
if (s_running_game_serial != prev_serial)
UpdateSessionTime(prev_serial);
@ -3655,6 +3655,14 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
CPU::ClearICache();
}
if (g_settings.enable_cheats != old_settings.enable_cheats)
{
if (g_settings.enable_cheats)
LoadCheatList();
else
s_cheat_list.reset();
}
SPU::GetOutputStream()->SetOutputVolume(GetAudioOutputVolume());
if (g_settings.gpu_resolution_scale != old_settings.gpu_resolution_scale ||
@ -4534,15 +4542,20 @@ std::string System::GetCheatFileName()
return ret;
}
bool System::LoadCheatList(const char* filename)
bool System::LoadCheatList()
{
if (System::IsShutdown())
// Called when booting, needs to test for shutdown.
if (IsShutdown() || !g_settings.enable_cheats)
return false;
const std::string filename(GetCheatFileName());
if (filename.empty() || !FileSystem::FileExists(filename.c_str()))
return false;
std::unique_ptr<CheatList> cl = std::make_unique<CheatList>();
if (!cl->LoadFromFile(filename, CheatList::Format::Autodetect))
if (!cl->LoadFromFile(filename.c_str(), CheatList::Format::Autodetect))
{
Host::AddFormattedOSDMessage(15.0f, TRANSLATE("OSDMessage", "Failed to load cheats from '%s'."), filename);
Host::AddFormattedOSDMessage(15.0f, TRANSLATE("OSDMessage", "Failed to load cheats from '%s'."), filename.c_str());
return false;
}
@ -4558,19 +4571,6 @@ bool System::LoadCheatList(const char* filename)
return true;
}
bool System::LoadCheatListFromGameTitle()
{
// Called when booting, needs to test for shutdown.
if (IsShutdown() || Achievements::IsHardcoreModeActive())
return false;
const std::string filename(GetCheatFileName());
if (filename.empty() || !FileSystem::FileExists(filename.c_str()))
return false;
return LoadCheatList(filename.c_str());
}
bool System::LoadCheatListFromDatabase()
{
if (IsShutdown() || s_running_game_serial.empty() || Achievements::IsHardcoreModeActive())
@ -4650,7 +4650,7 @@ void System::ClearCheatList(bool save_to_file)
SaveCheatList();
}
void System::SetCheatCodeState(u32 index, bool enabled, bool save_to_file)
void System::SetCheatCodeState(u32 index, bool enabled)
{
if (!System::IsValid() || !System::HasCheatList())
return;
@ -4676,8 +4676,7 @@ void System::SetCheatCodeState(u32 index, bool enabled, bool save_to_file)
Host::AddFormattedOSDMessage(5.0f, TRANSLATE("OSDMessage", "Cheat '%s' disabled."), cc.description.c_str());
}
if (save_to_file)
SaveCheatList();
SaveCheatList();
}
void System::ApplyCheatCode(u32 index)

View File

@ -421,11 +421,8 @@ bool SaveScreenshot(const char* filename = nullptr, DisplayScreenshotMode mode =
DisplayScreenshotFormat format = g_settings.display_screenshot_format,
u8 quality = g_settings.display_screenshot_quality, bool compress_on_thread = true);
/// Loads the cheat list from the specified file.
bool LoadCheatList(const char* filename);
/// Loads the cheat list for the current game title from the user directory.
bool LoadCheatListFromGameTitle();
bool LoadCheatList();
/// Loads the cheat list for the current game code from the built-in code database.
bool LoadCheatListFromDatabase();
@ -443,7 +440,7 @@ bool DeleteCheatList();
void ClearCheatList(bool save_to_file);
/// Enables/disabled the specified cheat code.
void SetCheatCodeState(u32 index, bool enabled, bool save_to_file);
void SetCheatCodeState(u32 index, bool enabled);
/// Immediately applies the specified cheat code.
void ApplyCheatCode(u32 index);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>674</width>
<height>481</height>
<height>420</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -249,25 +249,6 @@ Login token generated at:</string>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;DuckStation uses RetroAchievements as an achievement database and for tracking progress. To use achievements, please sign up for an account at &lt;a href=&quot;https://retroachievements.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;retroachievements.org&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;To view the achievement list in-game, press the hotkey for &lt;span style=&quot; font-weight:600;&quot;&gt;Open Pause Menu&lt;/span&gt; and select &lt;span style=&quot; font-weight:600;&quot;&gt;Achievements&lt;/span&gt; from the menu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>8</number>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

View File

@ -213,6 +213,10 @@ void AdvancedSettingsWidget::addTweakOptions()
"ApplyCompatibilitySettings", true);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Increase Timer Resolution"), "Main",
"IncreaseTimerResolution", true);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Load Devices From Save States"), "Main",
"LoadDevicesFromSaveStates", false);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Compress Save States"), "Main", "CompressSaveStates",
Settings::DEFAULT_SAVE_STATE_COMPRESSION);
if (m_dialog->isPerGameSettings())
{
@ -248,6 +252,7 @@ void AdvancedSettingsWidget::addTweakOptions()
Settings::ParseCDROMMechVersionName, Settings::GetCDROMMechVersionName,
Settings::GetCDROMMechVersionDisplayName, static_cast<u8>(CDROMMechaconVersion::Count),
Settings::DEFAULT_CDROM_MECHACON_VERSION);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("CD-ROM Region Check"), "CDROM", "RegionCheck", false);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Allow Booting Without SBI File"), "CDROM",
"AllowBootingWithoutSBIFile", false);
@ -262,8 +267,10 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
{
int i = 0;
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Apply compatibility settings
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Increase Timer Resolution
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Apply compatibility settings
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Increase Timer Resolution
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Load Devices From Save States
setBooleanTweakOption(m_ui.tweakOptionTable, i++, Settings::DEFAULT_SAVE_STATE_COMPRESSION); // Compress Save States
setIntRangeTweakOption(m_ui.tweakOptionTable, i++,
static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); // DMA max slice ticks
setIntRangeTweakOption(m_ui.tweakOptionTable, i++,
@ -278,6 +285,7 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
Settings::DEFAULT_CPU_FASTMEM_MODE); // Recompiler fastmem mode
setChoiceTweakOption(m_ui.tweakOptionTable, i++,
Settings::DEFAULT_CDROM_MECHACON_VERSION); // CDROM Mechacon Version
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // CDROM Region Check
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Allow booting without SBI file
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes
@ -290,6 +298,8 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
SettingsInterface* sif = m_dialog->getSettingsInterface();
sif->DeleteValue("Main", "ApplyCompatibilitySettings");
sif->DeleteValue("Main", "IncreaseTimerResolution");
sif->DeleteValue("Main", "LoadDevicesFromSaveStates");
sif->DeleteValue("Main", "CompressSaveStates");
sif->DeleteValue("Display", "ActiveStartOffset");
sif->DeleteValue("Display", "ActiveEndOffset");
sif->DeleteValue("Display", "LineStartOffset");
@ -302,6 +312,7 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
sif->DeleteValue("CPU", "RecompilerBlockLinking");
sif->DeleteValue("CPU", "FastmemMode");
sif->DeleteValue("CDROM", "MechaconVersion");
sif->DeleteValue("CDROM", "RegionCheck");
sif->DeleteValue("CDROM", "AllowBootingWithoutSBIFile");
sif->DeleteValue("PCDrv", "Enabled");
sif->DeleteValue("PCDrv", "EnableWrites");

View File

@ -344,7 +344,7 @@ CheatList* CheatManagerDialog::getCheatList() const
CheatList* list = System::GetCheatList();
if (!list)
{
System::LoadCheatListFromGameTitle();
System::LoadCheatList();
list = System::GetCheatList();
}
if (!list)

View File

@ -42,6 +42,7 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enable8MBRAM, "Console", "Enable8MBRAM", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableAllEnhancements, "Main", "DisableAllEnhancements",
false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableCheats, "Console", "EnableCheats", false);
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.cpuExecutionMode, "CPU", "ExecutionMode",
&Settings::ParseCPUExecutionMode, &Settings::GetCPUExecutionModeName,
Settings::DEFAULT_CPU_EXECUTION_MODE);
@ -49,7 +50,6 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.recompilerICache, "CPU", "RecompilerICache", false);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.cdromReadaheadSectors, "CDROM", "ReadaheadSectors",
Settings::DEFAULT_CDROM_READAHEAD_SECTORS);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromRegionCheck, "CDROM", "RegionCheck", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromLoadImageToRAM, "CDROM", "LoadImageToRAM", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromLoadImagePatches, "CDROM", "LoadImagePatches", false);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.cdromSeekSpeedup, "CDROM", "SeekSpeedup", 1);
@ -93,8 +93,6 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
tr("Reduces hitches in emulation by reading/decompressing CD data asynchronously on a "
"worker thread. Higher sector numbers can reduce spikes when streaming FMVs or audio "
"on slower storage or when using compression formats such as CHD."));
dialog->registerWidgetHelp(m_ui.cdromRegionCheck, tr("Enable Region Check"), tr("Checked"),
tr("Simulates the region check present in original, unmodified consoles."));
dialog->registerWidgetHelp(
m_ui.cdromLoadImageToRAM, tr("Preload Image to RAM"), tr("Unchecked"),
tr("Loads the game image into RAM. Useful for network paths that may become unreliable during gameplay. In some "

View File

@ -41,6 +41,13 @@
</item>
<item row="1" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="QCheckBox" name="disableAllEnhancements">
<property name="text">
<string>Disable All Enhancements</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="enable8MBRAM">
<property name="text">
@ -48,10 +55,10 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="disableAllEnhancements">
<item row="1" column="0">
<widget class="QCheckBox" name="enableCheats">
<property name="text">
<string>Disable All Enhancements</string>
<string>Enable Cheats</string>
</property>
</widget>
</item>
@ -287,13 +294,6 @@
</item>
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QCheckBox" name="cdromRegionCheck">
<property name="text">
<string>Enable Region Check</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="cdromLoadImageToRAM">
<property name="text">
@ -301,7 +301,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="1">
<widget class="QCheckBox" name="cdromLoadImagePatches">
<property name="text">
<string>Apply Image Patches</string>

View File

@ -37,10 +37,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnStart, "Main", "StartPaused", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnExit, "Main", "SaveStateOnExit", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.confirmPowerOff, "Main", "ConfirmPowerOff", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.loadDevicesFromSaveStates, "Main", "LoadDevicesFromSaveStates",
false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.applyGameSettings, "Main", "ApplyGameSettings", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoLoadCheats, "Main", "AutoLoadCheats", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "Main", "StartFullscreen", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "Main",
@ -52,8 +49,6 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.hideMouseCursor, "Main", "HideCursorInFullscreen", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.createSaveStateBackups, "Main", "CreateSaveStateBackups",
Settings::DEFAULT_SAVE_STATE_BACKUPS);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.compressSaveStates, "Main", "CompressSaveStates",
Settings::DEFAULT_SAVE_STATE_COMPRESSION);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableDiscordPresence, "Main", "EnableDiscordPresence", false);
connect(m_ui.renderToSeparateWindow, &QCheckBox::stateChanged, this,
&InterfaceSettingsWidget::onRenderToSeparateWindowChanged);
@ -88,17 +83,10 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
dialog->registerWidgetHelp(m_ui.pauseOnFocusLoss, tr("Pause On Focus Loss"), tr("Unchecked"),
tr("Pauses the emulator when you minimize the window or switch to another application, "
"and unpauses when you switch back."));
dialog->registerWidgetHelp(
m_ui.loadDevicesFromSaveStates, tr("Load Devices From Save States"), tr("Unchecked"),
tr("When enabled, memory cards and controllers will be overwritten when save states are loaded. This can "
"result in lost saves, and controller type mismatches. For deterministic save states, enable this option, "
"otherwise leave disabled."));
dialog->registerWidgetHelp(
m_ui.applyGameSettings, tr("Apply Per-Game Settings"), tr("Checked"),
tr("When enabled, per-game settings will be applied, and incompatible enhancements will be disabled. You should "
"leave this option enabled except when testing enhancements with incompatible games."));
dialog->registerWidgetHelp(m_ui.autoLoadCheats, tr("Automatically Load Cheats"), tr("Unchecked"),
tr("Automatically loads and applies cheats on game start."));
dialog->registerWidgetHelp(m_ui.enableDiscordPresence, tr("Enable Discord Presence"), tr("Unchecked"),
tr("Shows the game you are currently playing as part of your profile in Discord."));

View File

@ -29,20 +29,6 @@
<string>Behaviour</string>
</property>
<layout class="QGridLayout" name="formLayout_4">
<item row="6" column="1">
<widget class="QCheckBox" name="autoLoadCheats">
<property name="text">
<string>Automatically Load Cheats</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="confirmPowerOff">
<property name="text">
<string>Confirm Power Off</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="saveStateOnExit">
<property name="text">
@ -78,31 +64,24 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="loadDevicesFromSaveStates">
<property name="text">
<string>Load Devices From Save States</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="6" column="1">
<widget class="QCheckBox" name="pauseOnStart">
<property name="text">
<string>Pause On Start</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="enableDiscordPresence">
<item row="3" column="0">
<widget class="QCheckBox" name="confirmPowerOff">
<property name="text">
<string>Enable Discord Presence</string>
<string>Confirm Power Off</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="compressSaveStates">
<widget class="QCheckBox" name="enableDiscordPresence">
<property name="text">
<string>Compress Save States</string>
<string>Enable Discord Presence</string>
</property>
</widget>
</item>

View File

@ -1006,6 +1006,75 @@ void MainWindow::populateChangeDiscSubImageMenu(QMenu* menu, QActionGroup* actio
}
}
void MainWindow::updateCheatActionsVisibility()
{
// If the cheat system is disabled, put an action to enable it in place of the menu under System.
const bool cheats_enabled = Host::GetBoolSettingValue("Console", "EnableCheats", false);
m_ui.actionCheats->setVisible(!cheats_enabled);
m_ui.menuCheats->menuAction()->setVisible(cheats_enabled);
}
void MainWindow::onCheatsActionTriggered()
{
const bool cheats_enabled = Host::GetBoolSettingValue("Console", "EnableCheats", false);
if (cheats_enabled)
{
m_ui.menuCheats->exec(QCursor::pos());
return;
}
SystemLock lock(pauseAndLockSystem());
QMessageBox mb(this);
mb.setWindowTitle(tr("Enable Cheats"));
mb.setText(
tr("Using cheats can have unpredictable effects on games, causing crashes, graphical glitches, and corrupted "
"saves. By using the cheat manager, you agree that it is an unsupported configuration, and we will not "
"provide you with any assistance when games break.\n\nCheats persist through save states even after being "
"disabled, please remember to reset/reboot the game after turning off any codes.\n\nAre you sure you want "
"to continue?"));
mb.setIcon(QMessageBox::Warning);
QPushButton* global = mb.addButton(tr("Enable For All Games"), QMessageBox::DestructiveRole);
QPushButton* game = mb.addButton(tr("Enable For This Game"), QMessageBox::AcceptRole);
game->setEnabled(s_system_valid && !s_current_game_serial.isEmpty());
QPushButton* cancel = mb.addButton(tr("Cancel"), QMessageBox::RejectRole);
mb.setDefaultButton(cancel);
mb.setEscapeButton(cancel);
mb.exec();
if (mb.clickedButton() == global)
{
// enable globally
Host::SetBaseBoolSettingValue("Console", "EnableCheats", true);
Host::CommitBaseSettingChanges();
g_emu_thread->applySettings(false);
}
else if (mb.clickedButton() == game)
{
if (!SettingsWindow::setGameSettingsBoolForSerial(s_current_game_serial.toStdString(), "Console", "EnableCheats",
true))
{
QMessageBox::critical(this, tr("Error"), tr("Failed to enable cheats for %1.").arg(s_current_game_serial));
return;
}
g_emu_thread->reloadGameSettings(false);
}
else
{
// do nothing
return;
}
}
void MainWindow::onCheatsMenuAboutToShow()
{
m_ui.menuCheats->clear();
connect(m_ui.menuCheats->addAction(tr("Cheat Manager")), &QAction::triggered, this,
&MainWindow::onToolsCheatManagerTriggered);
m_ui.menuCheats->addSeparator();
populateCheatsMenu(m_ui.menuCheats);
}
void MainWindow::populateCheatsMenu(QMenu* menu)
{
if (!s_system_valid)
@ -1238,15 +1307,6 @@ void MainWindow::onSaveStateMenuAboutToShow()
populateSaveStateMenu(s_current_game_serial.toUtf8().constData(), m_ui.menuSaveState);
}
void MainWindow::onCheatsMenuAboutToShow()
{
m_ui.menuCheats->clear();
connect(m_ui.menuCheats->addAction(tr("Cheat Manager")), &QAction::triggered, this,
&MainWindow::onToolsCheatManagerTriggered);
m_ui.menuCheats->addSeparator();
populateCheatsMenu(m_ui.menuCheats);
}
void MainWindow::onStartFullscreenUITriggered()
{
if (m_display_widget)
@ -1599,6 +1659,7 @@ void MainWindow::setupAdditionalUi()
m_ui.actionGridViewShowTitles->setChecked(m_game_list_widget->getShowGridCoverTitles());
updateDebugMenuVisibility();
updateCheatActionsVisibility();
for (u32 i = 0; i < static_cast<u32>(CPUExecutionMode::Count); i++)
{
@ -1723,6 +1784,7 @@ void MainWindow::updateEmulationActions(bool starting, bool running, bool cheevo
m_ui.actionPause->setDisabled(starting || !running);
m_ui.actionChangeDisc->setDisabled(starting || !running);
m_ui.actionCheats->setDisabled(starting || !running || cheevos_challenge_mode);
m_ui.actionCheatsToolbar->setDisabled(starting || !running || cheevos_challenge_mode);
m_ui.actionScreenshot->setDisabled(starting || !running);
m_ui.menuChangeDisc->setDisabled(starting || !running);
m_ui.menuCheats->setDisabled(starting || !running || cheevos_challenge_mode);
@ -1964,7 +2026,8 @@ void MainWindow::connectSignals()
connect(m_ui.menuLoadState, &QMenu::aboutToShow, this, &MainWindow::onLoadStateMenuAboutToShow);
connect(m_ui.menuSaveState, &QMenu::aboutToShow, this, &MainWindow::onSaveStateMenuAboutToShow);
connect(m_ui.menuCheats, &QMenu::aboutToShow, this, &MainWindow::onCheatsMenuAboutToShow);
connect(m_ui.actionCheats, &QAction::triggered, [this] { m_ui.menuCheats->exec(QCursor::pos()); });
connect(m_ui.actionCheats, &QAction::triggered, this, &MainWindow::onCheatsActionTriggered);
connect(m_ui.actionCheatsToolbar, &QAction::triggered, this, &MainWindow::onCheatsActionTriggered);
connect(m_ui.actionStartFullscreenUI, &QAction::triggered, this, &MainWindow::onStartFullscreenUITriggered);
connect(m_ui.actionStartFullscreenUI2, &QAction::triggered, this, &MainWindow::onStartFullscreenUITriggered);
connect(m_ui.actionRemoveDisc, &QAction::triggered, this, &MainWindow::onRemoveDiscActionTriggered);
@ -2698,6 +2761,7 @@ void MainWindow::checkForSettingChanges()
{
LogWindow::updateSettings();
updateWindowState();
updateCheatActionsVisibility();
}
std::optional<WindowInfo> MainWindow::getWindowInfo()
@ -2828,38 +2892,18 @@ void MainWindow::onToolsCoverDownloaderTriggered()
void MainWindow::onToolsCheatManagerTriggered()
{
if (!m_cheat_manager_dialog)
{
if (Host::GetBaseBoolSettingValue("UI", "DisplayCheatWarning", true))
{
QCheckBox* cb = new QCheckBox(tr("Do not show again"));
QMessageBox mb(this);
mb.setWindowTitle(tr("Cheat Manager"));
mb.setText(
tr("Using cheats can have unpredictable effects on games, causing crashes, graphical glitches, and corrupted "
"saves. By using the cheat manager, you agree that it is an unsupported configuration, and we will not "
"provide you with any assistance when games break.\n\nCheats persist through save states even after being "
"disabled, please remember to reset/reboot the game after turning off any codes.\n\nAre you sure you want "
"to continue?"));
mb.setIcon(QMessageBox::Warning);
mb.addButton(QMessageBox::Yes);
mb.addButton(QMessageBox::No);
mb.setDefaultButton(QMessageBox::No);
mb.setCheckBox(cb);
connect(cb, &QCheckBox::stateChanged, [](int state) {
Host::SetBaseBoolSettingValue("UI", "DisplayCheatWarning", (state != Qt::CheckState::Checked));
Host::CommitBaseSettingChanges();
});
if (mb.exec() == QMessageBox::No)
return;
}
m_cheat_manager_dialog = new CheatManagerDialog(this);
}
m_cheat_manager_dialog->setModal(false);
m_cheat_manager_dialog->show();
if (!m_cheat_manager_dialog->isVisible())
{
m_cheat_manager_dialog->show();
}
else
{
m_cheat_manager_dialog->raise();
m_cheat_manager_dialog->activateWindow();
m_cheat_manager_dialog->setFocus();
}
}
void MainWindow::openCPUDebugger()

View File

@ -145,6 +145,7 @@ private Q_SLOTS:
void onChangeDiscMenuAboutToHide();
void onLoadStateMenuAboutToShow();
void onSaveStateMenuAboutToShow();
void onCheatsActionTriggered();
void onCheatsMenuAboutToShow();
void onStartFullscreenUITriggered();
void onFullscreenUIStateChange(bool running);
@ -205,6 +206,7 @@ private:
void updateStatusBarWidgetVisibility();
void updateWindowTitle();
void updateWindowState(bool force_visible = false);
void updateCheatActionsVisibility();
void setProgressBar(int current, int total);
void clearProgressBar();

View File

@ -91,6 +91,7 @@
<addaction name="actionPause"/>
<addaction name="menuChangeDisc"/>
<addaction name="separator"/>
<addaction name="actionCheats"/>
<addaction name="menuCheats"/>
<addaction name="actionScreenshot"/>
<addaction name="separator"/>
@ -274,7 +275,7 @@
<addaction name="actionReset"/>
<addaction name="actionPause"/>
<addaction name="actionChangeDisc"/>
<addaction name="actionCheats"/>
<addaction name="actionCheatsToolbar"/>
<addaction name="actionScreenshot"/>
<addaction name="separator"/>
<addaction name="actionLoadState"/>
@ -541,6 +542,15 @@
<string>Cheats...</string>
</property>
</action>
<action name="actionCheatsToolbar">
<property name="icon">
<iconset theme="cheats-line">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Cheats</string>
</property>
</action>
<action name="actionAudioSettings">
<property name="icon">
<iconset theme="volume-up-line">

View File

@ -1086,17 +1086,6 @@ void EmuThread::changeDiscFromPlaylist(quint32 index)
Host::ReportFormattedErrorAsync("Error", "Failed to switch to subimage %u", index);
}
void EmuThread::loadCheatList(const QString& filename)
{
if (!isOnThread())
{
QMetaObject::invokeMethod(this, "loadCheatList", Qt::QueuedConnection, Q_ARG(const QString&, filename));
return;
}
System::LoadCheatList(filename.toUtf8().constData());
}
void EmuThread::setCheatEnabled(quint32 index, bool enabled)
{
if (!isOnThread())
@ -1106,7 +1095,7 @@ void EmuThread::setCheatEnabled(quint32 index, bool enabled)
return;
}
System::SetCheatCodeState(index, enabled, g_settings.auto_load_cheats);
System::SetCheatCodeState(index, enabled);
emit cheatEnabled(index, enabled);
}

View File

@ -192,7 +192,6 @@ public Q_SLOTS:
void setFullscreen(bool fullscreen, bool allow_render_to_main);
void setSurfaceless(bool surfaceless);
void requestDisplaySize(float scale);
void loadCheatList(const QString& filename);
void setCheatEnabled(quint32 index, bool enabled);
void applyCheat(quint32 index);
void reloadPostProcessingShaders();

View File

@ -129,8 +129,12 @@ void SettingsWindow::addPages()
{
QString title(tr("Achievements"));
QString icon_text(QStringLiteral("trophy-line"));
QString help_text(tr("<strong>Achievement Settings</strong><hr>These options control RetroAchievements. Mouse over "
"an option for additional information, and Shift+Wheel to scroll this panel."));
QString help_text(
tr("<strong>Achievement Settings</strong><hr>DuckStation uses RetroAchievements as an achievement database and "
"for tracking progress. To use achievements, please sign up for an account at retroachievements.org. To view "
"the achievement list in-game, press the hotkey for <strong>Open Pause Menu</strong> and select "
"<strong>Achievements</strong> from the menu. Mouse over an option for additional information, and "
"Shift+Wheel to scroll this panel."));
if (!Achievements::IsUsingRAIntegration())
{
@ -578,3 +582,18 @@ void SettingsWindow::closeGamePropertiesDialogs()
dialog->deleteLater();
}
}
bool SettingsWindow::setGameSettingsBoolForSerial(const std::string& serial, const char* section, const char* key,
bool value)
{
std::string ini_filename = System::GetGameSettingsPath(serial);
if (ini_filename.empty())
return false;
INISettingsInterface sif(std::move(ini_filename));
if (FileSystem::FileExists(sif.GetFileName().c_str()))
sif.Load();
sif.SetBoolValue(section, key, value);
return sif.Save();
}

View File

@ -47,6 +47,9 @@ public:
static void openGamePropertiesDialog(const std::string& path, const std::string& serial, DiscRegion region);
static void closeGamePropertiesDialogs();
// Helper for externally setting fields in game settings ini.
static bool setGameSettingsBoolForSerial(const std::string& serial, const char* section, const char* key, bool value);
ALWAYS_INLINE bool isPerGameSettings() const { return static_cast<bool>(m_sif); }
ALWAYS_INLINE SettingsInterface* getSettingsInterface() const { return m_sif.get(); }

View File

@ -560,19 +560,20 @@ ImFont* ImGuiManager::AddFixedFont(float size)
bool ImGuiManager::AddIconFonts(float size)
{
static constexpr ImWchar range_fa[] = {
0xf002, 0xf002, 0xf005, 0xf005, 0xf007, 0xf007, 0xf00c, 0xf00e, 0xf011, 0xf011, 0xf013, 0xf013, 0xf017, 0xf017,
0xf019, 0xf019, 0xf01c, 0xf01c, 0xf021, 0xf021, 0xf023, 0xf023, 0xf025, 0xf025, 0xf027, 0xf028, 0xf02e, 0xf02e,
0xf030, 0xf030, 0xf03a, 0xf03a, 0xf03d, 0xf03d, 0xf049, 0xf04c, 0xf050, 0xf050, 0xf059, 0xf059, 0xf05e, 0xf05e,
0xf062, 0xf063, 0xf065, 0xf065, 0xf067, 0xf067, 0xf071, 0xf071, 0xf075, 0xf075, 0xf077, 0xf078, 0xf07b, 0xf07c,
0xf084, 0xf085, 0xf091, 0xf091, 0xf0a0, 0xf0a0, 0xf0ac, 0xf0ad, 0xf0c5, 0xf0c5, 0xf0c7, 0xf0c9, 0xf0cb, 0xf0cb,
0xf0d0, 0xf0d0, 0xf0dc, 0xf0dc, 0xf0e2, 0xf0e2, 0xf0eb, 0xf0eb, 0xf0f1, 0xf0f1, 0xf0f3, 0xf0f3, 0xf0fe, 0xf0fe,
0xf110, 0xf110, 0xf119, 0xf119, 0xf11b, 0xf11c, 0xf140, 0xf140, 0xf144, 0xf144, 0xf14a, 0xf14a, 0xf15b, 0xf15b,
0xf15d, 0xf15d, 0xf188, 0xf188, 0xf191, 0xf192, 0xf1ab, 0xf1ab, 0xf1dd, 0xf1de, 0xf1e6, 0xf1e6, 0xf1eb, 0xf1eb,
0xf1f8, 0xf1f8, 0xf1fc, 0xf1fc, 0xf242, 0xf242, 0xf245, 0xf245, 0xf26c, 0xf26c, 0xf279, 0xf279, 0xf2d0, 0xf2d0,
0xf2db, 0xf2db, 0xf2f2, 0xf2f2, 0xf2f5, 0xf2f5, 0xf3c1, 0xf3c1, 0xf410, 0xf410, 0xf466, 0xf466, 0xf500, 0xf500,
0xf51f, 0xf51f, 0xf545, 0xf545, 0xf547, 0xf548, 0xf552, 0xf552, 0xf57a, 0xf57a, 0xf5a2, 0xf5a2, 0xf5aa, 0xf5aa,
0xf5e7, 0xf5e7, 0xf65d, 0xf65e, 0xf6a9, 0xf6a9, 0xf6cf, 0xf6cf, 0xf794, 0xf794, 0xf7c2, 0xf7c2, 0xf807, 0xf807,
0xf815, 0xf815, 0xf818, 0xf818, 0xf84c, 0xf84c, 0xf8cc, 0xf8cc, 0x0, 0x0};
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, 0xf025, 0xf027, 0xf028,
0xf02e, 0xf02e, 0xf030, 0xf030, 0xf03a, 0xf03a, 0xf03d, 0xf03d, 0xf049, 0xf04c, 0xf050, 0xf050, 0xf059, 0xf059,
0xf05e, 0xf05e, 0xf062, 0xf063, 0xf065, 0xf065, 0xf067, 0xf067, 0xf071, 0xf071, 0xf075, 0xf075, 0xf077, 0xf078,
0xf07b, 0xf07c, 0xf084, 0xf085, 0xf091, 0xf091, 0xf0a0, 0xf0a0, 0xf0ac, 0xf0ad, 0xf0c5, 0xf0c5, 0xf0c7, 0xf0c9,
0xf0cb, 0xf0cb, 0xf0d0, 0xf0d0, 0xf0dc, 0xf0dc, 0xf0e2, 0xf0e2, 0xf0e7, 0xf0e7, 0xf0eb, 0xf0eb, 0xf0f1, 0xf0f1,
0xf0f3, 0xf0f3, 0xf0fe, 0xf0fe, 0xf110, 0xf110, 0xf119, 0xf119, 0xf11b, 0xf11c, 0xf140, 0xf140, 0xf144, 0xf144,
0xf14a, 0xf14a, 0xf15b, 0xf15b, 0xf15d, 0xf15d, 0xf188, 0xf188, 0xf191, 0xf192, 0xf1ab, 0xf1ab, 0xf1dd, 0xf1de,
0xf1e6, 0xf1e6, 0xf1eb, 0xf1eb, 0xf1f8, 0xf1f8, 0xf1fc, 0xf1fc, 0xf242, 0xf242, 0xf245, 0xf245, 0xf26c, 0xf26c,
0xf279, 0xf279, 0xf2d0, 0xf2d0, 0xf2db, 0xf2db, 0xf2f2, 0xf2f2, 0xf2f5, 0xf2f5, 0xf3c1, 0xf3c1, 0xf3fd, 0xf3fd,
0xf410, 0xf410, 0xf466, 0xf466, 0xf500, 0xf500, 0xf51f, 0xf51f, 0xf538, 0xf538, 0xf545, 0xf545, 0xf547, 0xf548,
0xf552, 0xf552, 0xf57a, 0xf57a, 0xf5a2, 0xf5a2, 0xf5aa, 0xf5aa, 0xf5e7, 0xf5e7, 0xf65d, 0xf65e, 0xf6a9, 0xf6a9,
0xf6cf, 0xf6cf, 0xf794, 0xf794, 0xf7c2, 0xf7c2, 0xf807, 0xf807, 0xf815, 0xf815, 0xf818, 0xf818, 0xf84c, 0xf84c,
0xf8cc, 0xf8cc, 0x0, 0x0};
static constexpr ImWchar range_pf[] = {
0x2196, 0x2199, 0x219e, 0x21a1, 0x21b0, 0x21b3, 0x21ba, 0x21c3, 0x21c7, 0x21ca, 0x21d0, 0x21d4, 0x21dc, 0x21dd,
0x21e0, 0x21e3, 0x21ed, 0x21ee, 0x21f7, 0x21f8, 0x21fa, 0x21fb, 0x227a, 0x227d, 0x235e, 0x235e, 0x2360, 0x2361,