Enhance UI components for map editing and school creation. Update styles for improved layout and responsiveness, including adjustments to dialog positioning and flex properties. Introduce new localization strings for better user guidance in both English and Russian. Refactor code structure for clarity and maintainability, ensuring a more intuitive user experience.
This commit is contained in:
@@ -33,4 +33,42 @@ public class MapViewTests
|
||||
Assert.Empty(corridor.Items);
|
||||
Assert.Empty(corridor.Positions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FloorLabel_FollowsTheDefLabelInsteadOfReplacingIt()
|
||||
{
|
||||
var catalog = new CatalogLoader().Load(
|
||||
[CatalogLoader.CorePackId],
|
||||
[
|
||||
new ContentDocument(
|
||||
CatalogLoader.CorePackId,
|
||||
"defs/floors/standard.jsonc",
|
||||
"""{ "defName": "StandardFloor" }"""),
|
||||
new ContentDocument(
|
||||
CatalogLoader.CorePackId,
|
||||
"defs/territories/yard.jsonc",
|
||||
"""{ "defName": "Yard" }"""),
|
||||
new ContentDocument(
|
||||
CatalogLoader.CorePackId,
|
||||
"localizations/ru.jsonc",
|
||||
"""{ "StandardFloor": "Этаж", "Yard": "Двор" }"""),
|
||||
]);
|
||||
|
||||
var map = new MapLayout
|
||||
{
|
||||
Territory = new TerritoryNode { Id = "yard", Def = "Yard" },
|
||||
Buildings = [new BuildingNode { Id = "main", Def = "Main" }],
|
||||
Floors =
|
||||
[
|
||||
new FloorNode { Id = "floor-1", Def = "StandardFloor", Building = "main", Label = "1" },
|
||||
new FloorNode { Id = "floor-2", Def = "StandardFloor", Building = "main" },
|
||||
],
|
||||
};
|
||||
|
||||
var nodes = MapView.Build(catalog, map, "ru");
|
||||
|
||||
// A bare "1" in the tree is the label on its own; the def label carries the noun.
|
||||
Assert.Equal("Этаж 1", nodes.Single(node => node.Id == "floor-1").Name);
|
||||
Assert.Equal("Этаж", nodes.Single(node => node.Id == "floor-2").Name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user