Skip to content

Commit

Permalink
#5532: Display renderbumpflat 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 7870ee9 commit 6803df2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 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">MaterialHasRenderbump</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 @@ -8070,7 +8070,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkBox61111</property>
<property name="name">MaterialHasRenderBumpFlat</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand Down Expand Up @@ -8133,7 +8133,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_textCtrl5111</property>
<property name="name">MaterialRenderBumpFlatArguments</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand Down
6 changes: 3 additions & 3 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="MaterialHasRenderbump">
<object class="wxCheckBox" name="MaterialHasRenderBump">
<label>renderBump</label>
<checked>0</checked>
</object>
Expand All @@ -1344,7 +1344,7 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>0</border>
<object class="wxCheckBox" name="m_checkBox61111">
<object class="wxCheckBox" name="MaterialHasRenderBumpFlat">
<label>renderBumpFlat</label>
<checked>0</checked>
</object>
Expand All @@ -1353,7 +1353,7 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</flag>
<border>0</border>
<object class="wxTextCtrl" name="m_textCtrl5111">
<object class="wxTextCtrl" name="MaterialRenderBumpFlatArguments">
<value></value>
</object>
</object>
Expand Down
11 changes: 9 additions & 2 deletions radiant/ui/materials/MaterialEditor.cpp
Expand Up @@ -401,19 +401,26 @@ 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<wxCheckBox>("MaterialHasRenderBump")->SetValue(!_material->getRenderBumpArguments().empty());
getControl<wxTextCtrl>("MaterialRenderBumpArguments")->Enable(!_material->getRenderBumpArguments().empty());
getControl<wxTextCtrl>("MaterialRenderBumpArguments")->SetValue(_material->getRenderBumpArguments());

getControl<wxCheckBox>("MaterialHasRenderBumpFlat")->SetValue(!_material->getRenderBumpFlatArguments().empty());
getControl<wxTextCtrl>("MaterialRenderBumpFlatArguments")->Enable(!_material->getRenderBumpFlatArguments().empty());
getControl<wxTextCtrl>("MaterialRenderBumpFlatArguments")->SetValue(_material->getRenderBumpFlatArguments());

// 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<wxCheckBox>("MaterialHasRenderBump")->SetValue(false);
getControl<wxTextCtrl>("MaterialRenderBumpArguments")->SetValue("");

getControl<wxCheckBox>("MaterialHasRenderBumpFlat")->SetValue(false);
getControl<wxTextCtrl>("MaterialRenderBumpFlatArguments")->SetValue("");

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

0 comments on commit 6803df2

Please sign in to comment.