Enhance map layout and room definitions by adding optional labels for rooms and updating the API to support new room naming conventions. Introduce additional room types and localization strings for improved user experience in both English and Russian. Refactor map view logic to accommodate new room attributes and ensure accurate rendering in the UI. Update tests to validate changes in room structure and localization.
ci / server (push) Failing after 3m35s
ci / client (push) Successful in 13s

This commit is contained in:
Leonid Pershin
2026-08-18 16:47:37 +03:00
parent 7658443cd5
commit 6ca9ff9d03
18 changed files with 379 additions and 18 deletions
+11 -6
View File
@@ -84,7 +84,7 @@ public static class MapView
MapNodeKind.Room,
room.Id,
room.Floor,
LabelOf(catalog, locale, DefKind.Room, room.Def),
RoomName(catalog, locale, room),
items,
PositionsOf(catalog, locale, DefKind.Room, room.Def)));
}
@@ -117,12 +117,17 @@ public static class MapView
private static string FloorName(DefCatalog catalog, string locale, FloorNode floor)
{
var defLabel = LabelOf(catalog, locale, DefKind.Floor, floor.Def);
if (string.IsNullOrWhiteSpace(floor.Label))
{
return defLabel;
}
return string.IsNullOrWhiteSpace(floor.Label) ? defLabel : $"{defLabel} {floor.Label}";
}
return defLabel == floor.Def ? floor.Label : $"{defLabel} {floor.Label}";
/// <summary>
/// Same rule as floors: <see cref="RoomNode.Label"/> is "1A", not a replacement for "Classroom".
/// Do not treat "label equals defName" as "untranslated" — English classrooms are named Classroom.
/// </summary>
private static string RoomName(DefCatalog catalog, string locale, RoomNode room)
{
var defLabel = LabelOf(catalog, locale, DefKind.Room, room.Def);
return string.IsNullOrWhiteSpace(room.Label) ? defLabel : $"{defLabel} {room.Label}";
}
private static string LabelOf(DefCatalog catalog, string locale, DefKind kind, string defName) =>