From 43c377f2d15410c214af8612cb47cd4690858664 Mon Sep 17 00:00:00 2001 From: codereader Date: Sat, 20 Feb 2021 06:43:56 +0100 Subject: [PATCH] #5532: Display renderbump arguments in Material Editor. --- install/ui/materialeditor.fbp | 4 ++-- install/ui/materialeditor.xrc | 4 ++-- radiant/ui/materials/MaterialEditor.cpp | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/install/ui/materialeditor.fbp b/install/ui/materialeditor.fbp index b2eb095c03..ff7386536f 100644 --- a/install/ui/materialeditor.fbp +++ b/install/ui/materialeditor.fbp @@ -7942,7 +7942,7 @@ 0 1 - m_checkBox6111 + MaterialHasRenderbump 1 @@ -8005,7 +8005,7 @@ 0 1 - m_textCtrl512 + MaterialRenderBumpArguments 1 diff --git a/install/ui/materialeditor.xrc b/install/ui/materialeditor.xrc index 96e69328ea..ea727cf097 100644 --- a/install/ui/materialeditor.xrc +++ b/install/ui/materialeditor.xrc @@ -1327,7 +1327,7 @@ wxALIGN_CENTER_VERTICAL 0 - + 0 @@ -1336,7 +1336,7 @@ wxALIGN_CENTER_VERTICAL|wxEXPAND 0 - + diff --git a/radiant/ui/materials/MaterialEditor.cpp b/radiant/ui/materials/MaterialEditor.cpp index 29f64ab3cd..bda536e6bd 100644 --- a/radiant/ui/materials/MaterialEditor.cpp +++ b/radiant/ui/materials/MaterialEditor.cpp @@ -401,12 +401,19 @@ void MaterialEditor::updateMaterialPropertiesFromMaterial() getControl("MaterialDecalInfoEndRgb")->SetValue(fmt::format("({0} {1} {2} {3})", decalInfo.endColour.x(), decalInfo.endColour.y(), decalInfo.endColour.z(), decalInfo.endColour.w())); + getControl("MaterialHasRenderbump")->SetValue(!_material->getRenderBumpArguments().empty()); + getControl("MaterialRenderBumpArguments")->Enable(!_material->getRenderBumpArguments().empty()); + getControl("MaterialRenderBumpArguments")->SetValue(_material->getRenderBumpArguments()); + // Surround the definition with curly braces, these are not included auto definition = fmt::format("{0}\n{{{1}}}", _material->getName(), _material->getDefinition()); _sourceView->SetValue(definition); } else { + getControl("MaterialHasRenderbump")->SetValue(false); + getControl("MaterialRenderBumpArguments")->SetValue(""); + getControl("MaterialHasDecalInfo")->SetValue(false); getControl("MaterialEditorDecalInfoStaySeconds")->SetValue(0); getControl("MaterialEditorDecalInfoFadeSeconds")->SetValue(0);