Skip to content

Commit

Permalink
#5532: Display renderbump arguments in Material Editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Feb 20, 2021
1 parent 2206a93 commit 43c377f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions install/ui/materialeditor.fbp
Expand Up @@ -7942,7 +7942,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkBox6111</property>
<property name="name">MaterialHasRenderbump</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand Down Expand Up @@ -8005,7 +8005,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_textCtrl512</property>
<property name="name">MaterialRenderBumpArguments</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand Down
4 changes: 2 additions & 2 deletions install/ui/materialeditor.xrc
Expand Up @@ -1327,7 +1327,7 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<object class="wxCheckBox" name="m_checkBox6111">
<object class="wxCheckBox" name="MaterialHasRenderbump">
<label>renderBump</label>
<checked>0</checked>
</object>
Expand All @@ -1336,7 +1336,7 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL|wxEXPAND</flag>
<border>0</border>
<object class="wxTextCtrl" name="m_textCtrl512">
<object class="wxTextCtrl" name="MaterialRenderBumpArguments">
<value></value>
</object>
</object>
Expand Down
7 changes: 7 additions & 0 deletions radiant/ui/materials/MaterialEditor.cpp
Expand Up @@ -401,12 +401,19 @@ void MaterialEditor::updateMaterialPropertiesFromMaterial()
getControl<wxTextCtrl>("MaterialDecalInfoEndRgb")->SetValue(fmt::format("({0} {1} {2} {3})",
decalInfo.endColour.x(), decalInfo.endColour.y(), decalInfo.endColour.z(), decalInfo.endColour.w()));

getControl<wxCheckBox>("MaterialHasRenderbump")->SetValue(!_material->getRenderBumpArguments().empty());
getControl<wxTextCtrl>("MaterialRenderBumpArguments")->Enable(!_material->getRenderBumpArguments().empty());
getControl<wxTextCtrl>("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<wxCheckBox>("MaterialHasRenderbump")->SetValue(false);
getControl<wxTextCtrl>("MaterialRenderBumpArguments")->SetValue("");

getControl<wxCheckBox>("MaterialHasDecalInfo")->SetValue(false);
getControl<wxSpinCtrlDouble>("MaterialEditorDecalInfoStaySeconds")->SetValue(0);
getControl<wxSpinCtrlDouble>("MaterialEditorDecalInfoFadeSeconds")->SetValue(0);
Expand Down

0 comments on commit 43c377f

Please sign in to comment.