17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 14:29:20 +02:00

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

This commit is contained in:
maj00r
2026-10-11 20:46:20 +02:00
parent b4a1cb03b3
commit 080e308d5e
4 changed files with 34 additions and 1 deletions

View File

@@ -405,6 +405,19 @@ void editor_mode::selftest_step()
m_switch.drive_side = side;
WriteLog("SELFTEST switchdrive: " + (index >= 0 && index < static_cast<int>(m_switch.drives.size()) ? m_switch.drives[index].name : std::string{"none"}));
}
else if (command == "drivechoice")
{
int index{-1}, side{0};
words >> index >> side;
scan_switch_drives();
m_switch.drive = index;
m_switch.drive_side = side;
m_switch.status.clear();
auto *track{selected_track()};
if (track != nullptr && track->eType == tt_Switch && false == track->m_editorremoved)
apply_switch_drive_choice(*track);
WriteLog("SELFTEST drivechoice: " + (track != nullptr ? track->name() : std::string{"no switch"}) + ", " + m_switch.status);
}
else if (command == "drives")
{
std::string name;