Skip to content

Commit

Permalink
#6514: replacement material is now applied to skin after browsing
Browse files Browse the repository at this point in the history
If the browse button was clicked and the result was OK, call the
onReplacementEntryChanged method to apply the change to the data model.
This does not yet apply if the replacement material entry box is edited
manually.
  • Loading branch information
Matthew Mott committed Jul 3, 2024
1 parent c0a5a24 commit a154a7f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions radiant/ui/skin/SkinEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,20 @@ void SkinEditor::setupRemappingPanel()

void SkinEditor::chooseRemappedSourceMaterial()
{
MaterialChooser chooser(
this, MaterialSelector::TextureFilter::All, _sourceMaterialEdit
);
chooser.ShowModal();
MaterialChooser chooser(this, MaterialSelector::TextureFilter::All);
if (chooser.ShowModal() == wxID_OK) {
_sourceMaterialEdit->SetValue(chooser.GetSelectedDeclName());
}
}

void SkinEditor::chooseRemappedDestMaterial()
{
MaterialChooser chooser(
this, MaterialSelector::TextureFilter::All, _replacementMaterialEdit
);
chooser.ShowModal();
MaterialChooser chooser(this, MaterialSelector::TextureFilter::All);
if (chooser.ShowModal() == wxID_OK) {
const std::string materialName = chooser.GetSelectedDeclName();
_replacementMaterialEdit->SetValue(materialName);
onReplacementEntryChanged(materialName);
}
}

decl::ISkin::Ptr SkinEditor::getSelectedSkin()
Expand Down

0 comments on commit a154a7f

Please sign in to comment.