1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-31 22:59:54 +02:00
Ivan Savenko aeb6c0be26 Support for replacement of individual entries in json lists
It is now possible for mods to modify json lists precisely, without full
replacement. Supported options:
- `append`: appends a single item to end of list
- `appendItems`: appends multiple items to end of list
- `insert@NUM`: inserts a single item *before* item NUM (item counting
is 0-based)
- `modify@NUM`: allows editing of a single item NUM (item counting is 0-
based)

Example - addition of a new item into town hall slots:
```json
"hallSlots":
{
	"modify@4" : {
		"append" : [ "dwellingLvl7B", "dwellingUpLvl7B" ]
	}
},
```
This would modify 4th element (last row) by appending new entry to the
end of last row

```json
{
	"modify@4" : {
		"insert@1" : [ "dwellingLvl5B", "dwellingUpLvl5B" ]
	}
},
```
This would add new slot not in the end of last row, but before 1st item
(between 5th and 6th dwellings)
2025-03-27 19:22:50 +00:00
..
2024-12-05 23:31:03 +01:00
2024-02-26 12:55:49 +02:00
2024-02-26 12:55:49 +02:00
2024-02-26 12:55:49 +02:00