add Bottom Screen Opacity in Enhancement tab

This commit is contained in:
blakdulz 2023-05-13 05:09:06 +07:00
parent 152e655fa7
commit 244b6e7d91
3 changed files with 202 additions and 163 deletions

View file

@ -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<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int currentIndex) {
ui->custom_layout_group->setEnabled(ui->layout_combobox->currentIndex() == 5);
});
connect(ui->render_3d_combobox,
static_cast<void (QComboBox::*)(int)>(&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);

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>440</width>
<height>748</height>
<height>950</height>
</rect>
</property>
<property name="minimumSize">
@ -430,7 +430,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_31">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Large Screen Proportion:</string>
</property>
@ -488,7 +488,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_custom_layout">
<widget class="QGroupBox" name="custom_layout_group">
<property name="minimumSize">
<size>
<width>0</width>
@ -498,166 +498,194 @@
<property name="title">
<string>Custom Layout</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGroupBox" name="gb_top_screen">
<property name="title">
<string>Top Screen</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lb_top_left">
<property name="text">
<string>Left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="custom_top_left">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lb_top_top">
<property name="text">
<string>Top</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="custom_top_top">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lb_top_right">
<property name="text">
<string>Right</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="custom_top_right">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lb_top_bottom">
<property name="text">
<string>Bottom</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="custom_top_bottom">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
</layout>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="gb_top_screen">
<property name="title">
<string>Top Screen</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lb_top_left">
<property name="text">
<string>Left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="custom_top_left">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lb_top_top">
<property name="text">
<string>Top</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="custom_top_top">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lb_top_right">
<property name="text">
<string>Right</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="custom_top_right">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lb_top_bottom">
<property name="text">
<string>Bottom</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="custom_top_bottom">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_bottom_screen">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Bottom Screen</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lb_bottom_left">
<property name="text">
<string>Left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="custom_bottom_left">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lb_bottom_top">
<property name="text">
<string>Top</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="custom_bottom_top">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lb_bottom_right">
<property name="text">
<string>Right</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="custom_bottom_right">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lb_bottom_bottom">
<property name="text">
<string>Bottom</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="custom_bottom_bottom">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="gb_bottom_screen">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Bottom Screen</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lb_bottom_left">
<property name="text">
<string>Left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="custom_bottom_left">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lb_bottom_top">
<property name="text">
<string>Top</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="custom_bottom_top">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lb_bottom_right">
<property name="text">
<string>Right</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="custom_bottom_right">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lb_bottom_bottom">
<property name="text">
<string>Bottom</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="custom_bottom_bottom">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
</layout>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="lb_opacity_second_layer">
<property name="text">
<string>Bottom Screen Opacity:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="custom_second_layer_opacity">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

View file

@ -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;