From d7f3fa5b17d5e9e9728fcd66a90527078a6db3e2 Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:52:23 +0100 Subject: [PATCH] feat(editor): the lesson of laying from the photo in place of the one of the curves, F1 told so quirky-crafting-summit, Etap 4: the lesson Curves (Tab to trace a curve) is Laying from the photo: click along the track on the photo, the labels, the orange one, Backspace, Enter going on, Tab to the bends; its goals a few points clicked along the track and Enter, no Tab. The lessons of the lay tool start with it while the shape is the one from the photo. F1 tells L, Tab and Enter of the laying from the photo; the drag from a free end has no Tab any more. The clip of the curves (Tab) isn't shown till one of the photo is recorded. lang/editor_pl.po: the Polish of the lesson and of F1, the texts of the old lesson gone. --- application/editormode.cpp | 30 +++++++++------- application/editormodelay.cpp | 8 +++-- application/editortool.h | 3 +- lang/editor_pl.po | 66 ++++++++++++++++++++++++----------- 4 files changed, 69 insertions(+), 38 deletions(-) diff --git a/application/editormode.cpp b/application/editormode.cpp index b41b6695a..c2384c294 100644 --- a/application/editormode.cpp +++ b/application/editormode.cpp @@ -5779,7 +5779,7 @@ void editor_mode::render_help_menu() ImGui::SetTooltip("%s", STR_C("The keys of the editor, for each field of work")); ImGui::MenuItem(STR_C("Tutorial"), nullptr, &m_first_steps_open); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("%s", STR_C("Short lessons: the camera, laying track, curves, the radius at the bends, correcting a curve, joining, switches, switch templates, signals and posts, a whole line step by step, fixing, the gizmo, the grade line, terrain, older sceneries, saving and driving")); + ImGui::SetTooltip("%s", STR_C("Short lessons: the camera, laying track, laying from the photo, the radius at the bends, correcting a curve, joining, switches, switch templates, signals and posts, a whole line step by step, fixing, the gizmo, the grade line, terrain, older sceneries, saving and driving")); ImGui::EndMenu(); } @@ -6224,14 +6224,17 @@ std::vector const &editor_mode::tutorial_lessons() {"Esc", "Throws away the points not laid yet, but only when pressed twice within 3 seconds: the first press just warns. With no points left, Esc stops laying"}}, {{first_step::tracks, "Open Tracks (F3)"}, {first_step::lay, "Turn laying on (L)"}, {first_step::laid, "Click a few points and press Enter"}}, trial::lay}, - {"Curves", - "curves", - {{"LMB", "Every place where the line turns gets a curve, as big as fits. An orange label means the curve breaks the rules for the speed set in the panel"}, - {"Tab", "To copy a curve from the orthophoto: press Tab, then click points along the middle of the curve; it ends at the last one"}, - {"Alt", "Hold it while clicking: the direction jumps in steps of 15 degrees, or to the angle of a switch to a straight track nearby"}, - {"0 1 2 3", "After the first point: type a number and press Enter, and the next straight piece is that many metres long"}, - {"wheel", "The wheel alone zooms, as everywhere"}}, - {{first_step::bend, "Lay a track that turns"}, {first_step::trace, "Press Tab to copy a curve from the photo"}}, + {"Laying from the photo", + // the clip of the curves showed Tab: none till one of the photo traced is recorded + nullptr, + {{"LMB", "With the photo on, the lay tool traces it: click points along the middle of the track you see, on the straights every 100-300 m, on the curves closer. The first point turns the view from above on"}, + {"LMB", "Straights and curves are recognised by themselves, very gentle ones and compound ones too. The labels tell what was understood: a straight and its length, a curve and its radius"}, + {"LMB", "An orange label: the curve is sharper than the rules allow at the speed of the line, so it is laid slower there, as the label says"}, + {"Backspace", "Takes back the last point. A point gone yellow is one the line could not follow: take it back and click again"}, + {"Enter", "Lays the track. The next clicks carry it on from its end; Esc ends it"}, + {"Tab", "Switches to the bends: each point a corner of straights, rounded with a curve. Without the photo laying starts with the bends"}, + {"wheel", "The wheel alone zooms, as everywhere; a click near the edge of the view moves the view on"}}, + {{first_step::trace_points, "Click a few points along the track on the photo"}, {first_step::trace, "Press Enter to lay them"}}, trial::lay}, {"Radius of the curves at the bends", nullptr, @@ -6413,7 +6416,7 @@ char const *editor_mode::tutorial_of_tool() return ""; }; if (m_lay.active) - return undone({"Laying track", "Radius of the curves at the bends", "Curves", "Joining tracks"}); + return m_lay.mode == lay_mode::traced ? undone({"Laying from the photo", "Laying track", "Joining tracks"}) : undone({"Laying track", "Radius of the curves at the bends", "Laying from the photo", "Joining tracks"}); if (current_work_area() == work_area::terrain) return undone({"Terrain model (NMT)"}); if (ui()->mode() != nodebank_panel::TRACK) @@ -6835,9 +6838,10 @@ void editor_mode::render_shortcuts_window() {"Shift+LMB", "Add a track to the selection, drag: a box"}, {"RMB on a track", "What can be done with it"}, {"K", "Split the selected track at the cursor, a break of the grade at the height of the ground"}, - {"L, LMB, LMB...", "Lay track: each click a bend of the straights, eased with a large curve; Enter lays them; a click on a free end goes on from it"}, - {"Tab while laying", "The points clicked next go along the middle of a curve seen on the photo, which ends at the last one; Tab again: back to the bends"}, - {"Drag from a free end", "Lead a track out of it: a straight, an arc and a straight where a curve is traced (Tab); onto another free end: join the two"}, + {"L, LMB, LMB...", "Lay track: with the photo on, points along the middle of the track seen on it, its straights and curves recognised; without it, each click a bend of the straights, eased with a large curve. Enter lays them; a click on a free end goes on from it"}, + {"Tab while laying", "From the photo or the bends, for the points clicked so far and on"}, + {"Enter, LMB... while laying from the photo", "The line laid goes on from its end with the next clicks; Esc ends it"}, + {"Drag from a free end", "Lead a track out of it: a straight, an arc and a straight; onto another free end: join the two"}, {"Ctrl+wheel", "Dragging from a free end: radius"}, {"Shift+wheel", "Dragging over another free end: another way to join"}, {"0-9 while laying", "Type the length of the next straight, Enter puts the point"}, diff --git a/application/editormodelay.cpp b/application/editormodelay.cpp index f8ce034ff..b9df74079 100644 --- a/application/editormodelay.cpp +++ b/application/editormodelay.cpp @@ -2239,8 +2239,6 @@ void editor_mode::lay_switch_mode() mode = tool.mode; // a shape dragged out of a free end: an arc and a straight traced on the photo, a straight with the bends, as Tab had it m_track_layout = tool.mode == lay_mode::traced ? track_layout::arc_straight : track_layout::straight; - if (tool.mode == lay_mode::traced) - first_step_done(first_step::trace); tool.hint = tool.mode == lay_mode::traced ? STR("From the photo: click along the middle of the track. Tab: the bends") : STR("The bends of straights. Tab: from the photo"); tool.hint_time = ImGui::GetTime(); } @@ -2302,6 +2300,8 @@ void editor_mode::lay_click() tool.modes.push_back(tool.mode); tool.sigmas.push_back(click_sigma_at(point)); tool.continuing = false; + if (lay_traced() && tool.points.size() >= 3) + first_step_done(first_step::trace_points); // a point clicked near the edge of the view: the view glides on to bring it nearer to the middle if (ImVec2 screen; lay_traced() && screen_projection{}.project(point, screen)) { @@ -2491,6 +2491,8 @@ void editor_mode::lay_finish(editor_track::snap_target const &End) tool.laid.curves.emplace_back(format("%d. %s", curve.vertex + 1, label.c_str()), alignment::meets_norms(curve, plan.design)); } tool.laid.traced = plan.traced; + if (plan.traced.has_value()) + first_step_done(first_step::trace); // the curves slowed down, told if (plan.traced.has_value()) for (auto const &curve : plan.traced->curves) @@ -3054,7 +3056,7 @@ void editor_mode::render_lay_settings() if (ImGui::SmallButton("?##layshape")) { m_first_steps_open = true; - m_tutorial_goto = traced ? "Curves" : "Radius of the curves at the bends"; + m_tutorial_goto = traced ? "Laying from the photo" : "Radius of the curves at the bends"; } if (ImGui::IsItemHovered()) { diff --git a/application/editortool.h b/application/editortool.h index 56225e223..fb52f8810 100644 --- a/application/editortool.h +++ b/application/editortool.h @@ -34,7 +34,8 @@ enum class editor_selftest_result again }; -enum class editor_first_step { tracks, lay, laid, wheel, join, turnout, undo, save, drive, look, top, select, shape, profile, profile_point, profile_apply, terrain, nmt, plan, plan_band, plan_apply, signal, posts, bend, trace, gizmo, vector, template_open, template_clicked, ride, count }; +// trace: a line traced on the photo laid; trace_points: three points clicked along the track on the photo +enum class editor_first_step { tracks, lay, laid, wheel, join, turnout, undo, save, drive, look, top, select, shape, profile, profile_point, profile_apply, terrain, nmt, plan, plan_band, plan_apply, signal, posts, bend, trace, gizmo, vector, template_open, template_clicked, ride, trace_points, count }; enum class editor_track_tab { straights, route, path, turnout, profile, speed, joints, infra, lay, lineside, turntable, parallel, signals, station, station_signals, line_block, kilometrage, norms }; diff --git a/lang/editor_pl.po b/lang/editor_pl.po index d8ca5c731..d3fb86f22 100644 --- a/lang/editor_pl.po +++ b/lang/editor_pl.po @@ -5394,9 +5394,6 @@ msgstr "Otwórz dział Tory (F3)" msgid "Turn laying on (L)" msgstr "Włącz układanie (L)" -msgid "Curves" -msgstr "Łuki" - msgid "Hold it while clicking: the direction jumps in steps of 15 degrees, or to the angle of a switch to a straight track nearby" msgstr "Przytrzymaj przy klikaniu: kierunek przeskakuje co 15 stopni albo ustawia się pod kątem rozjazdu do prostego toru obok" @@ -7476,8 +7473,8 @@ msgstr "Postaw i jedź: pociąg staje na torze, a ty siadasz w kabinie" msgid "The trainset tool" msgstr "Narzędzie Skład" -msgid "Short lessons: the camera, laying track, curves, the radius at the bends, correcting a curve, joining, switches, switch templates, signals and posts, a whole line step by step, fixing, the gizmo, the grade line, terrain, older sceneries, saving and driving" -msgstr "Krótkie lekcje: kamera, układanie toru, łuki, promień łuku, poprawianie łuku, łączenie, rozjazdy, szablony rozjazdów, sygnalizatory i słupki, cała linia krok po kroku, poprawki, uchwyty na torze, wzniesienia i spadki, teren, starsze scenerie, zapis i jazda" +msgid "Short lessons: the camera, laying track, laying from the photo, the radius at the bends, correcting a curve, joining, switches, switch templates, signals and posts, a whole line step by step, fixing, the gizmo, the grade line, terrain, older sceneries, saving and driving" +msgstr "Krótkie lekcje: kamera, układanie toru, układanie po zdjęciu, promień łuku, poprawianie łuku, łączenie, rozjazdy, szablony rozjazdów, sygnalizatory i słupki, cała linia krok po kroku, poprawki, uchwyty na torze, wzniesienia i spadki, teren, starsze scenerie, zapis i jazda" msgid "B: posts every 100 m along the whole line at once" msgstr "B: słupki co 100 m wzdłuż całej linii naraz" @@ -11773,8 +11770,8 @@ msgstr "załamanie prostych, wyokrąglone dużym łukiem" msgid "lay the points clicked" msgstr "kładzie kliknięte punkty" -msgid "Lay track: each click a bend of the straights, eased with a large curve; Enter lays them; a click on a free end goes on from it" -msgstr "Układanie toru: każdy klik to załamanie prostych, wyokrąglone dużym łukiem; Enter je kładzie; klik w wolny koniec prowadzi tor dalej od niego" +msgid "Lay track: with the photo on, points along the middle of the track seen on it, its straights and curves recognised; without it, each click a bend of the straights, eased with a large curve. Enter lays them; a click on a free end goes on from it" +msgstr "Układanie toru: przy włączonym zdjęciu punkty po środku widocznego na nim toru, proste i łuki rozpoznane; bez niego każdy klik to załamanie prostych, wyokrąglone dużym łukiem. Enter je kładzie; klik w wolny koniec prowadzi tor dalej od niego" msgid "Tab while laying" msgstr "Tab przy układaniu" @@ -12068,15 +12065,9 @@ msgstr "Wyrzuca nieułożone punkty, ale dopiero gdy naciśniesz go dwa razy w c msgid "Click a few points and press Enter" msgstr "Kliknij kilka punktów i naciśnij Enter" -msgid "Every place where the line turns gets a curve, as big as fits. An orange label means the curve breaks the rules for the speed set in the panel" -msgstr "Każde miejsce, w którym linia skręca, dostaje łuk, tak duży, jak się zmieści. Pomarańczowy opis znaczy, że łuk nie spełnia przepisów dla prędkości ustawionej w panelu" - msgid "Lay a track that turns" msgstr "Ułóż tor, który skręca" -msgid "Press Tab to copy a curve from the photo" -msgstr "Naciśnij Tab, żeby odrysować łuk z ortofotomapy" - msgid "Change the size of the joining curve with Ctrl+wheel" msgstr "Zmień wielkość łuku łączącego Ctrl+kółkiem" @@ -12203,8 +12194,8 @@ msgstr "Tab przy kładzeniu: łuk, potem prosta" msgid "Ctrl+wheel: radius, Tab while laying: a straight" msgstr "Ctrl+kółko: promień, Tab przy kładzeniu: prosta" -msgid "Lead a track out of it: a straight, an arc and a straight where a curve is traced (Tab); onto another free end: join the two" -msgstr "Wyprowadza z niego tor: prostą, a w trybie łuku (Tab) łuk i prostą; na inny wolny koniec: łączy oba" +msgid "Lead a track out of it: a straight, an arc and a straight; onto another free end: join the two" +msgstr "Wyprowadza z niego tor: prostą, łuk i prostą; na inny wolny koniec: łączy oba" msgid "Dragging over another free end: another way to join" msgstr "Przeciąganie nad innym wolnym końcem: inny sposób połączenia" @@ -12248,12 +12239,6 @@ msgstr "Ustawiony na wprost: przekłada go na bok. Tylko w edytorze, żeby zobac msgid "Throw the selected switch over to its other path, in the editor only" msgstr "Przekłada zaznaczony rozjazd na drugi tor, tylko w edytorze" -msgid "To copy a curve from the orthophoto: press Tab, then click points along the middle of the curve; it ends at the last one" -msgstr "Żeby odrysować łuk z ortofotomapy: naciśnij Tab i klikaj punkty wzdłuż środka łuku; łuk skończy się na ostatnim" - -msgid "The points clicked next go along the middle of a curve seen on the photo, which ends at the last one; Tab again: back to the bends" -msgstr "Następne punkty idą po środku łuku widocznego na ortofotomapie, który kończy się na ostatnim; ponownie Tab: z powrotem załamania" - msgid "Curve: click points along the middle of the track, the curve ends at the last one. Tab: back to the straights" msgstr "Łuk: klikaj punkty po środku toru, łuk kończy się na ostatnim. Tab: z powrotem proste" @@ -15490,3 +15475,42 @@ msgid_plural "%s again drops the %zu points not laid, Enter lays them" msgstr[0] "%s jeszcze raz porzuca nieułożony punkt, Enter go układa" msgstr[1] "%s jeszcze raz porzuca %zu nieułożone punkty, Enter je układa" msgstr[2] "%s jeszcze raz porzuca %zu nieułożonych punktów, Enter je układa" + +msgid "Laying from the photo" +msgstr "Układanie po zdjęciu" + +msgid "With the photo on, the lay tool traces it: click points along the middle of the track you see, on the straights every 100-300 m, on the curves closer. The first point turns the view from above on" +msgstr "Przy włączonym zdjęciu układanie idzie po nim: klikaj punkty po środku widocznego toru, na prostych co 100–300 m, na łukach gęściej. Pierwszy punkt włącza widok z góry" + +msgid "Straights and curves are recognised by themselves, very gentle ones and compound ones too. The labels tell what was understood: a straight and its length, a curve and its radius" +msgstr "Proste i łuki rozpoznają się same, także bardzo łagodne i koszowe. Etykiety mówią, co edytor zrozumiał: prosta i jej długość, łuk i jego promień" + +msgid "An orange label: the curve is sharper than the rules allow at the speed of the line, so it is laid slower there, as the label says" +msgstr "Pomarańczowa etykieta: łuk jest ciaśniejszy, niż przepisy pozwalają przy prędkości linii, więc dostaje ograniczenie prędkości, jak mówi etykieta" + +msgid "Takes back the last point. A point gone yellow is one the line could not follow: take it back and click again" +msgstr "Cofa ostatni punkt. Punkt, który zrobił się żółty, nie pasuje do linii: cofnij go i kliknij jeszcze raz" + +msgid "Lays the track. The next clicks carry it on from its end; Esc ends it" +msgstr "Układa tor. Kolejne kliknięcia ciągną go dalej od jego końca; Esc kończy" + +msgid "Switches to the bends: each point a corner of straights, rounded with a curve. Without the photo laying starts with the bends" +msgstr "Przełącza na załamania: każdy punkt to załamanie prostych, wyokrąglone łukiem. Bez zdjęcia układanie zaczyna się od załamań" + +msgid "The wheel alone zooms, as everywhere; a click near the edge of the view moves the view on" +msgstr "Samo kółko przybliża, jak wszędzie; kliknięcie przy krawędzi widoku przesuwa widok dalej" + +msgid "Click a few points along the track on the photo" +msgstr "Kliknij kilka punktów po torze na zdjęciu" + +msgid "Press Enter to lay them" +msgstr "Wciśnij Enter, żeby je ułożyć" + +msgid "From the photo or the bends, for the points clicked so far and on" +msgstr "Po zdjęciu albo załamania, dla klikniętych punktów i następnych" + +msgid "Enter, LMB... while laying from the photo" +msgstr "Enter, LPM... przy układaniu po zdjęciu" + +msgid "The line laid goes on from its end with the next clicks; Esc ends it" +msgstr "Kolejne kliknięcia ciągną ułożoną linię od jej końca; Esc ją kończy"