Collections are packages of their own

A collection is no longer a file inside a mod: it is a package (folder or zip)
named after its id with collection.json, cover and optional locale/, shipped in
collections/ next to the mods or kept by the player in user://collections/.
Covers and texts come from the package; mods do not ship collections.
This commit is contained in:
cthangover committed 2026-10-18 19:21:34 +02:00
1 parent 0d1f73f19e
commit 2cc409f12a
3 files changed
+20 -7

No files matched your search

+3 -3
View File
@@ -170,13 +170,13 @@ namespace Cthangover.LocaleAtlas.Tests
[ModTest("map/collection_texts_need_every_language")]
static void CollectionTextsNeedEveryLanguage(ModTestContext ctx)
{
var mod = new MemoryProvider("m")
var package = new MemoryProvider("c")
.Add("locale/en.properties", "x = X\n")
.Add("locale/ru.properties", "x = Икс\n")
.Add("collections/c.json",
.Add("collection.json",
"{ \"id\": \"c\", \"name\": \"Game\", \"locale\": [ { \"lang\": \"ru\", \"name\": \"Игра\" } ],\n" +
" \"mechanics\": [ { \"id\": \"m1\", \"name\": \"Story\" }, { \"id\": \"m2\", \"name\": \"@x\" } ] }");
var result = LocaleAtlasBuilder.Build(new[] { ("m", (IModFileProvider)mod) });
var result = LocaleAtlasBuilder.Build(new[] { (LocaleAtlasBuilder.CollectionSourcePrefix + "c", (IModFileProvider)package) });
var missing = result.Findings.Where(f => f.Code == "collection_text_missing").ToList();
ModAssert.Equal(1, missing.Count, "only the literal mechanic without ru: " + string.Join("; ", missing.Select(f => f.Message)));
ModAssert.Equal("m1", missing[0].Key, "mechanic id");