Commit Graph

306 Commits

Author SHA1 Message Date
maj00r
7e249a7a9a fix(settings): a first start has nothing to save before the simulator starts
With no eu07.ini of the player's own, starting the simulator asked to save
changes nobody made. The UART tune box and the Vulkan device box went by
TextChanged, which Avalonia raises later from the dispatcher: the text the
page put there while loading came back as an edit once the window was shown.

Both now go by their Text property, which changes at once and is passed over
while the page loads; typing in them still counts.
2026-11-17 22:14:45 +01:00
maj00r
97a2c2c75c fix(sceneries): an .sbt in the way of terrain files that are there can go
Any terrain directive kept the scenery's .sbt, as if it brought the terrain
from elsewhere. The directive names either .sbt files, which nothing makes
again, or terrain files (.txtf) with their binary copies (.btf). A scenery
with the terrain files has no use for its own .sbt: the simulator never
writes one for it, and an old one keeps the terrain files from being used.

- An .sbt named by the directive still keeps the scenery's own.
- A .txtf, or its .btf, on disk lets the scenery's .sbt go; with neither,
  the .sbt stays and the missing .txtf is given as the reason.
2026-11-17 22:14:45 +01:00
maj00r
943b855f20 feat(warehouse): the old starter's magazyn.ini joins the warehouse at every start
The old starter read starter\magazyn.ini each time it opened and wrote it on
every change; this one kept its warehouse apart and took the file in only from
the list's menu, so a consist saved there never showed here.

- At the start, ahead of the scenery list, the consists of magazyn.ini not
  taken in before join the warehouse. Each one taken is remembered in
  userpresets.json by its name and vehicles, so one removed here stays removed
  while the old starter keeps it as it was.
- A consist changed there replaces the one here when that one is as an earlier
  start brought it; one of the same name made here stays, and the old one comes
  in beside it as "name (magazyn.ini)".
- A warehouse file that cannot be read is left alone by the import.
- The file is read as UTF-8 or code page 1250, whichever it is, by hand too.
2026-11-17 14:55:04 +01:00
maj00r
797e2e70a7 feat(sceneries): a release clears the .sbt files once, and a scenery's menu deletes its own
The simulator makes a scenery's .sbt on its first load and never checks it
against the text again, so an older simulator's file, or one made before a
scenery update, keeps showing the old terrain.

- CleanupGeneration, raised by a release, clears the .sbt files once per
  installation on the first start, ahead of the scenery list. A file goes only
  while its scenery's terrain files (*_ter.scm) are all there and no terrain
  directive brings terrain from elsewhere; an .sbt standing in for missing
  terrain stays, and the log says what is missing. Which cleanup each
  installation had is kept in sbt-cleanup.txt in the user's folder.
- "Delete SBT" in the scenery list's menu does the same for one scenery,
  asking first and refusing where nothing could make the file again.
- The .sbt is among the files a scenery is watched by, so one made or removed
  reaches the list without a reload.
2026-11-17 02:15:45 +01:00
c07ed2fb4d Merge pull request #54 from MaSzyna-EU07/feat/tapes-from-blackbox
feat(tapes): tapes from the black box, live view that keeps up, train tapes setting
v1.6.302
2026-11-16 16:00:52 +00:00
cfea240243 Merge pull request #53 from MaSzyna-EU07/fix/scenery-file-events
fix: scenery files are looked at when they change, not every two seconds
v1.6.280
2026-11-16 16:00:36 +00:00
maj00r
f0fa2d1768 test(tapes): the tapes window, the choice asked before a start, the wheels and the doors from the other cab
- HaslerTapeWindow: with nothing recorded it offers to record and turns on the
  black box and the trains' tapes; a tape of the last launch is summed up with
  its scenario and train, and is no longer followed once the window closes.
- HaslerTapes.Load: a log begun anew over the end that was read is read whole
  once its time goes back; an unreadable tape is none and told in the log; a
  file read only forward is read whole each time. Empty log lines are passed over.
- MessageBox.Choose: the answer clicked, or none on the way back or on closing.
- CabPanel: wheels turning apart from the train are said beside its speed.
- EventList: going to the other cab tells nothing of the doors, still the switches.
- WarehouseEditTests and ConsistOrientationTests put in app-wide services of
  their own: they now wait their turn with the controls that read them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:58:31 +01:00
