17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 02:17:28 +01:00

feat(editor): the vehicle tool places trainsets: what is placed on a named track is written to the scenery on save as trainset <timetable> <track> <offset> <speed>, with reversed when it faces against the track, listed until the save with x to leave one out; the timetable and the starting speed are set in the panel, a tick turns writing off for a vehicle only to drive; the starter WMB10 is only added when nothing was placed; self-test command trainset

This commit is contained in:
maj00r
2026-10-12 02:00:50 +02:00
parent c9f381a9c9
commit 653d206a54
8 changed files with 153 additions and 19 deletions

View File

@@ -1581,7 +1581,7 @@ class editor_mode : public application_mode, private editor_track::observer
void render_fouling_ui();
void draw_fouling_overlay() const;
// a vehicle put on the selected path, to be driven: it isn't written to the scenery files
// a trainset put on the selected path, written to the scenery on save, or only to be driven
struct vehicle_tool
{
bool open{false};
@@ -1605,6 +1605,16 @@ class editor_mode : public application_mode, private editor_track::observer
};
std::vector<consist_vehicle> consist;
int facing{1};
bool write{true};
char timetable[64]{"none"};
double velocity{0.0};
struct trainset
{
std::string head;
std::string track;
std::vector<std::string> lines;
};
std::vector<trainset> trainsets;
};
vehicle_tool m_vehicle;
void vehicle_start(TTrack &Track, glm::dvec3 const &Point);