mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-04 13:15:48 +01:00
Match scenery vehicles by folder too, as the old starter did
The old starter looked a vehicle up by folder, skin and model. The folder was left out here, and 39 skin names recur across folders - "red" is a Clio, an Audi and a crane - so a vehicle could get another folder's livery.
This commit is contained in:
@@ -67,14 +67,14 @@ public static class TrainsetDisplay
|
||||
|
||||
public static string VehicleLabel(Dynamic v, bool head = false)
|
||||
{
|
||||
var tex = AppServices.Current.Library.Vehicles.TextureFor(v.SkinFile, v.MmdFile);
|
||||
var tex = AppServices.Current.Library.Vehicles.TextureFor(v.DataFolder, v.SkinFile, v.MmdFile);
|
||||
string? cls = string.IsNullOrEmpty(tex?.ResolvedClass) ? null : tex!.ResolvedClass;
|
||||
string? name = string.IsNullOrWhiteSpace(v.Name) ? null : v.Name;
|
||||
return (head ? name ?? cls : cls ?? name) ?? BaseSkin(v);
|
||||
}
|
||||
|
||||
public static bool IsPowered(Dynamic v) =>
|
||||
AppServices.Current.Library.Vehicles.TextureFor(v.SkinFile, v.MmdFile)?.ResolvedCategory
|
||||
AppServices.Current.Library.Vehicles.TextureFor(v.DataFolder, v.SkinFile, v.MmdFile)?.ResolvedCategory
|
||||
is "e" or "s" or "p" or "z" or "a";
|
||||
|
||||
private static string BaseSkin(Dynamic v) =>
|
||||
@@ -206,7 +206,7 @@ public static class TrainsetDisplay
|
||||
|
||||
bool mu = trainset.Vehicles.Any(v =>
|
||||
{
|
||||
string? cat = db.TextureFor(v.SkinFile, v.MmdFile)?.ResolvedCategory;
|
||||
string? cat = db.TextureFor(v.DataFolder, v.SkinFile, v.MmdFile)?.ResolvedCategory;
|
||||
return cat is "z" or "a";
|
||||
});
|
||||
|
||||
@@ -232,7 +232,7 @@ public static class TrainsetDisplay
|
||||
|
||||
public static string PreferredBaseName(Dynamic v, VehicleCatalog db)
|
||||
{
|
||||
var tex = db.TextureFor(v.SkinFile, v.MmdFile);
|
||||
var tex = db.TextureFor(v.DataFolder, v.SkinFile, v.MmdFile);
|
||||
if (tex != null)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user