Skip to content

Commit

Permalink
#5565: Fix a couple of change-tracking bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 28, 2021
1 parent d9ac8bb commit c87c44d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion radiant/ui/materials/editor/MaterialEditor.cpp
Expand Up @@ -1140,6 +1140,7 @@ bool MaterialEditor::saveCurrentMaterial()
}

updateMaterialTreeItem();
updateMaterialControlSensitivity();

return true;
}
Expand Down Expand Up @@ -1216,6 +1217,7 @@ void MaterialEditor::handleMaterialSelectionChange()
_material->sig_materialChanged().connect([this]()
{
updateSourceView();
updateMaterialTreeItem();
});
}
else
Expand Down Expand Up @@ -2017,7 +2019,7 @@ void MaterialEditor::_onMaterialTypeChoice(wxCommandEvent& ev)

void MaterialEditor::_onAddStageTransform(wxCommandEvent& ev)
{
auto selectedStage = getSelectedStage();
auto selectedStage = getEditableStageForSelection();

if (selectedStage)
{
Expand All @@ -2027,6 +2029,7 @@ void MaterialEditor::_onAddStageTransform(wxCommandEvent& ev)
selectedStage->appendTransformation(IShaderLayer::Transformation{ type });

updateStageControls();
onMaterialChanged();
}
}

Expand All @@ -2042,6 +2045,7 @@ void MaterialEditor::_onRemoveStageTransform(wxCommandEvent& ev)
stage->removeTransformation(index);

updateStageControls();
onMaterialChanged();
}
}

Expand Down Expand Up @@ -2086,6 +2090,7 @@ void MaterialEditor::_onStageTransformEdited(wxDataViewEvent& ev)
#endif

stage->updateTransformation(transformIndex, type, expression1, expression2);
onMaterialChanged();
}

void MaterialEditor::_onStageColoredChecked(const IEditableShaderLayer::Ptr& stage, bool newValue)
Expand Down
1 change: 1 addition & 0 deletions radiantcore/shaders/Doom3ShaderLayer.cpp
Expand Up @@ -854,6 +854,7 @@ void Doom3ShaderLayer::removeTransformation(std::size_t index)
_transformations.erase(_transformations.begin() + index);

recalculateTransformationMatrix();
_material.onLayerChanged();
}

void Doom3ShaderLayer::updateTransformation(std::size_t index, TransformType type, const std::string& expression1, const std::string& expression2)
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/shaders/MaterialSourceGenerator.cpp
Expand Up @@ -659,7 +659,7 @@ void MaterialSourceGenerator::WriteFullMaterialToStream(std::ostream& stream, co
stream << material->getName() << "\n";
stream << "{";
stream << material->getDefinition();
stream << "}" << "\n" << std::endl;
stream << "}" << std::endl;
}

}

0 comments on commit c87c44d

Please sign in to comment.