mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-04 13:15:48 +01:00
Tell apart the halves of a unit that share one skin
The ET42-026 dresses both halves in 112E-026 and the scenery tells them apart by the model. Textures were keyed by the skin alone, so the B half became a second A: not part of the set, and listed on its own. A shared skin now gets the model in its id, vehicles are looked up by skin and model, and the vehicle cache is rebuilt for the new ids.
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.TextureForSkin(v.SkinFile);
|
||||
var tex = AppServices.Current.Library.Vehicles.TextureFor(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.TextureForSkin(v.SkinFile)?.ResolvedCategory
|
||||
AppServices.Current.Library.Vehicles.TextureFor(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.TextureForSkin(v.SkinFile)?.ResolvedCategory;
|
||||
string? cat = db.TextureFor(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.TextureForSkin(v.SkinFile);
|
||||
var tex = db.TextureFor(v.SkinFile, v.MmdFile);
|
||||
if (tex != null)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user