|
|
|
@ -177,6 +177,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
{
|
|
|
|
|
apply_configs(false);
|
|
|
|
|
}
|
|
|
|
|
else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults))
|
|
|
|
|
{
|
|
|
|
|
m_emu_settings->RestoreDefaults();
|
|
|
|
|
|
|
|
|
|
// Handle special restrictions after the settings were restored
|
|
|
|
|
Q_EMIT signal_restore_dependant_defaults();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
|
|
|
|
@ -223,7 +230,9 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
).arg(min_thread_count));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SubscribeTooltip(ui->gb_threadsched, tooltips.settings.enable_thread_scheduler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceComboBox(ui->preferredSPUThreads, emu_settings_type::PreferredSPUThreads, true);
|
|
|
|
|
SubscribeTooltip(ui->gb_spu_threads, tooltips.settings.preferred_spu_threads);
|
|
|
|
@ -264,6 +273,10 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
SubscribeTooltip(ui->enableTSX, tr("Unfortunately, your CPU model does not support this instruction set.", "Enable TSX"));
|
|
|
|
|
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::EnableTSX, fmt::format("%s", tsx_usage::disabled));
|
|
|
|
|
connect(this, &settings_dialog::signal_restore_dependant_defaults, [this]()
|
|
|
|
|
{
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::EnableTSX, fmt::format("%s", tsx_usage::disabled));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PPU tool tips
|
|
|
|
@ -427,6 +440,50 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
m_emu_settings->EnhanceComboBox(ui->shaderCompilerThreads, emu_settings_type::ShaderCompilerNumThreads, true);
|
|
|
|
|
SubscribeTooltip(ui->gb_shader_compiler_threads, tooltips.settings.shader_compiler_threads);
|
|
|
|
|
ui->shaderCompilerThreads->setItemText(ui->shaderCompilerThreads->findData(0), tr("Auto", "Number of Shader Compiler Threads"));
|
|
|
|
|
|
|
|
|
|
// Custom control that simplifies operation of two independent variables. Can probably be done better but this works.
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Precise (Default)"), static_cast<int>(zcull_precision_level::precise));
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Approximate (Fast)"), static_cast<int>(zcull_precision_level::approximate));
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Relaxed (Fastest)"), static_cast<int>(zcull_precision_level::relaxed));
|
|
|
|
|
|
|
|
|
|
const auto reset_zcull_options = [this]()
|
|
|
|
|
{
|
|
|
|
|
if (m_emu_settings->GetSetting(emu_settings_type::RelaxedZCULL) == "true")
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::relaxed)));
|
|
|
|
|
}
|
|
|
|
|
else if (m_emu_settings->GetSetting(emu_settings_type::PreciseZCULL) == "true")
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::precise)));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::approximate)));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
reset_zcull_options();
|
|
|
|
|
connect(this, &settings_dialog::signal_restore_dependant_defaults, this, reset_zcull_options);
|
|
|
|
|
|
|
|
|
|
connect(ui->zcullPrecisionMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index)
|
|
|
|
|
{
|
|
|
|
|
bool relaxed = false, precise = false;
|
|
|
|
|
|
|
|
|
|
switch (static_cast<zcull_precision_level>(ui->zcullPrecisionMode->itemData(index).toInt()))
|
|
|
|
|
{
|
|
|
|
|
case zcull_precision_level::precise:
|
|
|
|
|
precise = true; break;
|
|
|
|
|
case zcull_precision_level::approximate:
|
|
|
|
|
break;
|
|
|
|
|
case zcull_precision_level::relaxed:
|
|
|
|
|
relaxed = true; break;
|
|
|
|
|
default:
|
|
|
|
|
fmt::throw_exception("Unexpected selection");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::RelaxedZCULL, relaxed ? "true" : "false");
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::PreciseZCULL, precise ? "true" : "false");
|
|
|
|
|
});
|
|
|
|
|
SubscribeTooltip(ui->gbZCULL, tooltips.settings.zcull_operation_mode);
|
|
|
|
|
|
|
|
|
|
// Checkboxes: main options
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->dumpColor, emu_settings_type::WriteColorBuffers);
|
|
|
|
@ -443,7 +500,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->multithreadedRSX, emu_settings_type::MultithreadedRSX);
|
|
|
|
|
SubscribeTooltip(ui->multithreadedRSX, tooltips.settings.multithreaded_rsx);
|
|
|
|
|
connect(ui->multithreadedRSX, &QCheckBox::clicked, [this](bool checked)
|
|
|
|
|
connect(ui->multithreadedRSX, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
ui->disableVertexCache->setEnabled(!checked);
|
|
|
|
|
});
|
|
|
|
@ -451,14 +508,14 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->strictModeRendering, emu_settings_type::StrictRenderingMode);
|
|
|
|
|
SubscribeTooltip(ui->strictModeRendering, tooltips.settings.strict_rendering_mode);
|
|
|
|
|
const auto onStrictRenderingMode = [this](bool checked)
|
|
|
|
|
const auto on_strict_rendering_mode = [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
ui->gb_resolutionScale->setEnabled(!checked);
|
|
|
|
|
ui->gb_minimumScalableDimension->setEnabled(!checked);
|
|
|
|
|
ui->gb_anisotropicFilter->setEnabled(!checked);
|
|
|
|
|
ui->vulkansched->setEnabled(!checked);
|
|
|
|
|
};
|
|
|
|
|
connect(ui->strictModeRendering, &QCheckBox::clicked, this, onStrictRenderingMode);
|
|
|
|
|
connect(ui->strictModeRendering, &QCheckBox::toggled, this, on_strict_rendering_mode);
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->asyncTextureStreaming, emu_settings_type::VulkanAsyncTextureUploads);
|
|
|
|
|
SubscribeTooltip(ui->asyncTextureStreaming, tooltips.settings.async_texture_streaming);
|
|
|
|
@ -487,7 +544,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
SubscribeTooltip(ui->gb_resolutionScale, tooltips.settings.resolution_scale);
|
|
|
|
|
// rename label texts to fit current state of Resolution Scale
|
|
|
|
|
const int resolution_scale_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::ResolutionScale));
|
|
|
|
|
auto scaled_resolution = [resolution_scale_def](int percentage)
|
|
|
|
|
const auto scaled_resolution = [resolution_scale_def](int percentage)
|
|
|
|
|
{
|
|
|
|
|
if (percentage == resolution_scale_def)
|
|
|
|
|
{
|
|
|
|
@ -515,7 +572,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
SubscribeTooltip(ui->gb_minimumScalableDimension, tooltips.settings.minimum_scalable_dimension);
|
|
|
|
|
// rename label texts to fit current state of Minimum Scalable Dimension
|
|
|
|
|
const int minimum_scalable_dimension_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::MinimumScalableDimension));
|
|
|
|
|
auto min_scalable_dimension = [minimum_scalable_dimension_def](int dim)
|
|
|
|
|
const auto min_scalable_dimension = [minimum_scalable_dimension_def](int dim)
|
|
|
|
|
{
|
|
|
|
|
if (dim == minimum_scalable_dimension_def)
|
|
|
|
|
{
|
|
|
|
@ -539,7 +596,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const int fsr_sharpening_strength_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::FsrSharpeningStrength));
|
|
|
|
|
auto fmt_fsr_sharpening_strength = [fsr_sharpening_strength_def](int value)
|
|
|
|
|
const auto fmt_fsr_sharpening_strength = [fsr_sharpening_strength_def](int value)
|
|
|
|
|
{
|
|
|
|
|
if (value == fsr_sharpening_strength_def)
|
|
|
|
|
{
|
|
|
|
@ -683,7 +740,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
connect(ui->graphicsAdapterBox, &QComboBox::currentTextChanged, set_adapter);
|
|
|
|
|
connect(ui->renderBox, &QComboBox::currentTextChanged, set_renderer);
|
|
|
|
|
|
|
|
|
|
auto apply_renderer_specific_options = [=, this](const QString& text)
|
|
|
|
|
const auto apply_renderer_specific_options = [=, this](const QString& text)
|
|
|
|
|
{
|
|
|
|
|
// Vulkan-only
|
|
|
|
|
const bool is_vulkan = (text == r_creator->Vulkan.name);
|
|
|
|
@ -695,7 +752,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Handle connects to disable specific checkboxes that depend on GUI state.
|
|
|
|
|
onStrictRenderingMode(ui->strictModeRendering->isChecked());
|
|
|
|
|
on_strict_rendering_mode(ui->strictModeRendering->isChecked());
|
|
|
|
|
apply_renderer_specific_options(ui->renderBox->currentText()); // Init
|
|
|
|
|
connect(ui->renderBox, &QComboBox::currentTextChanged, apply_renderer_specific_options);
|
|
|
|
|
|
|
|
|
@ -706,13 +763,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
// / ____ \ |_| | (_| | | (_) | | | (_| | |_) |
|
|
|
|
|
// /_/ \_\__,_|\__,_|_|\___/ |_|\__,_|_.__/
|
|
|
|
|
|
|
|
|
|
auto enable_time_stretching_options = [this](bool enabled)
|
|
|
|
|
const auto enable_time_stretching_options = [this](bool enabled)
|
|
|
|
|
{
|
|
|
|
|
ui->timeStretchingThresholdLabel->setEnabled(enabled);
|
|
|
|
|
ui->timeStretchingThreshold->setEnabled(enabled);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
auto enable_buffering_options = [this, enable_time_stretching_options](bool enabled)
|
|
|
|
|
const auto enable_buffering_options = [this, enable_time_stretching_options](bool enabled)
|
|
|
|
|
{
|
|
|
|
|
ui->audioBufferDuration->setEnabled(enabled);
|
|
|
|
|
ui->audioBufferDurationLabel->setEnabled(enabled);
|
|
|
|
@ -720,7 +777,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
enable_time_stretching_options(enabled && ui->enableTimeStretching->isChecked());
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
auto enable_buffering = [this, enable_buffering_options](int index)
|
|
|
|
|
const auto enable_buffering = [this, enable_buffering_options](int index)
|
|
|
|
|
{
|
|
|
|
|
const QVariantList var_list = ui->audioOutBox->itemData(index).toList();
|
|
|
|
|
ensure(var_list.size() == 2 && var_list[0].canConvert<QString>());
|
|
|
|
@ -732,7 +789,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
const QString mic_none = m_emu_settings->m_microphone_creator.get_none();
|
|
|
|
|
|
|
|
|
|
auto change_microphone_type = [mic_none, this](int index)
|
|
|
|
|
const auto change_microphone_type = [mic_none, this](int index)
|
|
|
|
|
{
|
|
|
|
|
if (index < 0)
|
|
|
|
|
{
|
|
|
|
@ -766,13 +823,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
ui->microphone4Box->setEnabled(ui->microphone3Box->isEnabled() && ui->microphone3Box->currentText() != mic_none);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
auto propagate_used_devices = [mic_none, change_microphone_type, this]()
|
|
|
|
|
const auto propagate_used_devices = [mic_none, change_microphone_type, this]()
|
|
|
|
|
{
|
|
|
|
|
for (u32 index = 0; index < 4; index++)
|
|
|
|
|
for (u32 index = 0; index < m_mics_combo.size(); index++)
|
|
|
|
|
{
|
|
|
|
|
const QString cur_item = m_mics_combo[index]->currentText();
|
|
|
|
|
QStringList cur_list = m_emu_settings->m_microphone_creator.get_microphone_list();
|
|
|
|
|
for (u32 subindex = 0; subindex < 4; subindex++)
|
|
|
|
|
for (u32 subindex = 0; subindex < m_mics_combo.size(); subindex++)
|
|
|
|
|
{
|
|
|
|
|
if (subindex != index && m_mics_combo[subindex]->currentText() != mic_none)
|
|
|
|
|
cur_list.removeOne(m_mics_combo[subindex]->currentText());
|
|
|
|
@ -786,10 +843,10 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
change_microphone_type(ui->microphoneBox->currentIndex());
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const auto change_microphone_device = [mic_none, propagate_used_devices, this](u32 next_index, const QString& text)
|
|
|
|
|
const auto change_microphone_device = [mic_none, propagate_used_devices, this](u32 index, const QString& text)
|
|
|
|
|
{
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::MicrophoneDevices, m_emu_settings->m_microphone_creator.set_device(next_index, text));
|
|
|
|
|
if (next_index < 4 && text == mic_none)
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::MicrophoneDevices, m_emu_settings->m_microphone_creator.set_device(index, text));
|
|
|
|
|
if (const u32 next_index = index + 1; next_index < 4 && text == mic_none)
|
|
|
|
|
m_mics_combo[next_index]->setCurrentText(mic_none);
|
|
|
|
|
propagate_used_devices();
|
|
|
|
|
};
|
|
|
|
@ -814,26 +871,28 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
m_mics_combo[1] = ui->microphone2Box;
|
|
|
|
|
m_mics_combo[2] = ui->microphone3Box;
|
|
|
|
|
m_mics_combo[3] = ui->microphone4Box;
|
|
|
|
|
connect(m_mics_combo[0], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(1, text); });
|
|
|
|
|
connect(m_mics_combo[1], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(2, text); });
|
|
|
|
|
connect(m_mics_combo[2], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(3, text); });
|
|
|
|
|
connect(m_mics_combo[3], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(4, text); });
|
|
|
|
|
|
|
|
|
|
for (u32 i = 0; i < m_mics_combo.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
connect(m_mics_combo[i], &QComboBox::currentTextChanged, [change_microphone_device, i](const QString& text) { change_microphone_device(i, text); });
|
|
|
|
|
connect(m_emu_settings.get(), &emu_settings::RestoreDefaultsSignal, [change_microphone_device, i, mic_none]() { change_microphone_device(i, mic_none); });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_emu_settings->m_microphone_creator.refresh_list();
|
|
|
|
|
propagate_used_devices(); // Fills comboboxes list
|
|
|
|
|
|
|
|
|
|
m_emu_settings->m_microphone_creator.parse_devices(m_emu_settings->GetSetting(emu_settings_type::MicrophoneDevices));
|
|
|
|
|
|
|
|
|
|
const auto mic_sel_list = m_emu_settings->m_microphone_creator.get_selection_list();
|
|
|
|
|
const std::array<std::string, 4> mic_sel_list = m_emu_settings->m_microphone_creator.get_selection_list();
|
|
|
|
|
|
|
|
|
|
for (s32 index = 3; index >= 0; index--)
|
|
|
|
|
{
|
|
|
|
|
const auto mic = mic_sel_list[index];
|
|
|
|
|
const auto qmic = qstr(mic);
|
|
|
|
|
const QString qmic = qstr(mic_sel_list[index]);
|
|
|
|
|
|
|
|
|
|
if (mic.empty() || m_mics_combo[index]->findText(qmic) == -1)
|
|
|
|
|
if (qmic.isEmpty() || m_mics_combo[index]->findText(qmic) == -1)
|
|
|
|
|
{
|
|
|
|
|
m_mics_combo[index]->setCurrentText(mic_none);
|
|
|
|
|
change_microphone_device(index+1, mic_none); // Ensures the value is set in config
|
|
|
|
|
change_microphone_device(index, mic_none); // Ensures the value is set in config
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -856,11 +915,11 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->enableBuffering, emu_settings_type::EnableBuffering);
|
|
|
|
|
SubscribeTooltip(ui->enableBuffering, tooltips.settings.enable_buffering);
|
|
|
|
|
connect(ui->enableBuffering, &QCheckBox::clicked, enable_buffering_options);
|
|
|
|
|
connect(ui->enableBuffering, &QCheckBox::toggled, enable_buffering_options);
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->enableTimeStretching, emu_settings_type::EnableTimeStretching);
|
|
|
|
|
SubscribeTooltip(ui->enableTimeStretching, tooltips.settings.enable_time_stretching);
|
|
|
|
|
connect(ui->enableTimeStretching, &QCheckBox::clicked, enable_time_stretching_options);
|
|
|
|
|
connect(ui->enableTimeStretching, &QCheckBox::toggled, enable_time_stretching_options);
|
|
|
|
|
|
|
|
|
|
enable_buffering(ui->audioOutBox->currentIndex());
|
|
|
|
|
|
|
|
|
@ -1041,47 +1100,6 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
m_emu_settings->EnhanceComboBox(ui->vulkansched, emu_settings_type::VulkanAsyncSchedulerDriver);
|
|
|
|
|
SubscribeTooltip(ui->gb_vulkansched, tooltips.settings.vulkan_async_scheduler);
|
|
|
|
|
|
|
|
|
|
// Custom control that simplifies operation of two independent variables. Can probably be done better but this works.
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Precise (Default)"), static_cast<int>(zcull_precision_level::precise));
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Approximate (Fast)"), static_cast<int>(zcull_precision_level::approximate));
|
|
|
|
|
ui->zcullPrecisionMode->addItem(tr("Relaxed (Fastest)"), static_cast<int>(zcull_precision_level::relaxed));
|
|
|
|
|
|
|
|
|
|
if (m_emu_settings->GetSetting(emu_settings_type::RelaxedZCULL) == "true")
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(
|
|
|
|
|
ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::relaxed)));
|
|
|
|
|
}
|
|
|
|
|
else if (m_emu_settings->GetSetting(emu_settings_type::PreciseZCULL) == "true")
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(
|
|
|
|
|
ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::precise)));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ui->zcullPrecisionMode->setCurrentIndex(
|
|
|
|
|
ui->zcullPrecisionMode->findData(static_cast<int>(zcull_precision_level::approximate)));
|
|
|
|
|
}
|
|
|
|
|
connect(ui->zcullPrecisionMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index)
|
|
|
|
|
{
|
|
|
|
|
bool relaxed = false, precise = false;
|
|
|
|
|
|
|
|
|
|
switch (static_cast<zcull_precision_level>(ui->zcullPrecisionMode->itemData(index).toInt()))
|
|
|
|
|
{
|
|
|
|
|
case zcull_precision_level::precise:
|
|
|
|
|
precise = true; break;
|
|
|
|
|
case zcull_precision_level::approximate:
|
|
|
|
|
break;
|
|
|
|
|
case zcull_precision_level::relaxed:
|
|
|
|
|
relaxed = true; break;
|
|
|
|
|
default:
|
|
|
|
|
fmt::throw_exception("Unexpected selection");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::RelaxedZCULL, relaxed ? "true" : "false");
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::PreciseZCULL, precise ? "true" : "false");
|
|
|
|
|
});
|
|
|
|
|
SubscribeTooltip(ui->gbZCULL, tooltips.settings.zcull_operation_mode);
|
|
|
|
|
|
|
|
|
|
// Sliders
|
|
|
|
|
|
|
|
|
|
EnhanceSlider(emu_settings_type::DriverWakeUpDelay, ui->wakeupDelay, ui->wakeupText, tr(reinterpret_cast<const char*>(u8"%0 µs"), "Driver wake up delay"));
|
|
|
|
@ -1203,12 +1221,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Sort libs
|
|
|
|
|
on_lib_state_changed({});
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
connect(ui->searchBox, &QLineEdit::textChanged, on_lib_state_changed);
|
|
|
|
|
connect(ui->resetLleList, &QAbstractButton::clicked, [this, on_lib_state_changed]()
|
|
|
|
|
const auto reset_library_lists = [this, on_lib_state_changed]()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < ui->lleList->count(); i++)
|
|
|
|
|
{
|
|
|
|
@ -1221,7 +1234,14 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
on_lib_state_changed(ui->searchBox->text());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Sort libs
|
|
|
|
|
on_lib_state_changed({});
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
connect(ui->searchBox, &QLineEdit::textChanged, on_lib_state_changed);
|
|
|
|
|
connect(ui->resetLleList, &QAbstractButton::clicked, reset_library_lists);
|
|
|
|
|
|
|
|
|
|
// enable multiselection (there must be a better way)
|
|
|
|
|
connect(ui->lleList, &QListWidget::itemChanged, [this](QListWidgetItem* item)
|
|
|
|
@ -1240,6 +1260,8 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
connect(m_emu_settings.get(), &emu_settings::RestoreDefaultsSignal, reset_library_lists);
|
|
|
|
|
|
|
|
|
|
// ______ _ _ _______ _
|
|
|
|
|
// | ____| | | | | |__ __| | |
|
|
|
|
|
// | |__ _ __ ___ _ _| | __ _| |_ ___ _ __ | | __ _| |__
|
|
|
|
@ -1285,7 +1307,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->perfOverlayCenterX, emu_settings_type::PerfOverlayCenterX);
|
|
|
|
|
SubscribeTooltip(ui->perfOverlayCenterX, tooltips.settings.perf_overlay_center_x);
|
|
|
|
|
connect(ui->perfOverlayCenterX, &QCheckBox::clicked, [this](bool checked)
|
|
|
|
|
connect(ui->perfOverlayCenterX, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
ui->perfOverlayMarginX->setEnabled(!checked);
|
|
|
|
|
});
|
|
|
|
@ -1293,7 +1315,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->perfOverlayCenterY, emu_settings_type::PerfOverlayCenterY);
|
|
|
|
|
SubscribeTooltip(ui->perfOverlayCenterY, tooltips.settings.perf_overlay_center_y);
|
|
|
|
|
connect(ui->perfOverlayCenterY, &QCheckBox::clicked, [this](bool checked)
|
|
|
|
|
connect(ui->perfOverlayCenterY, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
ui->perfOverlayMarginY->setEnabled(!checked);
|
|
|
|
|
});
|
|
|
|
@ -1307,7 +1329,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->perfOverlayEnabled, emu_settings_type::PerfOverlayEnabled);
|
|
|
|
|
SubscribeTooltip(ui->perfOverlayEnabled, tooltips.settings.perf_overlay_enabled);
|
|
|
|
|
auto enable_perf_overlay_options = [this](bool enabled)
|
|
|
|
|
const auto enable_perf_overlay_options = [this](bool enabled)
|
|
|
|
|
{
|
|
|
|
|
ui->label_detail_level->setEnabled(enabled);
|
|
|
|
|
ui->label_update_interval->setEnabled(enabled);
|
|
|
|
@ -1331,11 +1353,11 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
ui->perf_overlay_frametime_datapoints->setEnabled(enabled);
|
|
|
|
|
};
|
|
|
|
|
enable_perf_overlay_options(ui->perfOverlayEnabled->isChecked());
|
|
|
|
|
connect(ui->perfOverlayEnabled, &QCheckBox::clicked, enable_perf_overlay_options);
|
|
|
|
|
connect(ui->perfOverlayEnabled, &QCheckBox::toggled, enable_perf_overlay_options);
|
|
|
|
|
|
|
|
|
|
m_emu_settings->EnhanceCheckBox(ui->shaderLoadBgEnabled, emu_settings_type::ShaderLoadBgEnabled);
|
|
|
|
|
SubscribeTooltip(ui->shaderLoadBgEnabled, tooltips.settings.shader_load_bg_enabled);
|
|
|
|
|
auto enable_shader_loader_options = [this](bool enabled)
|
|
|
|
|
const auto enable_shader_loader_options = [this](bool enabled)
|
|
|
|
|
{
|
|
|
|
|
ui->label_shaderLoadBgDarkening->setEnabled(enabled);
|
|
|
|
|
ui->label_shaderLoadBgBlur->setEnabled(enabled);
|
|
|
|
@ -1343,7 +1365,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
ui->shaderLoadBgBlur->setEnabled(enabled);
|
|
|
|
|
};
|
|
|
|
|
enable_shader_loader_options(ui->shaderLoadBgEnabled->isChecked());
|
|
|
|
|
connect(ui->shaderLoadBgEnabled, &QCheckBox::clicked, enable_shader_loader_options);
|
|
|
|
|
connect(ui->shaderLoadBgEnabled, &QCheckBox::toggled, enable_shader_loader_options);
|
|
|
|
|
|
|
|
|
|
// Sliders
|
|
|
|
|
|
|
|
|
@ -1387,31 +1409,31 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
SubscribeTooltip(ui->gs_hideMouseOnIdle_widget, tooltips.settings.hide_mouse_on_idle);
|
|
|
|
|
|
|
|
|
|
ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool());
|
|
|
|
|
connect(ui->gs_disableMouse, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->gs_disableMouse, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_disableMouse, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_disableMouse, checked);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ui->gs_disableKbHotkeys->setChecked(m_gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool());
|
|
|
|
|
connect(ui->gs_disableKbHotkeys, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->gs_disableKbHotkeys, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_disableKbHotkeys, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_disableKbHotkeys, checked);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ui->gs_showMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_showMouseFs).toBool());
|
|
|
|
|
connect(ui->gs_showMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->gs_showMouseInFullscreen, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_showMouseFs, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_showMouseFs, checked);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ui->gs_lockMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_lockMouseFs).toBool());
|
|
|
|
|
connect(ui->gs_lockMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->gs_lockMouseInFullscreen, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_lockMouseFs, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_lockMouseFs, checked);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ui->gs_hideMouseOnIdle->setChecked(m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool());
|
|
|
|
|
connect(ui->gs_hideMouseOnIdle, &QCheckBox::clicked, [this](bool checked)
|
|
|
|
|
connect(ui->gs_hideMouseOnIdle, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_hideMouseIdle, checked);
|
|
|
|
|
ui->gs_hideMouseOnIdleTime->setEnabled(checked);
|
|
|
|
@ -1434,18 +1456,18 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
ui->gs_width->setValue(std::min(width, screen.width()));
|
|
|
|
|
ui->gs_height->setValue(std::min(height, screen.height()));
|
|
|
|
|
|
|
|
|
|
connect(ui->gs_resizeOnBoot, &QCheckBox::clicked, [=, this](bool val)
|
|
|
|
|
connect(ui->gs_resizeOnBoot, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_resize, val);
|
|
|
|
|
ui->gs_width->setEnabled(val);
|
|
|
|
|
ui->gs_height->setEnabled(val);
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_resize, checked);
|
|
|
|
|
ui->gs_width->setEnabled(checked);
|
|
|
|
|
ui->gs_height->setEnabled(checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->gs_width, &QSpinBox::editingFinished, [=, this]()
|
|
|
|
|
connect(ui->gs_width, &QSpinBox::editingFinished, [this]()
|
|
|
|
|
{
|
|
|
|
|
ui->gs_width->setValue(std::min(ui->gs_width->value(), QGuiApplication::primaryScreen()->size().width()));
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_width, ui->gs_width->value());
|
|
|
|
|
});
|
|
|
|
|
connect(ui->gs_height, &QSpinBox::editingFinished, [=, this]()
|
|
|
|
|
connect(ui->gs_height, &QSpinBox::editingFinished, [this]()
|
|
|
|
|
{
|
|
|
|
|
ui->gs_height->setValue(std::min(ui->gs_height->value(), QGuiApplication::primaryScreen()->size().height()));
|
|
|
|
|
m_gui_settings->SetValue(gui::gs_height, ui->gs_height->value());
|
|
|
|
@ -1490,12 +1512,12 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
const auto set_game_window_title = [get_game_window_title, this](const std::string& format)
|
|
|
|
|
{
|
|
|
|
|
const auto game_window_title_format = qstr(format);
|
|
|
|
|
const auto game_window_title = get_game_window_title(game_window_title_format);
|
|
|
|
|
const auto width = ui->label_game_window_title_format->sizeHint().width();
|
|
|
|
|
const auto metrics = ui->label_game_window_title_format->fontMetrics();
|
|
|
|
|
const auto elided_text = metrics.elidedText(game_window_title_format, Qt::ElideRight, width);
|
|
|
|
|
const auto tooltip = game_window_title_format + QStringLiteral("\n\n") + game_window_title;
|
|
|
|
|
const QString game_window_title_format = qstr(format);
|
|
|
|
|
const QString game_window_title = get_game_window_title(game_window_title_format);
|
|
|
|
|
const int width = ui->label_game_window_title_format->sizeHint().width();
|
|
|
|
|
const QFontMetrics metrics = ui->label_game_window_title_format->fontMetrics();
|
|
|
|
|
const QString elided_text = metrics.elidedText(game_window_title_format, Qt::ElideRight, width);
|
|
|
|
|
const QString tooltip = game_window_title_format + QStringLiteral("\n\n") + game_window_title;
|
|
|
|
|
|
|
|
|
|
ui->label_game_window_title_format->setText(elided_text);
|
|
|
|
|
ui->label_game_window_title_format->setToolTip(tooltip);
|
|
|
|
@ -1550,12 +1572,14 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
connect(ui->reset_button_game_window_title_format, &QAbstractButton::clicked, [set_game_window_title, this]()
|
|
|
|
|
const auto reset_game_window_title_format = [set_game_window_title, this]()
|
|
|
|
|
{
|
|
|
|
|
const std::string default_game_title_format = m_emu_settings->GetSettingDefault(emu_settings_type::WindowTitleFormat);
|
|
|
|
|
m_emu_settings->SetSetting(emu_settings_type::WindowTitleFormat, default_game_title_format);
|
|
|
|
|
set_game_window_title(default_game_title_format);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
connect(ui->reset_button_game_window_title_format, &QAbstractButton::clicked, this, reset_game_window_title_format);
|
|
|
|
|
connect(this, &settings_dialog::signal_restore_dependant_defaults, this, reset_game_window_title_format);
|
|
|
|
|
|
|
|
|
|
// Load and apply the configured game window title format
|
|
|
|
|
set_game_window_title(m_emu_settings->GetSetting(emu_settings_type::WindowTitleFormat));
|
|
|
|
@ -1590,7 +1614,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
ui->discordState->setEnabled(m_use_discord);
|
|
|
|
|
ui->discordState->setText(m_discord_state);
|
|
|
|
|
|
|
|
|
|
connect(ui->useRichPresence, &QCheckBox::clicked, [this](bool checked)
|
|
|
|
|
connect(ui->useRichPresence, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
ui->discordState->setEnabled(checked);
|
|
|
|
|
ui->label_discordState->setEnabled(checked);
|
|
|
|
@ -1673,44 +1697,45 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|
|
|
|
|
|
|
|
|
connect(ui->pb_apply_stylesheet, &QAbstractButton::clicked, this, [this]() { ApplyStylesheet(false); });
|
|
|
|
|
|
|
|
|
|
connect(ui->cb_show_welcome, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_welcome, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_show_welcome, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_show_welcome, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_exit_game, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_exit_game, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_confirm_exit, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_confirm_exit, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_boot_game, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_boot_game, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_confirm_boot, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_confirm_boot, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_pkg_install, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_pkg_install, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_pkg_success, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_pkg_success, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_pup_install, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_pup_install, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_pup_success, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_pup_success, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_obsolete_cfg_dialog, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_obsolete_cfg_dialog, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_obsolete_cfg, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_obsolete_cfg, checked);
|
|
|
|
|
});
|
|
|
|
|
connect(ui->cb_show_same_buttons_dialog, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_show_same_buttons_dialog, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_same_buttons, val);
|
|
|
|
|
m_gui_settings->SetValue(gui::ib_same_buttons, checked);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
connect(ui->cb_custom_colors, &QCheckBox::clicked, [this](bool val)
|
|
|
|
|
connect(ui->cb_custom_colors, &QCheckBox::toggled, [this](bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_gui_settings->SetValue(gui::m_enableUIColors, val);
|
|
|
|
|
ui->pb_gl_icon_color->setEnabled(val);
|
|
|
|
|
ui->pb_sd_icon_color->setEnabled(val);
|
|
|
|
|
ui->pb_tr_icon_color->setEnabled(val);
|
|
|
|
|
m_gui_settings->SetValue(gui::m_enableUIColors, checked);
|
|
|
|
|
ui->pb_gl_icon_color->setEnabled(checked);
|
|
|
|
|
ui->pb_sd_icon_color->setEnabled(checked);
|
|
|
|
|
ui->pb_tr_icon_color->setEnabled(checked);
|
|
|
|
|
Q_EMIT GuiRepaintRequest();
|
|
|
|
|
});
|
|
|
|
|
auto color_dialog = [&](const gui_save& color, const QString& title, QPushButton *button)
|
|
|
|
|
|
|
|
|
|
const auto color_dialog = [&](const gui_save& color, const QString& title, QPushButton *button)
|
|
|
|
|
{
|
|
|
|
|
const QColor old_color = m_gui_settings->GetValue(color).value<QColor>();
|
|
|
|
|
QColorDialog dlg(old_color, this);
|
|
|
|
|