17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-24 19:11:52 +02:00

feat(editor): the parallel track is a tool of its own (N) in the toolbar, its green preview only shows there, Shift+click on a straight in L opens it with that track; the norms are two buttons at the top of the Lay panel and of the Curve tool, shared by both, free hides the recommendations of the curve and its norm warnings, the duplicate transitions checkbox is gone; the Lay panel starts with the radius, the speed and the shape; the Tracks toolbar shows the tools that lay track, the ones that correct a line are under More (remembered); First steps ends with driving the track laid; self-test command tracktab

This commit is contained in:
maj00r
2026-10-12 01:52:28 +02:00
parent 7fea51ad06
commit c9f381a9c9
14 changed files with 187 additions and 57 deletions

View File

@@ -222,7 +222,7 @@ editor_mode::track_intent editor_mode::track_intent_at(int const Mods)
intent.track = under.track;
intent.path = under.path;
if (shift)
return make(kind::select, "Click: choose this track, the parallel track goes beside it");
return make(kind::select, "Click: the Parallel tool (N) with this track");
return make(kind::lay, "Click: start on the ground beside this track. Shift+click: a parallel track to it, T: a switch into it");
}
return make(kind::lay, lay.points.empty() ? "Click: start of the new track" : "Click: lay the track to here");
@@ -381,6 +381,7 @@ editor_mode::track_intent editor_mode::track_intent_at(int const Mods)
case track_tab::turnout: return make(kind::select, m_hover.track->eType == tt_Switch ? "Click: edit this switch" : m_switch.armed < 0 ? "Click: choose this track, then the type of the switch" : "Click: choose this track, then press and drag on it for the switch");
case track_tab::profile: return make(kind::select, "Click: the grade line through this track");
case track_tab::lineside: return make(kind::select, "Click: the line the objects go along");
case track_tab::parallel: return make(kind::select, "Click: the straight the new track goes beside");
default: return make(kind::select, "Click: select");
}
}
@@ -498,6 +499,8 @@ void editor_mode::track_press(track_intent const &Intent)
}
}
select_track(track != nullptr ? track : node);
if (m_track_tab == track_tab::lay && track != nullptr)
show_track_tab(track_tab::parallel);
});
return;
}
@@ -1422,10 +1425,9 @@ void editor_mode::render_lineside_ui()
bool *expand;
std::function<void()> render;
};
std::array<tab, 4> const tabs{{
std::array<tab, 3> const tabs{{
{"Hectometre posts", &m_hekto.open, &m_hekto.expand, [this]() { render_hekto_ui(); }},
{"Fouling points", &m_fouling.open, &m_fouling.expand, [this]() { render_fouling_ui(); }},
{"Parallel track", &m_parallel.open, &m_parallel.expand, [this]() { render_parallel_ui(); }},
{"Vehicle", &m_vehicle.open, &m_vehicle.expand, [this]() { render_vehicle_ui(); }},
}};
if (selected_track() == nullptr)