From 244b6e7d91f0c7ebac3a733a3c652f2d7ff7ea01 Mon Sep 17 00:00:00 2001 From: blakdulz Date: Sat, 13 May 2023 05:09:06 +0700 Subject: [PATCH] add Bottom Screen Opacity in Enhancement tab --- .../configuration/configure_enhancements.cpp | 9 + .../configuration/configure_enhancements.ui | 350 ++++++++++-------- .../renderer_opengl/renderer_opengl.cpp | 6 +- 3 files changed, 202 insertions(+), 163 deletions(-) diff --git a/src/citra_qt/configuration/configure_enhancements.cpp b/src/citra_qt/configuration/configure_enhancements.cpp index 58790f53f..c322def82 100644 --- a/src/citra_qt/configuration/configure_enhancements.cpp +++ b/src/citra_qt/configuration/configure_enhancements.cpp @@ -22,6 +22,13 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent) const bool res_scale_enabled = graphics_api != Settings::GraphicsAPI::Software; ui->resolution_factor_combobox->setEnabled(res_scale_enabled); + ui->custom_layout_group->setEnabled((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout)); + connect(ui->layout_combobox, + static_cast(&QComboBox::currentIndexChanged), this, + [this](int currentIndex) { + ui->custom_layout_group->setEnabled(ui->layout_combobox->currentIndex() == 5); + }); + connect(ui->render_3d_combobox, static_cast(&QComboBox::currentIndexChanged), this, [this](int currentIndex) { @@ -90,6 +97,7 @@ void ConfigureEnhancements::SetConfiguration() { ui->custom_bottom_top->setValue(Settings::values.custom_bottom_top.GetValue()); ui->custom_bottom_right->setValue(Settings::values.custom_bottom_right.GetValue()); ui->custom_bottom_bottom->setValue(Settings::values.custom_bottom_bottom.GetValue()); + ui->custom_second_layer_opacity->setValue(Settings::values.custom_second_layer_opacity.GetValue()); ui->toggle_dump_textures->setChecked(Settings::values.dump_textures.GetValue()); ui->toggle_custom_textures->setChecked(Settings::values.custom_textures.GetValue()); ui->toggle_preload_textures->setChecked(Settings::values.preload_textures.GetValue()); @@ -163,6 +171,7 @@ void ConfigureEnhancements::ApplyConfiguration() { Settings::values.custom_bottom_top = ui->custom_bottom_top->value(); Settings::values.custom_bottom_right = ui->custom_bottom_right->value(); Settings::values.custom_bottom_bottom = ui->custom_bottom_bottom->value(); + Settings::values.custom_second_layer_opacity = ui->custom_second_layer_opacity->value(); ConfigurationShared::ApplyPerGameSetting(&Settings::values.filter_mode, ui->toggle_linear_filter, linear_filter); diff --git a/src/citra_qt/configuration/configure_enhancements.ui b/src/citra_qt/configuration/configure_enhancements.ui index 1285f65bf..781987650 100644 --- a/src/citra_qt/configuration/configure_enhancements.ui +++ b/src/citra_qt/configuration/configure_enhancements.ui @@ -7,7 +7,7 @@ 0 0 440 - 748 + 950 @@ -430,7 +430,7 @@ 0 - + Large Screen Proportion: @@ -488,7 +488,7 @@ - + 0 @@ -498,166 +498,194 @@ Custom Layout - + - - - Top Screen - - - - - - Left - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Top - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Right - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Bottom - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - + + + + + Top Screen + + + + + + Left + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Top + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Right + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Bottom + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + + + + + 0 + 0 + + + + Bottom Screen + + + + + + Left + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Top + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Right + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + Bottom + + + + + + + QAbstractSpinBox::NoButtons + + + 2147483647 + + + + + + + - - - - 0 - 0 - - - - Bottom Screen - - - - - - Left - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Top - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Right - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - - - Bottom - - - - - - - QAbstractSpinBox::NoButtons - - - 2147483647 - - - - - + + + + + Bottom Screen Opacity: + + + + + + + QAbstractSpinBox::PlusMinus + + + 10 + + + 100 + + + + @@ -739,4 +767,4 @@ - + \ No newline at end of file diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 89ac5fc49..a36fb25d6 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -946,7 +946,8 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f } void RendererOpenGL::ApplySecondLayerOpacity() { - if (Settings::values.custom_layout && + if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout || + Settings::values.custom_layout) && Settings::values.custom_second_layer_opacity.GetValue() < 100) { state.blend.src_rgb_func = GL_CONSTANT_ALPHA; state.blend.src_a_func = GL_CONSTANT_ALPHA; @@ -957,7 +958,8 @@ void RendererOpenGL::ApplySecondLayerOpacity() { } void RendererOpenGL::ResetSecondLayerOpacity() { - if (Settings::values.custom_layout && + if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout || + Settings::values.custom_layout) && Settings::values.custom_second_layer_opacity.GetValue() < 100) { state.blend.src_rgb_func = GL_ONE; state.blend.dst_rgb_func = GL_ZERO;