aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/configure_graphics_extensions.cpp
diff options
context:
space:
mode:
authorswurl <swurl@swurl.xyz>2025-04-24 12:08:01 -0400
committerswurl <swurl@swurl.xyz>2025-04-24 12:08:01 -0400
commit83cf9774e19ffa9cf766faaafcd70d7446573035 (patch)
tree6fbcaa1fadc497a20e10d6646f333ac33b4c582b /src/yuzu/configuration/configure_graphics_extensions.cpp
parentc140529a7574a43fdadd08912880692204aa64e5 (diff)
switch dynamic state to a slider
Signed-off-by: swurl <swurl@swurl.xyz>
Diffstat (limited to 'src/yuzu/configuration/configure_graphics_extensions.cpp')
-rw-r--r--src/yuzu/configuration/configure_graphics_extensions.cpp114
1 files changed, 0 insertions, 114 deletions
diff --git a/src/yuzu/configuration/configure_graphics_extensions.cpp b/src/yuzu/configuration/configure_graphics_extensions.cpp
index a6f50f3ddd..96151c5e09 100644
--- a/src/yuzu/configuration/configure_graphics_extensions.cpp
+++ b/src/yuzu/configuration/configure_graphics_extensions.cpp
@@ -32,13 +32,6 @@ void ConfigureGraphicsExtensions::SetConfiguration() {}
void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& builder) {
auto& layout = *ui->populate_target->layout();
std::map<u32, QWidget*> hold{}; // A map will sort the data for us
-
- QCheckBox *dyna_state_1_box = nullptr;
- QCheckBox *dyna_state_2_box = nullptr;
- QCheckBox *dyna_state_2_extras_box = nullptr;
- QCheckBox *dyna_state_3_box = nullptr;
- QCheckBox *dyna_state_3_blend_box = nullptr;
-
for (auto setting :
Settings::values.linkage.by_category[Settings::Category::RendererExtensions]) {
ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs);
@@ -52,118 +45,11 @@ void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& buil
}
hold.emplace(setting->Id(), widget);
-
-#define CHECKBOX(state) if (setting->Id() == Settings::values.use_dyna_state_##state.Id()) { \
- dyna_state_##state##_box = widget->checkbox; \
- } else
-
- CHECKBOX(1)
- CHECKBOX(2)
- CHECKBOX(2_extras)
- CHECKBOX(3)
- CHECKBOX(3_blend)
- {} // else
}
for (const auto& [id, widget] : hold) {
layout.addWidget(widget);
}
-
- // I hate everything about this
- auto state_1_check = [=](int state) {
- bool checked = state == (int) Qt::CheckState::Checked;
-
- if (!checked) dyna_state_2_box->setChecked(false);
- dyna_state_2_box->setEnabled(checked);
- };
-
- connect(dyna_state_1_box, &QCheckBox::stateChanged, this, state_1_check);
-
- auto state_2_check = [=](int state) {
- bool checked = state == (int) Qt::CheckState::Checked;
- bool valid = dyna_state_1_box->isChecked();
-
- if (!valid) {
- // THIS IS SO BAD
- if (!checked) {
- emit dyna_state_2_box->clicked();
- } else {
- checked = false;
- dyna_state_2_box->setChecked(false);
- return;
- }
- }
-
- if (!checked) {
- dyna_state_2_extras_box->setChecked(false);
- dyna_state_3_box->setChecked(false);
- }
-
- dyna_state_2_extras_box->setEnabled(checked);
- dyna_state_3_box->setEnabled(checked);
- };
-
- connect(dyna_state_2_box, &QCheckBox::stateChanged, this, state_2_check);
-
- auto state_3_check = [=](int state) {
- bool checked = state == (int) Qt::CheckState::Checked;
- bool valid = dyna_state_2_box->isChecked();
-
- if (!valid) {
- if (!checked) {
- emit dyna_state_3_box->clicked();
- } else {
- checked = false;
- dyna_state_3_box->setChecked(false);
- return;
- }
- }
-
- if (!checked) dyna_state_3_blend_box->setChecked(false);
- dyna_state_3_blend_box->setEnabled(checked);
- };
-
- connect(dyna_state_3_box, &QCheckBox::stateChanged, this, state_3_check);
-
- auto state_2_extras_check = [=](int state) {
- bool checked = state == (int) Qt::CheckState::Checked;
- bool valid = dyna_state_2_box->isChecked();
-
- if (!valid) {
- if (!checked) {
- emit dyna_state_2_extras_box->clicked();
- } else {
- checked = false;
- dyna_state_2_extras_box->setChecked(false);
- return;
- }
- }
- };
-
- connect(dyna_state_2_extras_box, &QCheckBox::stateChanged, this, state_2_extras_check);
-
- auto state_3_blend_check = [=](int state) {
- bool checked = state == (int) Qt::CheckState::Checked;
- bool valid = dyna_state_3_box->isChecked();
-
- if (!valid) {
- if (!checked) {
- emit dyna_state_3_blend_box->clicked();
- } else {
- checked = false;
- dyna_state_3_blend_box->setChecked(false);
- return;
- }
- }
- };
-
- connect(dyna_state_3_blend_box, &QCheckBox::stateChanged, this, state_3_blend_check);
-
- state_1_check((int) dyna_state_1_box->checkState());
- state_2_check((int) dyna_state_2_box->checkState());
- state_2_extras_check((int) dyna_state_2_extras_box->checkState());
- state_3_check((int) dyna_state_3_box->checkState());
- state_3_blend_check((int) dyna_state_3_blend_box->checkState());
}
void ConfigureGraphicsExtensions::ApplyConfiguration() {