From d25e9d64dcd579ae32191cf0c478641bbe4648f9 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 7 Dec 2020 00:00:53 -0600 Subject: [PATCH] Fixes logic that checks if a postFX was enabled so the PostFX Editor works properly Corrected the enabled variable hook-in for the SSAOPostFX --- .../BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.cs | 6 +++++- Templates/BaseGame/game/tools/gui/postFxEditor.cs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.cs b/Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.cs index 99071264f..59c4bc60a 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.cs @@ -122,18 +122,22 @@ function SSAOPostFx::onEnabled( %this ) // from our #ssaoMask texture target. $AL::UseSSAOMask = true; + $PostFX::SSAOPostFx::Enabled = true; + return true; } function SSAOPostFx::onDisabled( %this ) { $AL::UseSSAOMask = false; + + $PostFX::SSAOPostFx::Enabled = false; } function SSAOPostFx::populatePostFXSettings(%this) { PostEffectEditorInspector.startGroup("SSAO - General"); - PostEffectEditorInspector.addCallbackField("$PostFX::SSAOPostFx::Enabled", "Enabled", "bool", "", $PostFXManager::PostFX::Enable, "", "toggleSSAOPostFx"); + PostEffectEditorInspector.addCallbackField("$PostFX::SSAOPostFx::Enabled", "Enabled", "bool", "", $PostFX::SSAOPostFx::Enabled, "", "toggleSSAOPostFx"); PostEffectEditorInspector.addField("$PostFX::SSAOPostFx::quality", "Quality", "list", "0,1,2", $PostFX::SSAOPostFX::quality, "0,1,2"); PostEffectEditorInspector.addField("$PostFX::SSAOPostFx::overallStrength", "Overall Strength", "float", "", $PostFX::SSAOPostFX::overallStrength, ""); PostEffectEditorInspector.addField("$PostFX::SSAOPostFx::blurDepthTol", "Blur (Softness)", "float", "", $PostFX::SSAOPostFX::blurDepthTol, ""); diff --git a/Templates/BaseGame/game/tools/gui/postFxEditor.cs b/Templates/BaseGame/game/tools/gui/postFxEditor.cs index 573e7040a..d16e9e12d 100644 --- a/Templates/BaseGame/game/tools/gui/postFxEditor.cs +++ b/Templates/BaseGame/game/tools/gui/postFxEditor.cs @@ -52,7 +52,7 @@ function PostFXEditor::refresh(%this) { %postEffect = PostFXManager.getKey(%i); - if(%postEffect.isEnabled) + if(%postEffect.isEnabled()) PostEffectEditorList.addRow( %i, %postEffect.getName() ); } } @@ -143,7 +143,7 @@ function PostFXEditorNewPFXWindow::showDialog(%this) { %postEffect = PostFXManager.getKey(%i); - if(!%postEffect.isEnabled) + if(!%postEffect.isEnabled()) PostFXEditorNewPFXList.addRow( %i, %postEffect.getName() ); } } \ No newline at end of file