Proper linking between states
Some checks failed
eden-build / source (pull_request) Has been skipped
eden-build / linux (pull_request) Successful in 22m25s
eden-build / android (pull_request) Successful in 15m31s
eden-license / license-header (pull_request_target) Failing after 25s
eden-build / windows (msvc) (pull_request) Successful in 59m58s
Some checks failed
eden-build / source (pull_request) Has been skipped
eden-build / linux (pull_request) Successful in 22m25s
eden-build / android (pull_request) Successful in 15m31s
eden-license / license-header (pull_request_target) Failing after 25s
eden-build / windows (msvc) (pull_request) Successful in 59m58s
Signed-off-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
7e12abacf3
commit
f777f64e6f
2 changed files with 117 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <vector>
|
||||
#include <QLabel>
|
||||
#include <qnamespace.h>
|
||||
#include <QCheckBox>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "ui_configure_graphics_extensions.h"
|
||||
|
@ -32,6 +33,12 @@ void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& buil
|
|||
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);
|
||||
|
@ -45,10 +52,119 @@ void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& buil
|
|||
}
|
||||
|
||||
hold.emplace(setting->Id(), widget);
|
||||
|
||||
if (setting->Id() == Settings::values.use_dyna_state_1.Id()) {
|
||||
dyna_state_1_box = widget->checkbox;
|
||||
} else if (setting->Id() == Settings::values.use_dyna_state_2.Id()) {
|
||||
dyna_state_2_box = widget->checkbox;
|
||||
} else if (setting->Id() == Settings::values.use_dyna_state_2_extras.Id()) {
|
||||
dyna_state_2_extras_box = widget->checkbox;
|
||||
} else if (setting->Id() == Settings::values.use_dyna_state_3.Id()) {
|
||||
dyna_state_3_box = widget->checkbox;
|
||||
} else if (setting->Id() == Settings::values.use_dyna_state_3_blend.Id()) {
|
||||
dyna_state_3_blend_box = widget->checkbox;
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
|
|
|
@ -230,6 +230,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
|||
INSERT(Settings, barrier_feedback_loops, tr("Barrier feedback loops"),
|
||||
tr("Improves rendering of transparency effects in specific games."));
|
||||
|
||||
// Renderer (Extensions)
|
||||
INSERT(Settings, use_dyna_state_1, tr("Enable Extended Dynamic State 1"),
|
||||
tr("Enables the VkExtendedDynamicState1 extension.\nThis setting may improve performance, "
|
||||
"but may also cause games to break on some systems."));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue