mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-06 21:48:35 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user