17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 10:12:24 +01:00

feat(editor): the terrain of the tracks in the panel of the tracks: Draw the terrain to the track, of the selected tracks or of their whole run, Restore the terrain, each one step of the history, the terrain following the tracks edited or not, and Tracks onto the terrain and Terrain under the tracks for all the tracks of the scenery

The formation of a track as it is already was taken out of the terrain when the track was shaped again, as after a change of its properties alone: the formations the tracks still have are no longer counted as gone. Selftest trackterrain pull|restore <tracks>.
This commit is contained in:
maj00r
2026-10-24 18:53:32 +02:00
parent 11d1342181
commit 7d0caee541
6 changed files with 176 additions and 1 deletions

View File

@@ -471,6 +471,22 @@ editor_mode::selftest_result editor_mode::selftest_terrain(std::string const &co
WriteLog("SELFTEST terrainadd: " + m_terrain_status);
return selftest_result::handled;
}
if (command == "trackterrain")
{
// the terrain drawn to the named tracks, or their formations taken out of it, as the buttons of the panel of the tracks
std::string action;
words >> action;
std::vector<TTrack *> tracks;
for (std::string name; words >> name;)
if (auto *track{simulation::Paths.find(name)})
tracks.push_back(track);
if (action == "pull")
nmt_pull_terrain(tracks);
else
nmt_restore_terrain(tracks);
WriteLog(format("SELFTEST trackterrain %s %zu tracks: %s, %zu modifiers", action.c_str(), tracks.size(), m_nmt_state.status.c_str(), m_streamer.modifiers().size()));
return selftest_result::handled;
}
if (command == "terrainhash")
{
// the heights of the chunks in memory hashed, to compare the ground two builds made