소스 검색

Fixed json validation

Ivan Savenko 2 년 전
부모
커밋
5e3a0a1a75
3개의 변경된 파일15개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 3
      config/schemas/objectType.json
  2. 8 4
      config/schemas/terrain.json
  3. 1 0
      lib/JsonDetail.cpp

+ 6 - 3
config/schemas/objectType.json

@@ -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"
 					}
 				}
 			}

+ 8 - 4
config/schemas/terrain.json

@@ -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"
 					}
 				}
 			}

+ 1 - 0
lib/JsonDetail.cpp

@@ -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";
 		}