maj00r
2a85ca384a refactor(scenery): the looks at the scenery files timed by a class of their own, under test
When the main window looks at the scenery files - once the reports of a
save stop, back at the window, now and then anyway, seldom where the
system reports changes and often where it does not - is FolderLooks now,
on TimeProvider timers, so the tests drive the clock. The window keeps
only the look itself. A report coming as the window closes leaves the
disposed timers be.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:55:22 +01:00
maj00r
fa8ae760e1 fix(tests): the black box text tests wait their turn with the other Avalonia ones
EventTextsTests and SecurityBrakingTests from #55 ran beside the Avalonia
controls collection; their AppBuilder setup raced it and 28 UI tests failed
with "Setup was already called" on every runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:42:56 +01:00
maj00r
100bbea83e fix(tests): the black box text tests wait their turn with the other Avalonia ones
EventTextsTests and SecurityBrakingTests from #55 ran beside the Avalonia
controls collection; their AppBuilder setup raced it and 28 UI tests failed
with "Setup was already called" on every runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:42:56 +01:00
maj00r
195f358e55 refactor(tapes): the line of a tape drawn by a class of its own, so Sonar sees a figure ended after a gap
Sonar (S2583, the reliability rating of #54) took the end of a figure after a gap in Trace for code
never run: begun was changed by the local function Flush, and its analysis doesn't follow a local
changed that way. Nothing was wrong in what was drawn.

The columns of the line are kept by ColumnLine, in its fields, and drawn through the three calls it is
given, the figure begun, a line to the next point and its end; Trace hands it those of the
StreamGeometry. What is drawn is the same. Tests: a column entered where it started and left where it
ended through its lowest and highest, a break ending the figure and the next point beginning another,
a break with nothing drawn ending nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:06:58 +01:00
maj00r
be7b9c5679 Merge main into feat/tapes-from-blackbox
Conflicts:
- CabPanel.cs: main (#50) tells the screen reader what the panel draws, this branch keeps the km/h
  label for the speed of the wheels beside it and shows the doors as the cab sees them. Both kept, and
  the speed of the wheels, new on this branch, is told to the screen reader too, as all the rest.
- Records.cs: main (#55) adds the buzzers and the protection braking, this branch AsTheCabSees. Both kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:02:47 +01:00
maj00r
c370d1509e Merge main into fix/scenery-file-events
Conflict in MainWindow.axaml.cs, the Activated handler: main (#52) refreshes the list of simulators when
the settings are shown, this branch looks at the scenery files through _sceneryLook. Both kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:02:45 +01:00
3c9b578e6b Merge pull request #55 from MaSzyna-EU07/feat/command-descriptions
Black box: commands described, the protection's buzzer apart from its braking
2026-11-16 09:16:55 +00:00
952618be13 Merge pull request #52 from MaSzyna-EU07/fix/exe-list-refresh
fix: a simulator copied in while the starter runs is on the list
v1.6.268
2026-11-16 09:16:17 +00:00
156af3fdd1 Merge pull request #51 from MaSzyna-EU07/fix/noavx2-exe
fix: without AVX2 the starter starts the simulator built without it
v1.6.266
2026-11-16 09:16:05 +00:00
49b76aa66c Merge pull request #49 from MaSzyna-EU07/fix/reshade-beside-starter
fix: graphics wrappers beside the starter no longer reach its window
2026-11-16 09:15:52 +00:00
9b1523ef78 Merge pull request #50 from MaSzyna-EU07/fix/screen-reader-names
fix: a screen reader user can find, hear and work every part of the starter
v1.6.260
2026-11-16 09:15:39 +00:00
1d5b0ea1f4 Merge pull request #46 from MaSzyna-EU07/fix/linux-file-case
fix: find game data whatever the case of its names on Linux
v1.6.246
2026-11-16 09:14:44 +00:00
maj00r
8baf2149ea fix(blackbox): a buzzer named by the lamps of its buzzing samples only 2026-11-16 02:21:23 +01:00
maj00r
aebfaf34ac fix(blackbox): a buzzer cut by the power or the protection switched off is not acknowledged, and is named by every lamp it had
The keys tab's English names the train brake's positions and the dashboard light as the black box does.
2026-11-16 02:20:34 +01:00
maj00r
5bc5da3fbf feat(blackbox): the train protection's buzzer told apart from its braking
The buzzer has a colour of its own on the timeline and in the cab, no longer the braking's red, and an event of its
own: acknowledged after how long, or not acknowledged when the braking follows. The alerter's buzzer needs its lamp,
since a protection with one acknowledgement tells the cab signalling's buzzer as the alerter's too. Braking with no
lamp, the protection with no power, is not shown as the driver's on the timeline and in the cab either.
2026-11-16 02:17:57 +01:00
maj00r
e4d092ab3e fix(blackbox): the command texts set right, and in the old starter's languages as the keys tab has them
Spelling and wording fixed (świateł, piasecznica, dezaktywacja, podgrzewacz wody, the dashboard light, the
locomotive brake), and the train brake's service and full service positions told by what they set, not as the key
file swaps them. In Czech, Hungarian and Russian the commands are named in the old starter's key descriptions.
2026-11-16 02:17:57 +01:00
maj00r
632e1003ee fix(blackbox): the protection braking with no power not counted as the driver's
TSecuritySystem brakes whenever it has no power, a cab not yet started or a power cut, with no lamp
lit. Only braking with the alerter or the cab signalling lamp is the driver's not acknowledging.
2026-11-16 02:04:22 +01:00
maj00r
34ee131d61 feat(blackbox): the commands in the events and on the timeline told by what they do
Every command of a vehicle the simulator can record (input/command.cpp) has a Polish and an English
text: those with a key take the key file's and the starter's own, the rest are written out. A command
with no text keeps its name.
2026-11-16 02:04:22 +01:00
maj00r
faa06fb9d8 fix(settings): a profile or an ini exported takes the page's edits in a copy, so discarding them still works
Saving a profile or exporting eu07.ini captured the page's edits into the settings held, so
discarding them before a start showed them again and the start's save wrote them. The export
writes a copy with the edits in; the settings held stay as saved.
2026-11-16 01:24:17 +01:00
maj00r
829a3e7a3d fix(start): discarding unsaved settings lets go of the page's edits only, a failed key save starts nothing
- the page shows the settings as held again, not read from the file as Restore does, so what
  other pages set and not yet saved (the depot's filters, the window maximized) stays
- the start goes on only once nothing is left to be saved, the keys' file included
2026-11-16 01:20:36 +01:00
maj00r
5b43e29f9e fix(start): unsaved settings let go rather than started without, a failed save starts nothing
- the second answer discards the edits (as "Restore" does): kept, the starter would write
  them when it closes, with auto-close while the simulator reads the file
- a save that fails is said and the simulator is not started
- settings read again from a file changed outside leave the page with no edit of its own
- a closed tape window lets go of the file it read last, shown or not
2026-11-16 00:16:13 +01:00
maj00r
b63ba8fe2e feat(start): starting with unsaved settings asks first
Edits on the settings page (or of the keys) not saved yet: the start asks whether to save them
and start, start without them, or not start. Closing the question starts nothing. "Start
without saving settings" from the menu asks nothing, as it says what it does.
2026-11-16 00:09:36 +01:00
maj00r
76693c1494 fix(settings): an imported ini moved to the trains' tapes too, a closed tape window forgets only its own tape
- ImportFrom moves an ini of before the trains' tapes as a profile is
- HaslerTapes.Forget takes the file: a window closing lets go of its own tape, not of the one
  another window follows
2026-11-16 00:09:36 +01:00
maj00r
13990a7036 refactor(settings): the move to the trains' tapes made simple, by the black box line
An ini with no physicslog.trains line and blackbox yes gets physicslog.trains yes and
physicslog no. The line of the trains' tapes, written from then on even when turned off
again, is the mark that it was done; the starter.physicslog.moved key is gone. A profile
goes the same way as the ini.
2026-11-16 00:05:10 +01:00
maj00r
5ab9bce321 fix(settings): a profile is not moved to physicslog.trains, and a closed tape window keeps nothing
- the one-time move runs on the player's own settings only; a profile from before it keeps
  physicslog as it was, and the player's mark of the move stays when it is applied
- a read of the tapes under way when the window closes is let go
2026-11-16 00:01:46 +01:00
maj00r
f1d77addae fix(tapes): a followed tape cut shorter meanwhile is read as it is, let go when the window closes
- what is read up to the file's end counts, not the length taken before it; the end kept is
  made of the bytes read, with no second read
- the window of the tapes forgets the followed one when closed
- the door sides change only with the end of the cab, not when it is left (0)
2026-11-15 23:56:25 +01:00
maj00r
192f9fa499 feat(settings): the physics log of every vehicle left on is moved once to the tapes of the trains
"physicslog yes" was the speedometer's tapes in an earlier starter, and many
left it on: the log of every vehicle, hundreds of files on a big scenery. Read
with it on and not moved yet, it becomes physicslog.trains with the black box
(unless the ini turned the box off itself), marked starter.physicslog.moved so
it happens once: turned on again, it stays.
2026-11-15 23:53:36 +01:00
maj00r
92c0283479 feat(tapes): the tapes of every train, physicslog.trains, turned on with the tape recording
The simulator writes the .dat logs of the drivers of rail vehicles only with
"physicslog.trains yes": the tape of every train, without the road vehicles
and the passengers that make "physicslog yes" hundreds of files. The settings
have a box for it, "Turn on recording" of the tapes' window turns it on with
the black box, and a launch is noted and followed with it. The black box goes
with it when the ini says nothing of its own, as the simulator has it; the line
is written only once on, or where the file has it.
2026-11-15 23:46:27 +01:00
maj00r
b2fd53f7bc fix(blackbox): the doors' sides as the driver has them, from the rear cab swapped
The recording holds the left and right of the vehicle, and from its rear cab
the driver's left doors are the vehicle's right, as the simulator works them.
The cab panel and the events showed the vehicle's sides, so after a change of
direction to the other cab the doors opened on the wrong side. A change of the
cab tells nothing of the doors in the events.
2026-11-15 23:46:26 +01:00
maj00r
06513537f0 fix(tapes): a tape followed live reads only what was added, and a stall, a shared black box or a gap are told right
At a higher time speed the simulator's log grows many times faster, and the
live view read and split the whole file every two seconds. A followed tape now
keeps its reader and reads only the bytes added; one begun anew (shorter, its
end no longer what was read, or its time going back) is read whole.

From the review: a gap is over two seconds, above the frame the simulator
holds to a second, so a stall is driving or standing; a black box's time ends
by the start of the next one, as a downloaded one was last written later; the
summary shows what was recorded and what wasn't, and the trace breaks off at
a gap; the cab panel's wheels compare signed speeds and stay clear of the
gauges; each box's name is parsed once per listing.
2026-11-15 23:34:53 +01:00
maj00r
3f4a20097e fix: Sonar's remarks on the screen reader work, and tests for it
The cab panel's drawing and the consist narration are split into smaller
steps, with plain switches and concrete return types where Sonar asked.

Tests drive the black box panels, both tape views, the key bindings, the
windows opened over another, the search count and the themed tree
entries, sliders, number boxes, pickers and settings sections headless,
as someone at the keyboard with a screen reader meets them.
2026-11-15 22:06:55 +01:00
maj00r
38802845c7 test: no-AVX2 build names carry the date as the simulator writes it, 2026-11-15 2026-11-15 21:35:58 +01:00
maj00r
bba9e3ef48 fix: without AVX2 the starter starts the simulator built without it
The simulator now also comes built without AVX2, its file name ending in
_noavx2 (eu07-x64_<date>_<hash>_noavx2.exe, eu07_noavx2 on Linux), and both
builds can lie side by side in the game folder. The automatic choice took
eu07.exe or the shortest name and never that one, so a processor without
AVX2 got a simulator that stops at its first instruction and a notice
telling it to build its own.

Without AVX2 the automatic choice now takes the newest _noavx2 build, even
one through Wine before a native build that would not run. With AVX2 the
build made for it stays first and a _noavx2 one is used only when it is all
there is.

The notice comes only when what would start still needs AVX2. With a
_noavx2 build in the folder but another chosen by hand it names both and
offers to go back to the automatic choice; with none it says what such a
build is called and that the starter picks it up from the game folder.
2026-11-15 21:28:47 +01:00
maj00r
31fc4c3fdc fix: scenery files are looked at when they change, not every two seconds
The starter compared every file of every scenery each two seconds: on a full
installation 175 sceneries and 378 files, 15-18 ms a look, thirty looks a
minute with nothing changed. The system now reports changes in the scenery
folder and a look follows once the burst of a save has passed, 400 ms after
the last report.

The reports are only a hint. A look still comes on coming back to the window
and right after the simulator or its editor closes, and every 30 seconds
anyway, for network drives, Wine and Linux past its limit of watches, where
reports may not come. Where the folder cannot be watched at all the look
stays every two seconds as before. A change reported during a look is not
lost: one more look follows it.
2026-11-15 21:18:20 +01:00
maj00r
f29ce10f5c fix: a simulator copied in while the starter runs is on the list
The list of simulators in the settings was filled when they opened, so a new
eu07*.exe from CI or one's own build stayed missing until the starter was
reopened, and the older file was easy to start by mistake. The folder is now
looked at again when the settings page is shown, when the list takes focus
and when the window comes back to the front.

Looking again never changes the choice: a file picked from elsewhere, or one
since removed, stays chosen rather than falling back to automatic, and
nothing waits for Save after it. A list that did not change is left alone.

Closes #48
2026-11-15 21:13:53 +01:00
maj00r
ff5228555e fix: a blind player can bind keys, build a consist and read the tapes
A review against WCAG 2.2 AA left places a screen reader user could not work:

- Key bindings: a key's button says the command and the key, the clear button
  which command it clears; a new key is said aloud and focus comes back to its
  row. The on-screen keyboard is reached with Tab and walked with the arrows.
- Number fields read their label; the spin buttons are named and left out of Tab.
- Dialogs: Enter presses the main button, Esc closes, focus starts on the first
  button and the message is read with it.
- Consist: every change is said - added, removed, turned, moved, replaced,
  undone - and the strip is a named list; a turned card says so.
- Searches say how many entries are left once typing pauses.
- Hasler tapes, the black box timeline, timetable and cab panel take focus, work
  from the keyboard, read their value as it changes and draw a focus frame.
- Section reset and level controls, the crew button and the tabs carry names;
  English names from Avalonia's templates are read in the starter's language;
  sort and crew menus are radio items.
- Input borders reach 3:1 against the panels; Tab starts at the top bar; the
  splash screen has a title and its progress reads the loading step.
2026-11-15 20:46:55 +01:00
maj00r
07bd3d27fb fix: a tree entry tells its state wherever the mouse is on its row
Windows passes over the parts of a template when it looks for what lies under the
mouse, so the gaps beside the arrow and after the name led to the entry, which
told no state: NVDA said "Całkowo" there and "Całkowo zwinięte" on the name.
The row is now a control and is found in those gaps.
2026-11-15 20:07:26 +01:00
maj00r
ee6da4c8ee fix: nothing under the mouse is silent: dividers, previews, class pictures, categories
A page swept point by point left a few places a reader heard nothing: the panel
dividers, the vehicle preview in the depot and the texture base, the picture by
a vehicle class and the empty part of the settings categories. Each now has a
name; a picture with a caption beside it reads as the caption.

The tests that build controls run one after another: a control belongs to the
thread that made the first one, and side by side they now and then failed.
2026-11-15 20:01:25 +01:00
maj00r
184629b544 fix: NVDA hears a tree entry open, a list's new choice and the pictures and figures
Under the mouse a reader hears only what lies there. The row of a tree entry now
carries whether it is open, an arrow or icon in it its name; a picture takes the
name of the button or card it sits in, the scenery picture says what it shows; a
consist figure is one text, label and value together.

Avalonia tells Windows of a closed list's new value only for a list one types
into, so going through the weathers with the arrows was silent; the new choice
is now said aloud.
2026-11-15 19:39:09 +01:00
maj00r
95f1cd2398 fix: NVDA reads the tree entry, slider and help button under the mouse
The tree entry listed the entries under it as its own children, so the controls
inside it lost their way up and Windows failed every lookup there. It now only
points up to the entry it hangs under, which is all the level needs.

The buttons and knob of a slider's track had no name; they now say the slider's
name and value. A button showing only a sign such as "?" takes its tooltip.
2026-11-15 19:07:20 +01:00
maj00r
edd530cb4b fix: NVDA says the section focus enters, a setting's explanation and each fog step
NVDA passes over a group that is not content as well as control, so titled
panels and the landmarks are now both. A setting's explanation and the note on
why the simulator ignores it are read after its name. The key under each setting
is no longer a silent stop for Tab, and a step of the fog slider moves the shown
distance.
2026-11-15 18:45:06 +01:00
maj00r
d2b8cdf3ba fix: a screen reader hears which sceneries lie under a group
Avalonia hung the entries under a group on the panel inside it, so NVDA counted
every scenery at level one and the tree sounded flat. An open group now gives its
entries as its own, and each entry names its group as its parent: Całkowo is
level one, calkowo_lotos under it level two.
2026-11-15 18:36:23 +01:00
maj00r
099ff3603e fix: a field without a name is read by the label beside it
A list, box, slider or picker with no name of its own takes the text a sighted
reader sees next to it: to its left in a grid row, above it in a grid column, or
just before it in a panel. The name follows the label into another language.
2026-11-15 18:09:13 +01:00