17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

feat(editor): nodes placed with the brush and the area fill go without names; name of a model instance set in the node properties and written to its definition on save; redo of a deletion finds nodes which have no name

This commit is contained in:
2026-10-06 21:58:57 +02:00
parent 90c5420396
commit c4a22eabd5
9 changed files with 166 additions and 11 deletions

View File

@@ -557,6 +557,15 @@ void state_manager::delete_model(TAnimModel *model) {
Instances.purge(model);
}
bool state_manager::rename_model(TAnimModel *model, std::string const &name) {
if (model == nullptr || false == Instances.rename(model, name)) {
return false;
}
model->m_name = (name == "none" ? std::string{} : name);
scene::Layers.renamed(model);
return true;
}
void state_manager::delete_eventlauncher(TEventLauncher *launcher) {
launcher->dRadius = 0.0f; // disable it
}

View File

@@ -54,6 +54,9 @@ public:
// delete TAnimModel instance
void
delete_model(TAnimModel *model);
// gives TAnimModel instance another name; empty text leaves it without one. returns: false if another instance uses the name
bool
rename_model(TAnimModel *model, std::string const &name);
// delete TEventLauncher instance
void
delete_eventlauncher(TEventLauncher *launcher);