Show vehicle and texture info when a browser entry is picked

The General and About texture tabs only ever described the selected consist car,
so clicking a vehicle in the list told the user nothing about it.
This commit is contained in:
maj00r
2026-09-04 22:29:04 +02:00
parent df21ec104f
commit b9f455e33d
4 changed files with 33 additions and 0 deletions

View File

@@ -122,6 +122,26 @@ public sealed class VehicleDetails
AddConsistLoadSection();
}
public void ShowTexture(VehicleTexture texture)
{
generalPanel.Children.Clear();
consistTexturePanel.Children.Clear();
var inv = CultureInfo.InvariantCulture;
var physics = _info.PhysicsFor(texture);
generalPanel.Children.Add(Reading($"{App.Loc["Length"]} [m]",
physics?.Length.ToString("0.##", inv)));
generalPanel.Children.Add(Reading($"{App.Loc["Mass"]} [t]",
physics is null ? null : (physics.Mass / 1000.0).ToString("0.#", inv)));
generalPanel.Children.Add(Reading($"{App.Loc["VMax"]} [km/h]",
physics?.VMax.ToString("0", inv)));
generalPanel.Children.Add(Reading(App.Loc["Model"], texture.Model));
generalPanel.Children.Add(Reading(App.Loc["Texture"], texture.Skinfile));
_showTextureInfo(texture, consistTexturePanel);
}
private void BuildGeneralInfo(ConsistItem item)
{
var car = _consist.ActiveCar(item);