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

feat(editor): the signalling mode numbers the switches of a station along it and names them after its code, the drives and the switch records follow, and an undo of names passed round among the tracks leaves the drives right

This commit is contained in:
maj00r
2026-10-22 07:50:59 +02:00
parent 8c5795348f
commit 5044beb380
10 changed files with 332 additions and 23 deletions

View File

@@ -367,7 +367,7 @@ editor_track::name_uses editor_track::uses_of_name(TTrack const &Track)
return result;
}
void editor_track::rename(TTrack &Track, std::string const &Name)
void editor_track::rename(TTrack &Track, std::string const &Name, std::vector<scene::instance_handle> const &Kept)
{
auto const old{Track.name()};
if (old == Name)
@@ -388,7 +388,7 @@ void editor_track::rename(TTrack &Track, std::string const &Name)
std::string file;
std::vector<std::string> values;
auto const index{track_parameter(handle, file, values)};
if (index < 0 || lower_name(values[index]) != old)
if (index < 0 || lower_name(values[index]) != old || std::find(Kept.begin(), Kept.end(), handle) != Kept.end())
continue;
values[index] = Name;
scene::Layers.modify(handle, editor_includes::compose_directive(file, values));