mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 06:19:19 +02:00
Add -editor startup so the exe comes up straight in the editor
The editor was reachable only from the driver mode with F11, which meant loading a scenario and starting the whole simulation first. With -editor the scenario loader hands over to the editor instead of the driver, so physics, AI and timetables never run - only the loaded world is there to be worked on. Without -s the scenery from eu07.ini is used, falling back to pusta.scn when the ini names none. F11 quits instead of popping the mode, since the editor is now the bottom of the mode stack and popping it would leave the rest of the frame reading an empty one. Editor entry forces free-fly even with no vehicle to leave.
This commit is contained in:
@@ -1140,14 +1140,26 @@ int eu07_application::init_settings(int Argc, char *Argv[])
|
||||
Global.local_start_vehicle = ToLower(Argv[++i]);
|
||||
}
|
||||
}
|
||||
else if (token == "-editor")
|
||||
{
|
||||
Global.editor_startup = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "usage: " << std::string(Argv[0]) << " [-s sceneryfilepath]"
|
||||
<< " [-v vehiclename]" << std::endl;
|
||||
<< " [-v vehiclename]"
|
||||
<< " [-editor]" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (Global.editor_startup && Global.SceneryFile.empty())
|
||||
{
|
||||
// edytor potrzebuje wczytanego świata, ale niekoniecznie czegokolwiek w nim - pusta sceneria daje
|
||||
// sam region, oświetlenie i zegar, bez taboru i rozkładów
|
||||
Global.SceneryFile = "pusta.scn";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user