Enhance apparel definitions: Introduce 'UpperUnderwear' layer and related items (Bra, SportsBra, SoftBra) to support gender-specific clothing. Update inventory and dress generation logic to accommodate new layers and ensure proper coverage. Adjust localization for new apparel terms and refine tests for underwear functionality.

This commit is contained in:
Leonid Pershin
2026-08-20 07:20:40 +03:00
parent 2af85e1c41
commit 660340c216
24 changed files with 527 additions and 108 deletions
+4 -1
View File
@@ -14,6 +14,7 @@ public static class ApparelDresser
private static readonly string[] LayerOrder =
[
ApparelLayers.Underwear,
ApparelLayers.UpperUnderwear,
ApparelLayers.Socks,
ApparelLayers.Bottom,
ApparelLayers.Top,
@@ -127,7 +128,9 @@ public static class ApparelDresser
var chosen = new List<InventoryItem>();
var occupied = new HashSet<string>(StringComparer.Ordinal);
var candidates = pool
.Where(entry => catalog.Things.TryGetValue(entry.Item.Def, out var def) && def.Layers.Count > 0)
.Where(entry => catalog.Things.TryGetValue(entry.Item.Def, out var def)
&& !def.Abstract
&& def.Layers.Count > 0)
.Select(entry => (Item: entry.Item, Def: catalog.Things[entry.Item.Def]))
.Where(entry => SexFits(entry.Def, context.Female) && AgeFits(entry.Def, context.Age))
.ToList();
+1 -1
View File
@@ -203,7 +203,7 @@ internal static class ApparelWear
}
private static bool IsApparel(DefCatalog catalog, string defName) =>
catalog.Things.TryGetValue(defName, out var def) && def.Layers.Count > 0;
catalog.Things.TryGetValue(defName, out var def) && !def.Abstract && def.Layers.Count > 0;
private static string? NearestColor(DefCatalog catalog, string defName, string? current)
{