17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 06:52:45 +01:00

fix(editor): a signal goes to the other side of the track and turns around

Dragging a standing signal over the track takes it to the other side;
the side used to come from where the signal stood, so it never crossed.
The selected signal gets "To the other side" and "Turn around": the
first mirrors it over the axis facing the same trains, the second turns
it to the trains of the other direction and moves its event to the
other event list of the path. Either one swaps a head leaning to the
track for its counterpart, and an include keeps the template its
directive names, so undo brings the old file back too.
This commit is contained in:
maj00r
2026-10-21 10:44:58 +02:00
parent 87bacede74
commit 7da0432dca
8 changed files with 251 additions and 78 deletions

View File

@@ -1090,13 +1090,17 @@ std::string node_layers::directive(instance_handle const Instance) const
}
// replaces the directive of specified include, the scenery file receives it on save
bool node_layers::modify(instance_handle const Instance, std::string const &Directive)
bool node_layers::modify(instance_handle const Instance, std::string const &Directive, std::string const &File)
{
if (false == tracked(Instance) || m_instances[Instance - 1].dead || Directive.empty())
{
return false;
}
m_instances[Instance - 1].directive = Directive;
if (false == File.empty())
{
m_instances[Instance - 1].file = &(*m_templates.emplace(File).first);
}
return true;
}