mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 11:47:06 +01:00
feat(editor): the cab of a vehicle edited in the Models mode, from the seat of the driver
The cab of a vehicle is loaded only by getting in. "Get in the cab" in the Models mode does what the simulation does then: it makes the train of the vehicle (TTrain::Init loads the cab, its controls and its sounds), makes it the vehicle driven, and puts the camera in the seat of the driver. While the cab is edited the editor draws it as from that seat: FreeFlyModeFlag is off and the vehicle owns the camera, which moves with it by its offset (the sounds read the owner of the camera then). With the body picked, or in another field of work, the view is free again. A new self-test command, modelvehicle <name> [cab], picks a vehicle and gets in its cab. Tested on the EU07-424 (303e-tv) with a light added to its cab.
This commit is contained in:
@@ -401,6 +401,16 @@ editor_mode::selftest_result editor_mode::selftest_scene(std::string const &comm
|
||||
WriteLog("SELFTEST modelplace " + file + (m_node != nullptr ? "" : ": not placed"));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "modelvehicle")
|
||||
{
|
||||
// a vehicle of the name, its body or its cab ("cab")
|
||||
std::string name;
|
||||
std::string part;
|
||||
words >> name >> part;
|
||||
auto const picked{ui()->model_panel().pick_vehicle(name, part == "cab" ? 1 : 0)};
|
||||
WriteLog("SELFTEST modelvehicle " + name + " " + part + (picked ? "" : ": no such vehicle"));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "modelimport")
|
||||
{
|
||||
auto const imported{ui()->model_panel().import_model()};
|
||||
|
||||
Reference in New Issue
Block a user