18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 09:27:10 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
maj00r 14bbd392b2 fix(editor): a save writing some tracks of a line keeps the records of the others, a plan edit refused in part changes nothing
- record_written() erased every record of the line and added only the pieces written in this save, while the scenery writes
  only the tracks changed since. After a gizmo move and Ctrl+Z on one track of a line, the next save kept a record of that
  track alone: on reopening the line owned one track, and the next Plan edit left the others as duplicates. The records of
  the tracks the line still has and this save didn't write now stay.
- model_run() kept each command before trying the next: with the radius of one vertex carried out and the cant of the next
  refused, the first stayed changed under "Refused, nothing changed". Several commands are now all tried on a copy first.
- The fingerprint of the scenario index made a string of every file name before its .scn filter, which throws on Windows
  outside of the code page, on a detached thread (the class of GE#560). The extension is looked at first, as in the index
  itself; scenery_text::name_of() and has_extension() are shared by both.
- A Del deferred by the check of the scenarios reads Shift as it was at the key press, not at the click on "go on".
- open_project() writes no project file for a map with nothing to migrate (#461): the session test expects that.
2026-11-24 19:15:15 +01:00
maj00r b15f7dcdec fix(editor): file names outside the code page don't crash the project, includes are found in any case, a project file cut short isn't put in place
- The scenario index made a string of the name of every file in the folder, which throws on Windows for a name the ANSI code
  page can't hold (the class of GE#560). It looks at the extension first and leaves out a .scn the game couldn't open by its
  name either; the messages of the project file show paths as UTF-8.
- The includes are read with the FileCased() fallback of the game (scenery_text::file_text), so on Linux an include written in
  another case no longer drops the scenario from the index, skips the migration of its file or marks its tracks as changed by
  hand.
- save() closes the file before looking at it: a failed last flush no longer renames a truncated .new over the project.
- "next node 0" is refused instead of wrapping to 0xffffffff.
- open_project() writes no .eu07proj when there were no //$ lines to migrate, and asks exists() without throwing.
2026-11-24 18:54:33 +01:00
maj00r ac5e735f91 feat(editor): the scenarios using a map and the tracks, events and memory cells they name in it
The last part of E3 (editor-tracks-domain.md §0 pkt 7, §3 "Indeks scenariuszy"): a change of the map mustn't take away what a
scenario relies on. Read only, from the text of the files as the simulator reads it; nothing of the editor asks it yet (E4, E7).

- The scenarios are the *.scn files of the scenery folder. A quick look at the include words of the files, each file once for all
  of them, tells which may reach the file of the map; those are read whole (sceneryText), their includes followed with the
  parameters of the templates, the terrain passed over where the scenario has its binary terrain. A scenario uses the map where the
  file of the map is among its files.
- What the map defines: the tracks, the events and the memory cells of the statements of its files. What a scenario names in it: of
  the statements outside the files of the map, the tracks the trainsets start on (anywhere, a scenario being its own map too) and
  the vehicles standing on their own; the events called by multiple events, by event launchers and by the tracks of the scenario;
  the cells and tracks acted on by the events (updatevalues, getvalues, copyvalues and its source, whois, logvalues; switch,
  trackvel, trackbuckle), checked by their conditions (memcompare, trackoccupied, trackfree) and by the launchers; the tracks of the
  scenario's cells and isolated circuits; the events named after a track of the map, <track>:event1..., which the track calls. Each
  with what names it, the file and the line. The names as the parser makes them, A to Z small.
- Not seen: the names the simulator makes (the tracks of the roads, the turntables), the scripts, the timetables, the commands the
  cells give the drivers, the random includes.

Tests: U: data/project/index, a map of tracks, events and memory cells, some from a template included with parameters at an origin,
and three scenarios: two using it (one through a file of its own) with their trainsets, vehicles, events, launchers, cells and
isolated circuits, listed in full; the trainset on a track of the scenario, the names in comments, an event of none_ and a name of
nothing left out; the scenario of another map with tracks of the same names not among them. The include tree read with the
parameters and the placements; the words split as the parser splits them.
2026-11-23 13:11:47 +01:00