From cee8056d5bbf08a83df48dc0ea57d3df4694b534 Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 28 Nov 2025 21:50:00 +0200 Subject: [PATCH 1/4] PostFX Improvements --- Client/core/CSettings.cpp | 52 +++++++++------------------------------ Client/core/CSettings.h | 4 --- 2 files changed, 12 insertions(+), 44 deletions(-) diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index f35f9e39a35..ff9309bf440 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -240,19 +240,15 @@ void CSettings::ResetGuiPointers() m_pBrightness = NULL; m_pBrightnessValueLabel = NULL; m_pBorderlessGammaToggle = NULL; - m_pBorderlessGammaLabel = NULL; m_pBorderlessGamma = NULL; m_pBorderlessGammaValueLabel = NULL; m_pBorderlessBrightnessToggle = NULL; - m_pBorderlessBrightnessLabel = NULL; m_pBorderlessBrightness = NULL; m_pBorderlessBrightnessValueLabel = NULL; m_pBorderlessContrastToggle = NULL; - m_pBorderlessContrastLabel = NULL; m_pBorderlessContrast = NULL; m_pBorderlessContrastValueLabel = NULL; m_pBorderlessSaturationToggle = NULL; - m_pBorderlessSaturationLabel = NULL; m_pBorderlessSaturation = NULL; m_pBorderlessSaturationValueLabel = NULL; m_pCheckBoxApplyBorderless = NULL; @@ -1434,14 +1430,10 @@ void CSettings::CreateGUI() const float postFxSliderWidth = ComputeSliderWidth(tabPanelSize.fX, postFxSliderColumnX, 220.0f, postFxValueColumnReserve); const float postFxValueColumnX = postFxSliderColumnX + postFxSliderWidth + postFxValueColumnPadding; - m_pBorderlessGammaToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "")); + m_pBorderlessGammaToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Gamma:")); m_pBorderlessGammaToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessGammaToggle->AutoSize(nullptr, 20.0f); - m_pBorderlessGammaLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, _("Gamma:"))); - m_pBorderlessGammaLabel->SetPosition(CVector2D(postFxLabelColumnX, postFxPos.fY + 2.0f)); - m_pBorderlessGammaLabel->AutoSize(); - m_pBorderlessGamma = reinterpret_cast(pManager->CreateScrollBar(true, m_pTabPostFX)); m_pBorderlessGamma->SetPosition(CVector2D(postFxSliderColumnX, postFxPos.fY)); m_pBorderlessGamma->SetSize(CVector2D(postFxSliderWidth, 20.0f)); @@ -1449,19 +1441,15 @@ void CSettings::CreateGUI() m_pBorderlessGammaValueLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, "")); m_pBorderlessGammaValueLabel->SetPosition(CVector2D(postFxValueColumnX, postFxPos.fY + 2.0f)); - m_pBorderlessGammaValueLabel->AutoSize("2.00"); - FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessGamma, m_pBorderlessGammaValueLabel, 220.0f, kSliderLabelSpacing, m_pBorderlessGammaLabel); + m_pBorderlessGammaValueLabel->AutoSize("2.00x"); + FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessGamma, m_pBorderlessGammaValueLabel, 220.0f, kSliderLabelSpacing); postFxPos.fY += postFxRowHeight; - m_pBorderlessBrightnessToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "")); + m_pBorderlessBrightnessToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Brightness:")); m_pBorderlessBrightnessToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessBrightnessToggle->AutoSize(nullptr, 20.0f); - m_pBorderlessBrightnessLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, _("Brightness:"))); - m_pBorderlessBrightnessLabel->SetPosition(CVector2D(postFxLabelColumnX, postFxPos.fY + 2.0f)); - m_pBorderlessBrightnessLabel->AutoSize(); - m_pBorderlessBrightness = reinterpret_cast(pManager->CreateScrollBar(true, m_pTabPostFX)); m_pBorderlessBrightness->SetPosition(CVector2D(postFxSliderColumnX, postFxPos.fY)); m_pBorderlessBrightness->SetSize(CVector2D(postFxSliderWidth, 20.0f)); @@ -1470,18 +1458,14 @@ void CSettings::CreateGUI() m_pBorderlessBrightnessValueLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, "")); m_pBorderlessBrightnessValueLabel->SetPosition(CVector2D(postFxValueColumnX, postFxPos.fY + 2.0f)); m_pBorderlessBrightnessValueLabel->AutoSize("2.00x"); - FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessBrightness, m_pBorderlessBrightnessValueLabel, 220.0f, kSliderLabelSpacing, m_pBorderlessBrightnessLabel); + FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessBrightness, m_pBorderlessBrightnessValueLabel, 220.0f, kSliderLabelSpacing); postFxPos.fY += postFxRowHeight; - m_pBorderlessContrastToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "")); + m_pBorderlessContrastToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Contrast:")); m_pBorderlessContrastToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessContrastToggle->AutoSize(nullptr, 20.0f); - m_pBorderlessContrastLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, _("Contrast:"))); - m_pBorderlessContrastLabel->SetPosition(CVector2D(postFxLabelColumnX, postFxPos.fY + 2.0f)); - m_pBorderlessContrastLabel->AutoSize(); - m_pBorderlessContrast = reinterpret_cast(pManager->CreateScrollBar(true, m_pTabPostFX)); m_pBorderlessContrast->SetPosition(CVector2D(postFxSliderColumnX, postFxPos.fY)); m_pBorderlessContrast->SetSize(CVector2D(postFxSliderWidth, 20.0f)); @@ -1490,18 +1474,14 @@ void CSettings::CreateGUI() m_pBorderlessContrastValueLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, "")); m_pBorderlessContrastValueLabel->SetPosition(CVector2D(postFxValueColumnX, postFxPos.fY + 2.0f)); m_pBorderlessContrastValueLabel->AutoSize("2.00x"); - FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessContrast, m_pBorderlessContrastValueLabel, 220.0f, kSliderLabelSpacing, m_pBorderlessContrastLabel); + FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessContrast, m_pBorderlessContrastValueLabel, 220.0f, kSliderLabelSpacing); postFxPos.fY += postFxRowHeight; - m_pBorderlessSaturationToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "")); + m_pBorderlessSaturationToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Saturation:")); m_pBorderlessSaturationToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessSaturationToggle->AutoSize(nullptr, 20.0f); - m_pBorderlessSaturationLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, _("Saturation:"))); - m_pBorderlessSaturationLabel->SetPosition(CVector2D(postFxLabelColumnX, postFxPos.fY + 2.0f)); - m_pBorderlessSaturationLabel->AutoSize(); - m_pBorderlessSaturation = reinterpret_cast(pManager->CreateScrollBar(true, m_pTabPostFX)); m_pBorderlessSaturation->SetPosition(CVector2D(postFxSliderColumnX, postFxPos.fY)); m_pBorderlessSaturation->SetSize(CVector2D(postFxSliderWidth, 20.0f)); @@ -1510,11 +1490,11 @@ void CSettings::CreateGUI() m_pBorderlessSaturationValueLabel = reinterpret_cast(pManager->CreateLabel(m_pTabPostFX, "")); m_pBorderlessSaturationValueLabel->SetPosition(CVector2D(postFxValueColumnX, postFxPos.fY + 2.0f)); m_pBorderlessSaturationValueLabel->AutoSize("2.00x"); - FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessSaturation, m_pBorderlessSaturationValueLabel, 220.0f, kSliderLabelSpacing, m_pBorderlessSaturationLabel); + FinalizeSliderRow(tabPanelSize.fX, m_pBorderlessSaturation, m_pBorderlessSaturationValueLabel, 220.0f, kSliderLabelSpacing); postFxPos.fY += postFxRowHeight + 8.0f; - m_pCheckBoxApplyBorderless = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Apply adjustments in windowed mode"))); + m_pCheckBoxApplyBorderless = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Apply adjustments in windowed/borderless mode"))); m_pCheckBoxApplyBorderless->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pCheckBoxApplyBorderless->AutoSize(nullptr, 20.0f); @@ -2517,7 +2497,7 @@ void CSettings::UpdatePostFxTab() if (m_pBorderlessGamma) m_pBorderlessGamma->SetScrollPosition(NormalizeSliderValue(gammaValue, kBorderlessGammaMin, kBorderlessGammaMax)); if (m_pBorderlessGammaValueLabel) - m_pBorderlessGammaValueLabel->SetText(SString("%.2f", gammaValue).c_str()); + m_pBorderlessGammaValueLabel->SetText(SString("%.2fx", gammaValue).c_str()); if (m_pBorderlessBrightness) m_pBorderlessBrightness->SetScrollPosition(NormalizeSliderValue(brightnessValue, kBorderlessBrightnessMin, kBorderlessBrightnessMax)); @@ -2715,29 +2695,21 @@ void CSettings::UpdateBorderlessAdjustmentControls() if (m_pBorderlessGamma) m_pBorderlessGamma->SetEnabled(gammaEnabled); - if (m_pBorderlessGammaLabel) - m_pBorderlessGammaLabel->SetEnabled(gammaEnabled); if (m_pBorderlessGammaValueLabel) m_pBorderlessGammaValueLabel->SetEnabled(gammaEnabled); if (m_pBorderlessBrightness) m_pBorderlessBrightness->SetEnabled(brightnessEnabled); - if (m_pBorderlessBrightnessLabel) - m_pBorderlessBrightnessLabel->SetEnabled(brightnessEnabled); if (m_pBorderlessBrightnessValueLabel) m_pBorderlessBrightnessValueLabel->SetEnabled(brightnessEnabled); if (m_pBorderlessContrast) m_pBorderlessContrast->SetEnabled(contrastEnabled); - if (m_pBorderlessContrastLabel) - m_pBorderlessContrastLabel->SetEnabled(contrastEnabled); if (m_pBorderlessContrastValueLabel) m_pBorderlessContrastValueLabel->SetEnabled(contrastEnabled); if (m_pBorderlessSaturation) m_pBorderlessSaturation->SetEnabled(saturationEnabled); - if (m_pBorderlessSaturationLabel) - m_pBorderlessSaturationLabel->SetEnabled(saturationEnabled); if (m_pBorderlessSaturationValueLabel) m_pBorderlessSaturationValueLabel->SetEnabled(saturationEnabled); } @@ -5261,7 +5233,7 @@ bool CSettings::OnBrightnessChanged(CGUIElement* pElement) bool CSettings::OnBorderlessGammaChanged(CGUIElement* pElement) { const float gammaValue = DenormalizeSliderValue(m_pBorderlessGamma->GetScrollPosition(), kBorderlessGammaMin, kBorderlessGammaMax); - m_pBorderlessGammaValueLabel->SetText(SString("%.2f", gammaValue).c_str()); + m_pBorderlessGammaValueLabel->SetText(SString("%.2fx", gammaValue).c_str()); CVARS_SET("borderless_gamma_power", gammaValue); RefreshBorderlessDisplayCalibration(); return true; diff --git a/Client/core/CSettings.h b/Client/core/CSettings.h index 86d4d4c4eb1..304f0254e53 100644 --- a/Client/core/CSettings.h +++ b/Client/core/CSettings.h @@ -186,19 +186,15 @@ class CSettings CGUIScrollBar* m_pBrightness; CGUILabel* m_pBrightnessValueLabel; CGUICheckBox* m_pBorderlessGammaToggle; - CGUILabel* m_pBorderlessGammaLabel; CGUIScrollBar* m_pBorderlessGamma; CGUILabel* m_pBorderlessGammaValueLabel; CGUICheckBox* m_pBorderlessBrightnessToggle; - CGUILabel* m_pBorderlessBrightnessLabel; CGUIScrollBar* m_pBorderlessBrightness; CGUILabel* m_pBorderlessBrightnessValueLabel; CGUICheckBox* m_pBorderlessContrastToggle; - CGUILabel* m_pBorderlessContrastLabel; CGUIScrollBar* m_pBorderlessContrast; CGUILabel* m_pBorderlessContrastValueLabel; CGUICheckBox* m_pBorderlessSaturationToggle; - CGUILabel* m_pBorderlessSaturationLabel; CGUIScrollBar* m_pBorderlessSaturation; CGUILabel* m_pBorderlessSaturationValueLabel; CGUICheckBox* m_pCheckBoxApplyBorderless; From 6c64449023761885c769ac4921c82180621ecb34 Mon Sep 17 00:00:00 2001 From: Omar Date: Sat, 29 Nov 2025 01:45:16 +0200 Subject: [PATCH 2/4] Disable checkboxes when PostFX is disabled --- Client/core/CSettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index ff9309bf440..8ccecc53146 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -2712,6 +2712,11 @@ void CSettings::UpdateBorderlessAdjustmentControls() m_pBorderlessSaturation->SetEnabled(saturationEnabled); if (m_pBorderlessSaturationValueLabel) m_pBorderlessSaturationValueLabel->SetEnabled(saturationEnabled); + + m_pBorderlessGammaToggle->SetEnabled(applyAdjustments); + m_pBorderlessBrightnessToggle->SetEnabled(applyAdjustments); + m_pBorderlessContrastToggle->SetEnabled(applyAdjustments); + m_pBorderlessSaturationToggle->SetEnabled(applyAdjustments); } void CSettings::ResetGTAVolume() From 4b6d26f69bcc4657d0c5eed0d2e51fa3b4fe2a20 Mon Sep 17 00:00:00 2001 From: Omar Date: Mon, 1 Dec 2025 21:57:34 +0200 Subject: [PATCH 3/4] Add missing button 'load default' --- Client/core/CSettings.cpp | 28 ++++++++++++++++++++++++++++ Client/core/CSettings.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index 8ccecc53146..2956c149d01 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -253,6 +253,8 @@ void CSettings::ResetGuiPointers() m_pBorderlessSaturationValueLabel = NULL; m_pCheckBoxApplyBorderless = NULL; m_pCheckBoxApplyFullscreen = NULL; + m_pPostFXDefButton = NULL; + m_pAnisotropicLabel = NULL; m_pAnisotropic = NULL; m_pAnisotropicValueLabel = NULL; @@ -1504,6 +1506,13 @@ void CSettings::CreateGUI() m_pCheckBoxApplyFullscreen->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pCheckBoxApplyFullscreen->AutoSize(nullptr, 20.0f); + m_pPostFXDefButton = reinterpret_cast(pManager->CreateButton(m_pTabPostFX, _("Load defaults"))); + m_pPostFXDefButton->SetClickHandler(GUI_CALLBACK(&CSettings::OnPostFXDefaultClick, this)); + m_pPostFXDefButton->AutoSize(NULL, 20.0f, 8.0f); + m_pPostFXDefButton->GetSize(vecSize); + placeBottomRightButton(m_pPostFXDefButton); + m_pPostFXDefButton->SetZOrderingEnabled(false); + /** * Interface/chat Tab **/ @@ -5327,6 +5336,25 @@ bool CSettings::OnBorderlessApplyFullscreenClicked(CGUIElement* pElement) return true; } +bool CSettings::OnPostFXDefaultClick(CGUIElement* pElement) +{ + CVARS_SET("borderless_gamma_power", 1.0f); + CVARS_SET("borderless_brightness_scale", 1.0f); + CVARS_SET("borderless_contrast_scale", 1.0f); + CVARS_SET("borderless_saturation_scale", 1.0f); + + CVARS_SET("borderless_gamma_enabled", false); + CVARS_SET("borderless_brightness_enabled", false); + CVARS_SET("borderless_contrast_enabled", false); + CVARS_SET("borderless_saturation_enabled", false); + + CVARS_SET("borderless_apply_windowed", false); + CVARS_SET("borderless_apply_fullscreen", false); + + UpdatePostFxTab(); + return true; +} + bool CSettings::OnAnisotropicChanged(CGUIElement* pElement) { int iAnisotropic = std::min(m_iMaxAnisotropic, (m_pAnisotropic->GetScrollPosition()) * (m_iMaxAnisotropic + 1)); diff --git a/Client/core/CSettings.h b/Client/core/CSettings.h index 304f0254e53..c48509d092b 100644 --- a/Client/core/CSettings.h +++ b/Client/core/CSettings.h @@ -199,6 +199,7 @@ class CSettings CGUILabel* m_pBorderlessSaturationValueLabel; CGUICheckBox* m_pCheckBoxApplyBorderless; CGUICheckBox* m_pCheckBoxApplyFullscreen; + CGUIButton* m_pPostFXDefButton; CGUILabel* m_pAnisotropicLabel; CGUIScrollBar* m_pAnisotropic; CGUILabel* m_pAnisotropicValueLabel; @@ -395,6 +396,7 @@ class CSettings bool OnBorderlessSaturationToggleClicked(CGUIElement* pElement); bool OnBorderlessApplyBorderlessClicked(CGUIElement* pElement); bool OnBorderlessApplyFullscreenClicked(CGUIElement* pElement); + bool OnPostFXDefaultClick(CGUIElement* pElement); bool OnAnisotropicChanged(CGUIElement* pElement); bool OnMapAlphaChanged(CGUIElement* pElement); bool OnMasterVolumeChanged(CGUIElement* pElement); From d5516d5e47cbab909f0af49ec36429332d752eba Mon Sep 17 00:00:00 2001 From: Omar Date: Sat, 6 Dec 2025 17:56:35 +0200 Subject: [PATCH 4/4] Fixes --- Client/core/CSettings.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index 2956c149d01..155dec37313 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -1432,7 +1432,7 @@ void CSettings::CreateGUI() const float postFxSliderWidth = ComputeSliderWidth(tabPanelSize.fX, postFxSliderColumnX, 220.0f, postFxValueColumnReserve); const float postFxValueColumnX = postFxSliderColumnX + postFxSliderWidth + postFxValueColumnPadding; - m_pBorderlessGammaToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Gamma:")); + m_pBorderlessGammaToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Gamma:"))); m_pBorderlessGammaToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessGammaToggle->AutoSize(nullptr, 20.0f); @@ -1448,7 +1448,7 @@ void CSettings::CreateGUI() postFxPos.fY += postFxRowHeight; - m_pBorderlessBrightnessToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Brightness:")); + m_pBorderlessBrightnessToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Brightness:"))); m_pBorderlessBrightnessToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessBrightnessToggle->AutoSize(nullptr, 20.0f); @@ -1464,7 +1464,7 @@ void CSettings::CreateGUI() postFxPos.fY += postFxRowHeight; - m_pBorderlessContrastToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Contrast:")); + m_pBorderlessContrastToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Contrast:"))); m_pBorderlessContrastToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessContrastToggle->AutoSize(nullptr, 20.0f); @@ -1480,7 +1480,7 @@ void CSettings::CreateGUI() postFxPos.fY += postFxRowHeight; - m_pBorderlessSaturationToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, "Saturation:")); + m_pBorderlessSaturationToggle = reinterpret_cast(pManager->CreateCheckBox(m_pTabPostFX, _("Saturation:"))); m_pBorderlessSaturationToggle->SetPosition(CVector2D(postFxCheckboxColumnX, postFxPos.fY)); m_pBorderlessSaturationToggle->AutoSize(nullptr, 20.0f);