17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 22:07:28 +01:00

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

This commit is contained in:
maj00r
2026-10-11 20:32:59 +02:00
parent b103a561e0
commit 71bdf8e284
5 changed files with 15 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ FOLDER = 'scenery/tory/napedy'
PATTERN = re.compile(r'^(ele1?|mech[12]?)-rz([lp])-([lp])((?:_[a-z]+)*)\.inc$')
KINDS = {'ele': 'elektryczny', 'mech': 'mechaniczny'}
DEFAULT = 'ele'
HEIGHTS = {'ele': 0.15, 'ele1': 0.15, 'mech': 0.05, 'mech1': 0.05}
def examine(path, file):
@@ -49,7 +50,7 @@ def examine(path, file):
'name: ' + family,
'category: switch drive',
'description: "' + description + '"',
'switch: {hand: %s, drive: %s%s}' % (hand, side, ', default: true' if family == DEFAULT else ''),
'switch: {hand: %s, drive: %s, height: %s%s}' % (hand, side, HEIGHTS.get(family, 0), ', default: true' if family == DEFAULT else ''),
'params:',
' - {id: 1, role: track, label: Switch}',
' - {id: 2, role: pos.x}',