18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 21:45:16 +01:00
Files
maszyna/editor
jerrrrycho a25abe6d5d fix(editor): stray switch drives told once a frame, by the same switch lookup the deletion uses (#509)
* fix(editor): tell the stray switch drives once a frame, by the test the deletion uses

stray_drives() was built anew by each caller in a frame (the notice at the
start, the red marks in the view, the list in the switch tool). It now keeps
its list for the frame and builds it again after a step of the undo history.

A drive whose switch shares its name with another switch was listed as
having no switch once the later of the two was deleted: the name went with
the deleted track, and only the deletion looked for the other track of the
name. Both now use switch_drives::standing_switches, which falls back to the
tracks of the scenery when the name finds none.

The switches each drive template throws were read once per file until a
restart. switch_drives::template_switches reads them again when the
templates change (a rescan or a save in the editor), and a file that could
not be read is tried again in a later frame.

Refs #330

* test(editor): the switch lookup of the drives and the cache of the drive templates

Refs #330

* test(editor): include <algorithm> for std::ranges::find

Refs #330
2026-11-26 22:25:59 +01:00
..