mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-10-20 16:50:05 +02:00
[settings,qt] merge of "disable controller applet" toggle with "controller applet mode" picker (#4498)
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Small good simplification to nuke a toggle which costed me almost an entire day of work when fixing controller applet issues: There were two settings related to Controller applet: -"disable controller applet", which is a boolean toggle; -"controller configuration" applet mode, which is a "Real"/"Custom" picker; All i did was to nuke the toggle and add a third option "Disabled" to the picker. Users which used the disable toggle will have to pick Disabled; Real/Custom settings wont be affected since their indexes remains. All options tested against diablo 3. All working as intended. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4498 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
815325ccec
commit
a82f31a310
6 changed files with 14 additions and 12 deletions
|
|
@ -150,7 +150,7 @@ ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, Lanczos, Scale
|
||||||
ENUM(AntiAliasing, None, Fxaa, Smaa);
|
ENUM(AntiAliasing, None, Fxaa, Smaa);
|
||||||
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
|
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
|
||||||
ENUM(ConsoleMode, Handheld, Docked);
|
ENUM(ConsoleMode, Handheld, Docked);
|
||||||
ENUM(AppletMode, HLE, LLE);
|
ENUM(AppletMode, HLE, LLE, Disabled);
|
||||||
ENUM(SpirvOptimizeMode, Never, OnLoad, Always);
|
ENUM(SpirvOptimizeMode, Never, OnLoad, Always);
|
||||||
ENUM(GpuClock, Normal, Boost, Overclock)
|
ENUM(GpuClock, Normal, Boost, Overclock)
|
||||||
ENUM(GpuUnswizzleSize, VerySmall, Small, Normal, Large, VeryLarge)
|
ENUM(GpuUnswizzleSize, VerySmall, Small, Normal, Large, VeryLarge)
|
||||||
|
|
|
||||||
|
|
@ -342,9 +342,6 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
|
||||||
"it bypasses such prompts and directly exits the emulation."));
|
"it bypasses such prompts and directly exits the emulation."));
|
||||||
INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"),
|
INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"),
|
||||||
tr("Hides the mouse after 2.5s of inactivity."));
|
tr("Hides the mouse after 2.5s of inactivity."));
|
||||||
INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"),
|
|
||||||
tr("Forcibly disables the use of the controller applet in emulated programs.\n"
|
|
||||||
"When a program attempts to open the controller applet, it is immediately closed."));
|
|
||||||
INSERT(UISettings, check_for_updates, tr("Check for updates"),
|
INSERT(UISettings, check_for_updates, tr("Check for updates"),
|
||||||
tr("Whether or not to check for updates upon startup."));
|
tr("Whether or not to check for updates upon startup."));
|
||||||
|
|
||||||
|
|
@ -380,6 +377,7 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent) {
|
||||||
{
|
{
|
||||||
PAIR(AppletMode, HLE, tr("Custom frontend")),
|
PAIR(AppletMode, HLE, tr("Custom frontend")),
|
||||||
PAIR(AppletMode, LLE, tr("Real applet")),
|
PAIR(AppletMode, LLE, tr("Real applet")),
|
||||||
|
PAIR(AppletMode, Disabled, tr("Disabled")),
|
||||||
}});
|
}});
|
||||||
|
|
||||||
translations->insert({Settings::EnumMetadata<Settings::SpirvOptimizeMode>::Index(),
|
translations->insert({Settings::EnumMetadata<Settings::SpirvOptimizeMode>::Index(),
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,6 @@ struct Values {
|
||||||
Setting<bool> hide_mouse{
|
Setting<bool> hide_mouse{
|
||||||
linkage, true, "hideInactiveMouse", Category::UiGeneral, Settings::Specialization::Default,
|
linkage, true, "hideInactiveMouse", Category::UiGeneral, Settings::Specialization::Default,
|
||||||
true, true};
|
true, true};
|
||||||
Setting<bool> controller_applet_disabled{linkage, false, "disableControllerApplet",
|
|
||||||
Category::UiGeneral};
|
|
||||||
// Set when Vulkan is known to crash the application
|
// Set when Vulkan is known to crash the application
|
||||||
bool has_broken_vulkan = false;
|
bool has_broken_vulkan = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
|
@ -8,7 +11,6 @@
|
||||||
|
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QComboBox;
|
|
||||||
class QDateTimeEdit;
|
class QDateTimeEdit;
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class System;
|
class System;
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,12 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
if (combobox_enumerations.contains(type)) {
|
if (combobox_enumerations.contains(type)) {
|
||||||
enumeration = &combobox_enumerations.at(type);
|
enumeration = &combobox_enumerations.at(type);
|
||||||
for (const auto& [id, name] : *enumeration) {
|
for (const auto& [id, name] : *enumeration) {
|
||||||
combobox->addItem(name);
|
if (type == Settings::EnumMetadata<Settings::AppletMode>::Index() &&
|
||||||
|
id == static_cast<u32>(Settings::AppletMode::Disabled) &&
|
||||||
|
setting.Id() != Settings::values.controller_applet_mode.Id()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
combobox->addItem(name, id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return combobox;
|
return combobox;
|
||||||
|
|
@ -158,9 +163,8 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
const u32 setting_value = std::strtoul(setting.ToString().c_str(), nullptr, 0);
|
const u32 setting_value = std::strtoul(setting.ToString().c_str(), nullptr, 0);
|
||||||
combobox->setCurrentIndex(find_index(setting_value));
|
combobox->setCurrentIndex(find_index(setting_value));
|
||||||
|
|
||||||
serializer = [this, enumeration]() {
|
serializer = [this]() {
|
||||||
int current = combobox->currentIndex();
|
return std::to_string(combobox->currentData().toUInt());
|
||||||
return std::to_string(enumeration->at(current).first);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
restore_func = [this, find_index]() {
|
restore_func = [this, find_index]() {
|
||||||
|
|
|
||||||
|
|
@ -1786,7 +1786,7 @@ bool MainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPar
|
||||||
|
|
||||||
QtCommon::system->SetFrontendAppletSet({
|
QtCommon::system->SetFrontendAppletSet({
|
||||||
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
|
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
|
||||||
(UISettings::values.controller_applet_disabled.GetValue() == true)
|
(Settings::values.controller_applet_mode.GetValue() == Settings::AppletMode::Disabled)
|
||||||
? nullptr
|
? nullptr
|
||||||
: std::make_unique<QtControllerSelector>(*this), // Controller Selector
|
: std::make_unique<QtControllerSelector>(*this), // Controller Selector
|
||||||
std::make_unique<QtErrorDisplay>(*this), // Error Display
|
std::make_unique<QtErrorDisplay>(*this), // Error Display
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue