17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-23 18:25:15 +02:00

feat(editor): texture of the rails of path 2 of a switch set apart

This commit is contained in:
2026-10-21 15:50:00 +02:00
parent 30cb83584d
commit 16c77ab6fb
3 changed files with 29 additions and 4 deletions

View File

@@ -3077,7 +3077,8 @@ TTrack *editor_track::create_switch(switch_template const &Template, std::vector
{
std::ostringstream text;
text.precision(std::numeric_limits<double>::digits10);
write_header(text, "switch", Template.length, 10.0, Style, Style.m_material1);
// a switch styled after a switch keeps the rails of its path 2
write_header(text, "switch", Template.length, 10.0, Style, Style.eType == tt_Switch ? Style.m_material2 : Style.m_material1);
write_points(text, Paths[0]);
write_points(text, Paths[1]);
if (auto const trackbed{ballast_of(Style)}; trackbed != null_handle)