Add MrGameEng.Mods: mod loading, JSON defs and localization
CI / build-test (push) Failing after 1m8s

Mods are folders with About/About.json metadata; ModLoader resolves a
deterministic load order (dependencies first, ties alphabetical) and
later mods override earlier ones everywhere.

DefDatabase loads JSON def files ({ "type", "defs": [...] }) into
game-registered Def subclasses, with parent inheritance (own fields on
top of the parent's, nested values replaced whole), abstract parents
and full replacement of same-named defs by later mods.

LanguageManager loads Languages/<code>/*.json flat key-string maps,
switches language at runtime and falls back current -> default -> key.

ModContentTree merges one content folder across mods by relative path;
AtlasBuilder gains an explicit-sources Build overload so a merged
texture tree can be packed incrementally at game start.

The LittleSim game now ships its entire content as the Core mod,
demonstrating the module end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-11 21:51:17 +03:00
co-authored by Claude Fable 5
parent 501d81e19f
commit 5d3c18de40
16 changed files with 1114 additions and 11 deletions
+30
View File
@@ -53,6 +53,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrGameEng.Pathfinding.Tests
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrGameEng.Collisions.Tests", "tests\MrGameEng.Collisions.Tests\MrGameEng.Collisions.Tests.csproj", "{B8C132F5-C4C8-4931-B0CE-885811F44DB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrGameEng.Mods", "src\MrGameEng.Mods\MrGameEng.Mods.csproj", "{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrGameEng.Mods.Tests", "tests\MrGameEng.Mods.Tests\MrGameEng.Mods.Tests.csproj", "{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -327,6 +331,30 @@ Global
{B8C132F5-C4C8-4931-B0CE-885811F44DB0}.Release|x64.Build.0 = Release|Any CPU
{B8C132F5-C4C8-4931-B0CE-885811F44DB0}.Release|x86.ActiveCfg = Release|Any CPU
{B8C132F5-C4C8-4931-B0CE-885811F44DB0}.Release|x86.Build.0 = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|x64.ActiveCfg = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|x64.Build.0 = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|x86.ActiveCfg = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Debug|x86.Build.0 = Debug|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|Any CPU.Build.0 = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|x64.ActiveCfg = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|x64.Build.0 = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|x86.ActiveCfg = Release|Any CPU
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592}.Release|x86.Build.0 = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|x64.ActiveCfg = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|x64.Build.0 = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|x86.ActiveCfg = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Debug|x86.Build.0 = Debug|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|Any CPU.Build.0 = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|x64.ActiveCfg = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|x64.Build.0 = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|x86.ActiveCfg = Release|Any CPU
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -354,5 +382,7 @@ Global
{E069CBFD-F4FA-4400-84AE-090F9B81BDFC} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{D9FFA22D-0CFF-4A1E-AD56-BA4BD00526B3} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{B8C132F5-C4C8-4931-B0CE-885811F44DB0} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{1EB7D51B-CF32-4EB3-881B-C20AED6ED592} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{1C0BBFAC-6A4F-4541-8703-E9C77F637BAF} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
EndGlobalSection
EndGlobal