17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-21 00:32:39 +02:00
Commit Graph

271 Commits

Author SHA1 Message Date
maj00r
22dbfb77e6 feat(editor): the tutorial lesson of laying track lists Ctrl+wheel for the radius and Shift+wheel for the shape, the lesson of fixing tells the gizmo can be turned off so the track isn't moved or stretched by chance, and the clips only draw each frame over the last one, so every GIF reader shows them alike 2026-10-17 23:32:43 +02:00
maj00r
513daa52cc merge feat/rail-crossings: the split rail code, mitred wide crossings, guard rail treads, check rail spacers and frogs for every rail profile, with the geometric switch blades moved into RailCrossings, their shape in track_rails::switch_blade and the lowering of the head in loft_span 2026-10-17 23:32:43 +02:00
maj00r
dfeb1b9e23 fix(editor): the hints of laying and dragging track (start, starts at the end of, joins, no track fits, moved) are translated 2026-10-17 23:30:37 +02:00
maj00r
2a3d7f2e29 feat(editor): scripted mouse and keys of a self-test are delivered between frames like real input events, so a press seen by ImGui starts a drag as it does by hand; while a script drives the input the real mouse and keyboard are ignored 2026-10-17 23:30:37 +02:00
maj00r
92aa39ce6e fix(editor): dragging a point of a selected track no longer hands the drag to the gizmo, which jumped under the cursor and lifted the point in the plane of the screen; the gizmo is switched off while a point is dragged 2026-10-17 23:30:37 +02:00
maj00r
fc3f391e19 feat(editor): Help > Tutorial instead of First steps: seven lessons (looking around, laying track, curves, joining, switches, selecting and fixing, saving and driving), each with a looping clip from lang/editor_tutorial/<lesson>.gif played from the start on a click, the mouse buttons and keys drawn as pictures beside what they do, ticks that fill in when the user does it, a button that turns the right tool on, Back / Next and a dot per lesson that turns green when it is done 2026-10-17 23:30:37 +02:00
maj00r
6d0423b58a feat(editor): friendlier track editing: the point labels of a path are translated, a selected switch says that the turnout tool sets its geometry and offers Edit the switch (T), the geometry of its paths starts collapsed, the gizmo options show only on the tabs that use the gizmo, cancelling a laying clears its status and the status of a laying counts pieces and metres 2026-10-17 23:30:37 +02:00
maj00r
1dc61eaf31 feat(editor): scripted mouse and keys for the self-tests and the launcher: mouse, mouseat, glide, button, wheel, press, release, tap, type and softcursor drive the window as the user does, EU07_LAUNCHER_SELFTEST runs a script in the launcher and the scenery wizard and hands an editor script on with editorscript; selectat selects the path nearest a point, switchlink no longer takes over a crossover left in the tool, joints without points logs every issue with free ends 2026-10-17 23:30:37 +02:00
maj00r
58a0b0c864 Merge branch 'feat/track-join-ux' into feat/switch-blades 2026-10-17 23:30:37 +02:00
maj00r
20c4b6542e feat(track): the blades of a switch whose frog is cut from the rails are made from its geometry: the tip is where the gauge lines of both paths are 3 mm apart, the head reaches its full width where they are a head plus 0.5 mm apart, and the heel is the shortest blade whose open flangeway stays at least 58 mm with a throw of 160 mm bent like a cantilever from the heel, or straight when that does not fit as in slips; the blade is the whole rail profile lofted from the tip to the heel, cut along the head of the stock rail, with the head lowered by the drop of the blade half of the profile file towards the tip and back to the top at a 50 mm head, and thrown with knots every 0.5 m so the vertex count does not change between the positions; the stock rails get stations every 0.5 m along the blades so their curve follows the blade, the fixed rail behind the heel starts at the heel, the old blades take their segment count per path, and the self-test command blade logs the tip, heel, drop, flangeway and the gauge lines against x^2/2R and faults on a short flangeway, a heel past the throat or a change of the vertex count 2026-10-17 23:30:36 +02:00
maj00r
df2bbae449 Merge branch 'feat/rail-crossings' into feat/switch-blades
The frogs, crossings and check rails of feat/rail-crossings next to the track editor and the switch paths made of pieces of feat/track-join-ux. The self-test commands of the crossings (frog, geomhash, frogkey, guards, railtime, crossings and switches 0|1, now called throw 0|1 because the editor already has switches) go into their own group selftest_rails.
2026-10-17 23:30:36 +02:00
maj00r
a88774d279 refactor(track): the rail layout value types (crossings, sizes, check and guard rails, cuts, bands, fills, treads, layout) and the wheel and rail constants live in world/RailLayout.h in track_rails instead of inside TTrack 2026-10-17 23:28:42 +02:00
maj00r
38c8adaec3 test(editor): geomhash also logs an exact hash of the bits of every vertex value, the userdata and the names of the tread materials, so a refactor can be checked to change nothing 2026-10-17 23:28:42 +02:00
maj00r
9448bd8c70 feat(track): where two rails share a running surface it takes the texture whose running surface is brighter; the brightness is read from the texture file over the u range of the rail head top, the shared parts are the block of crossing grooved rails, the nose of an acute frog from its tip to the end of the V, the through rail across a wide or grooved crossing, the frog of a switch, and the stock rails of a switch with frogs up to half the blade length where the blade grows to a full head 2026-10-17 23:28:41 +02:00
maj00r
215f16e871 fix(editor): self-test frog takes the throat, nose, wing end and check rails from the sizes the rails are laid with, so the wing end is logged where it is laid; self-test crossings tells crossings at middle angles apart and counts them 2026-10-17 23:28:41 +02:00
maj00r
809b48c2ab refactor(track): the blades of a thrown switch are drawn again with their cut faces by one helper instead of four copies; self-test command switches sets every switch to a path and moves its blades there at once 2026-10-17 23:28:41 +02:00
maj00r
e324eb10f9 perf(track): pieces of gauge lines whose bounding boxes do not meet are skipped before they are intersected; self-test railtime logs how much of the time goes to finding the crossings 2026-10-17 23:28:41 +02:00
maj00r
36fb68d8f9 perf(track): the gauge lines, crossings and check rails of a track are kept until a track is made, rebuilt or removed, so laying the rails of a track no longer recomputes its neighbours' crossings for each wing rail; self-test command railtime times planning the rails of all tracks 2026-10-17 23:28:41 +02:00
maj00r
929294af24 feat(editor): self-test command guards logs each guard rail and what each of its ends and breaks is cut along: the rail of the other track, how far off its gauge line and how skewed; a fault when a cut is not along a rail, or a glued end of the frame of a crossing at a middle angle is not on the face of a guard rail of the other track 2026-10-17 23:28:41 +02:00
maj00r
7088618d90 feat(editor): every switch laid in the editor gets the key frogs, a box in the Switch panel sets or clears it as one undo step; the editor rebuilds the tracks crossing a changed or removed one; self-test commands frog, crossings, frogkey and geomhash; Polish translation 2026-10-17 23:28:41 +02:00
maj00r
fb73a3e011 test(editor): self-test steps that keep a laying or connection ghost on screen under a set cursor, open the switch template editor, release a held placement and leave the top view, for screenshots of the tools at work 2026-10-14 23:55:04 +02:00
maj00r
aa20a88ed0 feat(editor): connections of tracks laid whole from the switch tool: a crossover with a straight insert or an aligning curve between switches of different angles or tracks that aren't parallel, a double crossover meeting on either track, a scissors crossover with the crossing of its inserts, and a switch ladder onto the parallel tracks of a fan or onto new ones at given spacings; press on a straight and drag onto the other track, Shift+wheel the kind, Ctrl+wheel the R of the aligning curve, Alt+wheel where a double crossover meets; the ghost shows the whole set with the spacing, the inserts and the distance of the mathematical points; switches get their drives and a //$r connection record; the crossover drawn from a diverging end uses the same solver; self-test connection 2026-10-14 23:38:31 +02:00
maj00r
52a289b15b feat(editor): switch templates by their geometry and a template editor: the diverging track is a chain of straights, arcs and transition curves from the start of the switch, with the pre-blade stretch and the angle of the blade at its tip; own templates are kept in eu07_switch_templates.txt and listed in the switch tool; double switches Rpd and Rpj are laid as two switches joined by the main track and handled as one set by sliding, replacing, flipping, the gizmo and deleting, with drives for both switches; self-test switchtemplates 2026-10-14 23:17:30 +02:00
maj00r
ea341af27a feat(editor): a switch path can be a chain of pieces: the attributes pieces1 and pieces2 keep the parts of each path after the classic bezier, which stays as the approximation older versions read and log the attributes as unknown; the simulation drives, draws and maps a path along its pieces by distance, pieces that don't join the ends of the path are reported and the bezier used; the catalogue Rz switches get the diverging path as the arc of their radius and the straight after it, moving, rotating and mirroring a switch carry the pieces, reshaping a path by hand drops them; self-test commands switchpieces and switchbreak 2026-10-12 18:32:23 +02:00
maj00r
46d41549c9 feat(editor): the profile takes the switch zones from the //$r records: the parts of a double slip and the paths of a crossing make one zone from its first part to its last, a crossing made of plain paths is a zone too, the zone is named by the number and the type of the switch; a switch with no record stays a zone named by its path; self-test vprofile logs the zones 2026-10-12 18:11:17 +02:00
maj00r
9b75e64c9b feat(editor): digitizing takes the good parts of a line: a run whose design can't be read whole is split at the track the reading fails at and each part is digitized on its own, only single tracks that make no line are left out and named in the log; Digitize all reports the lines digitized and the paths left out, opening a line digitized in parts says so with the reason for the paths left out; a stored radius agrees with the one its design makes within 0.1 % 2026-10-12 18:00:26 +02:00
maj00r
95c3842748 feat(editor): digitizing takes a line whose tracks lie up to 0.5 m off the curves read from them: the record keeps how far as fit in its source line and counts the tracks within it as lying on it, so they aren't shown as departed; a record whose elements differ from the ones its design makes only by elements of no length is no longer reported as differing 2026-10-12 17:42:40 +02:00
maj00r
096122bcc3 feat(editor): digitizing reads more of the old tracks: curves of the same hand meeting through their transitions with no straight between are separate vertices, a run turning over 150 degrees is split into vertices at track joints, a curve made of two transitions with no arc is read with the radius at their joint; digitizing tries both transition shapes, then without the minimum arc length when a short curve would lose its transitions; the reason names the track left by how much at any distance 2026-10-12 03:45:12 +02:00
maj00r
f5895abfa8 feat(editor): tracks drawn without a design get digitized: the route design keeps the line it opens in the scenery when no design is kept for it, or says why it can't (straights meeting with no curve, the curves read leaving a path by how much), trying the other transition shape before giving up; Digitize all the tracks in the route design does it for every line of the scenery and reports the count; a kept design counts as departed only where no path lies along it any more, so a parallel track or a diverging one beside a digitized line no longer shows it as left by metres; self-test command digitizeall 2026-10-12 03:24:23 +02:00
maj00r
696168a132 feat(editor): fewer hints in Tracks: the bar in the view is one line with a short mode name and at most three keys, fading when the cursor comes near; the tool options show only the mode name with the full list under (?), the inspector says Nothing selected; the hints name what is dragged instead of its colour or shape, the break is press and drag, the S-curve its four clicks, the turntable and the signal with no type chosen have their own; Esc back to Select only in the full list; the gizmo settings are hidden in Plan; in Polish a track is tor everywhere, odcinek only for a piece being laid, an isolated section and a path of a switch 2026-10-12 02:59:30 +02:00
maj00r
f81698eaf1 feat(editor): the top view zooms out to 50 km for a whole line, from 0.5 m per pixel the rail tracks are drawn as thin lines and the hover reaches 16 px around them, only the tracks near the cursor are checked; handles drag beyond 200 m from the camera in Tracks; Plan works with the mouse alone and without the gizmo: the grips of a straight, the vertices and the radius of a curve drag directly, the break tool is press on the straight and drag, the panel tool stays chosen afterwards, the Q/W/E bar is hidden in Plan; self-test command ortho 2026-10-12 02:49:07 +02:00
maj00r
16c90eb674 feat(editor): Straight and Curve are one Plan tool (G, also C) right after Lay track, a straight opens with its grips, a curve or a line with its vertices; digits no longer type a length while extending from a free end; the scenery wizard chooses realistic or fictional, a realistic one gets //$g and //$o and opens with the orthophoto in the top view, a fictional one only the top view with the grid; the orthophoto settings are kept in the scenery as //$o (on, year, opacity, radius, height, drape, lift, hires, scene, origin) and survive the new formats; self-test command mapstate 2026-10-12 02:21:29 +02:00
maj00r
653d206a54 feat(editor): the vehicle tool places trainsets: what is placed on a named track is written to the scenery on save as trainset <timetable> <track> <offset> <speed>, with reversed when it faces against the track, listed until the save with x to leave one out; the timetable and the starting speed are set in the panel, a tick turns writing off for a vehicle only to drive; the starter WMB10 is only added when nothing was placed; self-test command trainset 2026-10-12 02:00:50 +02:00
maj00r
c9f381a9c9 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 2026-10-12 01:52:28 +02:00
maj00r
7fea51ad06 feat(editor): norms of laying, free by default: free lays plain arcs with no transition curves and no cant and keeps quiet about the norms, PKP PLK gives the transitions and the cant for the design speed with the warnings, chosen at the top of the Lay panel; digits in Tracks only type values, never change the edit mode; in Lay a track under the cursor says the click starts on the ground beside it, Shift+click chooses it for a parallel track; Alt while laying turns the direction in steps of 15 degrees, with the azimuth by the cursor; K splits only within 20 px of the selected track, where a marker shows it; the environment, overhead line, transition curve, view and include labels translated, one name for laying track in Polish 2026-10-12 01:35:39 +02:00
maj00r
f28640dd44 feat(editor): laying track for a beginner: Ctrl+Z and Backspace during a chain of laid pieces go back to the end of the piece before instead of carrying on from a removed track (Ctrl+Y ends the chain); every warning of the laid shape and of a join is shown by the cursor for 4 s after the click, also when the radius chosen on the wheel didn't reach the cursor and the arc goes through it, the preview of a shape with a warning is orange as it is laid anyway; the switch type stays chosen after a switch is placed; the status says each click lays a piece; a "First steps" window (Help menu, opens with the editor until unticked) with eight steps ticked off as they are done; an empty scenery opens in Tracks with the camera over its origin and a grid where there is no ground under the cursor; F1 lists the laying gestures (Ctrl/Shift+wheel, drag from a free end, typed length); self-test command laychain; Polish translation 2026-10-12 01:21:50 +02:00
maj00r
866f626668 fix(editor): K splits the selected track where the cursor points on screen (as the hover highlight finds it), not at the delayed depth pick which hit the ground beside the rail 2026-10-12 00:44:54 +02:00
maj00r
704511fe5e feat(editor): the plain straight a switch branch leads into gets its end moved to where the branch lands instead of a short straight being added: shortened when it reaches past, lengthened when it ends short; straights drawn with handles count (the trimmed end loses them), so a switch slid up to a track that ends close to the crossing now places 2026-10-12 00:36:13 +02:00
maj00r
b27d1772a7 feat(editor): a switch being placed slides along its straight first, so its branch lies on the line of the track it leads into (a straight between, or an arc of the switch radius right after it with the arc ending at the track's end); only when the slide leaves the straight it stays put and reverse curves fill in; the straight between reverse curves takes the speed of the switch's branch (R<300 40, <500 50, <760 60, <1200 80, <2500 100 km/h) instead of the track's 2026-10-12 00:25:01 +02:00
maj00r
d4d2a02018 feat(editor): the switch no longer slides to meet the track, only the straight and arc fill in: arc of the switch radius between two straights, and where the angles match but the tracks are apart, or the arc doesn't fit, reverse curves with no transitions and the largest radius that fits; the straight between them (6 m to V 60, 0.15 V to 100, 0.25 V above) only when 1/R1 + 1/R2 > 1/106.5 m (PLK ST-T1 9.3, table 9.4); new pieces take the style of a plain track, not of a switch 2026-10-12 00:09:49 +02:00
maj00r
0a73550c8d feat(editor): the branch of a switch leads into the free end of a track: when the angles match the switch slides so its branch lies on the track's line, otherwise an arc of the switch radius right after the switch turns into it (with a straight between for a parallel track); works while placing a switch (drag toward the end) and when dragging from the branch end of a placed one, the track is shortened when it reaches past the branch; self-test switchlink / branchlink 2026-10-11 23:53:18 +02:00
maj00r
f1a3bde00f refactor(editor): one declaration per statement (cpp:S1659) and no chained assignments (cpp:S1121) in the editor files of the branch; single statements under if/else/for that became two got braces 2026-10-11 22:28:35 +02:00
maj00r
84cec61912 refactor(editor): the self-test runner dispatches its commands to seven groups (scene, bends and lineside, tracks and routes, switches, joining and gizmo, signals, terrain) instead of one function with 95 branches; deletetrack without a name deletes the selected path, which its second, unreachable branch meant to do 2026-10-11 22:17:22 +02:00
maj00r
4030797b21 refactor(editor): the layouts laid from a free end (arc then straight, straight then arc, arc, straight) and the transition curve out of a curved neighbour in editor_track; joining and laying through points share the eased ends, the room check and the assembly of the pieces instead of two copies 2026-10-11 22:09:53 +02:00
maj00r
c5ac698702 refactor(editor): split the track mode into its gizmo, kept records, switch drive, switch slide and track bed files; path geometry shared in editorGeometry instead of four copies of the reversed path, track shape rules (stretching, rolls at joints, middle, switch axis, drive spot) in editor_track, fitting the track to the ground in ground_follow with the terrain query passed in, the record layer and the switch classification in the stores; long gizmo, record watch and switch slide functions broken up, out-parameters replaced by optional results 2026-10-11 22:03:59 +02:00
maj00r
f34056ff5a fix(editor): the key launcher of a turntable reaches at most half way to the nearest other turntable (up to 150 m as before), so T and Shift+T turn only the turntable at hand where several stand close together, as on sk.scn 2026-10-11 21:33:28 +02:00
maj00r
080e308d5e feat(editor): picking a drive or its side in the Switch mode panel changes the drive of the selected switch at once, no drive takes it away, each as one undo step; self-test command drivechoice; Polish translation 2026-10-11 21:33:28 +02:00
maj00r
71bdf8e284 fix(editor): a switch drive stands at the height given in its //$e description, switch: {height: ...} above the start point of the switch (rail foot): placed with a new switch, swapped for another drive or side, or following its switch; drive_headers.py writes height 0.15 for ele and ele1 and 0.05 for mech and mech1, whose models reach that far below the origin, so they stand on the sleepers; the drives with a counterweight (mech_*, mech2, 0.57 m down) keep 0, as all 1965 drives of the digitized lines do 2026-10-11 21:33:28 +02:00
maj00r
b103a561e0 fix(editor): the drive of a switch follows the switch: moved, turned, its grade or cant changed with the gizmo or any other change of the switch, the include gets the new position, direction and rot.x/rot.z of the start of the switch, in the same undo step; self-test drives prints the parameters of the drive 2026-10-11 21:33:28 +02:00
maj00r
4b785f3789 fix(editor): putting a drive by a switch that has one puts it in place of the old one instead of next to it; the window of a switch with a drive shows which drive it is and on which side, and picking another drive or the other side swaps the include as one undo step; the default drive is the electric ele (no lever, no lantern); the last entry of editor_pl.po is read; self-test commands driveput and drivefamily; Polish translation 2026-10-11 21:33:28 +02:00