17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

feat(editor): track editor saves changed paths to scenery

This commit is contained in:
maj00r
2026-10-03 02:25:28 +02:00
parent 38161572b4
commit 676bf39136
3 changed files with 74 additions and 0 deletions

View File

@@ -1715,6 +1715,7 @@ TTrack *editor_track::load_path(std::string const &Text, TTrack const &Template,
data.type = "track";
auto const base{Template.name().empty() || Template.name() == "none" ? std::string{"editor_track"} : Template.name()};
data.name = Name;
data.layer = Template.layer();
for (int i = 1; data.name.empty() || simulation::Paths.find(data.name) != nullptr; ++i)
data.name = base + "_" + std::to_string(i);
auto *track = new TTrack(data);