Starter improvements

- scenery Description
- scenery mini
- extracted translations outside
- autoselect first consist on scenery selection
- autoexpand on group click
This commit is contained in:
2026-06-17 22:00:01 +02:00
parent 9be97c7bda
commit b2f693113d
22 changed files with 776 additions and 634 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -74,6 +74,9 @@ public partial class Scenarios : UserControl
Scenery selectedScn = Sceneries[tag];
vehicleList.Items.Clear();
// scenery-level info (distinct from the per-consist scenario description)
ShowSceneryInfo(selectedScn);
// add all trainsets to list
for (int i = 0; i < selectedScn.Trainsets.Count; i++)
{
@@ -91,6 +94,29 @@ public partial class Scenarios : UserControl
}
// Shows the selected scenery's description (//$d) and 1:1 image (//$i).
private void ShowSceneryInfo(Scenery scenery)
{
sceneryDescription.Text = scenery.Description;
string? imagePath = scenery.ImagePath;
if (imagePath is not null)
{
try
{
sceneryImage.Source = new Bitmap(imagePath);
}
catch
{
sceneryImage.Source = null; // unreadable / unsupported image
}
}
else
{
sceneryImage.Source = null;
}
}
private void VehicleList_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
// get selected scenery
@@ -190,4 +216,4 @@ public partial class Scenarios : UserControl
// executable not found / not configured yet
}
}
}
}