1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
vcmi/lib/json
Ivan Savenko 6056d385ed Always load json configs from mod that references it
This should fix rather common problem with mods, where two unrelated mods
accidentally use same file name for a config file, leading to very unclear
conflict since this result in a file override.

Now all config files referenced in mod.json are loaded specifically from
filesystem of mod that referenced it. In other words, it is no longer
possible for one mod to override config from another mod.

As a side effect, this allows mods to use shorter directory layout, e.g.
`config/modName/xxx.json` can now be safely replaced with `config/
xxx.json` without fear of broken mod if there is another mod with same
path to config. Similarly, now all mods can use `config/translation/
language.json` scheme for translation files

Since this is no longer a problem, I've also simplified directory layout
of our built-in 'vcmi' mod, by moving all files from `config/vcmi`
directory directly to `config` directory.

- Overrides for miscellaneous configs like mainmenu.json should works as
before
- Images / animations (png's or def's) work as before (and may still
result in confict)
- Rebalance mods work as before and can modify another mod via standard
`modName:objectName` syntax
2024-10-31 14:49:11 +00:00
..
JsonBonus.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
JsonBonus.h Replace bonus string description with metastring that can properly 2024-04-09 16:13:30 +03:00
JsonFormatException.h Converted json validator into a class 2024-02-26 12:55:49 +02:00
JsonNode.cpp Always load json configs from mod that references it 2024-10-31 14:49:11 +00:00
JsonNode.h Always load json configs from mod that references it 2024-10-31 14:49:11 +00:00
JsonParser.cpp Implemented JSON5 line ending escapings 2024-10-26 14:21:23 +00:00
JsonParser.h Cleanup 2024-02-26 12:55:49 +02:00
JsonRandom.cpp Split CHeroHandler.cpp/.h into 1 file per class 2024-10-13 14:01:09 +00:00
JsonRandom.h Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
JsonUtils.cpp Always load json configs from mod that references it 2024-10-31 14:49:11 +00:00
JsonUtils.h Always load json configs from mod that references it 2024-10-31 14:49:11 +00:00
JsonValidator.cpp Fix some of the new warnings from sonarcloud 2024-10-11 10:45:29 +00:00
JsonValidator.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
JsonWriter.cpp Cleanup 2024-02-26 12:55:49 +02:00
JsonWriter.h Unify formatting 2024-02-26 12:55:49 +02:00