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,7 +498,9 @@
<property name="title">
<string>Custom Layout</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="gb_top_screen">
<property name="title">
@ -660,6 +662,32 @@
</widget>
</item>
</layout>
</item>
<item>
<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>
</item>
</layout>

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;