1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed json validation

This commit is contained in:
Ivan Savenko 2023-04-24 16:28:48 +03:00
parent d6d679a38c
commit 5e3a0a1a75
3 changed files with 15 additions and 7 deletions

View File

@ -22,21 +22,24 @@
"type":"array",
"description": "Background sound of an object",
"items": {
"type": "string"
"type": "string",
"format" : "soundFile"
}
},
"visit": {
"type":"array",
"description": "Sound that played on object visit",
"items": {
"type": "string"
"type": "string",
"format" : "soundFile"
}
},
"removal": {
"type":"array",
"description": "Sound that played on object removal",
"items": {
"type": "string"
"type": "string",
"format" : "soundFile"
}
}
}

View File

@ -47,7 +47,8 @@
"music":
{
"type": "string",
"description": "Music filename to play on this terrain on adventure map"
"description": "Music filename to play on this terrain on adventure map",
"format": "musicFile"
},
"tiles":
{
@ -78,12 +79,14 @@
"horseSound":
{
"type": "string",
"description": "Hero movement sound for this terrain, version for moving on tiles with road"
"description": "Hero movement sound for this terrain, version for moving on tiles with road",
"format": "soundFile"
},
"horseSoundPenalty":
{
"type": "string",
"description": "Hero movement sound for this terrain, version for moving on tiles without road"
"description": "Hero movement sound for this terrain, version for moving on tiles without road",
"format": "soundFile"
},
"shortIdentifier":
{
@ -112,7 +115,8 @@
"description": "list of ambient sounds for this terrain",
"items":
{
"type": "string"
"type": "string",
"format": "soundFile"
}
}
}

View File

@ -1047,6 +1047,7 @@ namespace
std::string musicFile(const JsonNode & node)
{
TEST_FILE(node.meta, "Music/", node.String(), EResType::MUSIC);
TEST_FILE(node.meta, "", node.String(), EResType::MUSIC);
return "Music file \"" + node.String() + "\" was not found";
}