mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Instructions for setting up schemas on Visual Studio
This commit is contained in:
parent
ab3a04f50f
commit
ba2a9e7127
@ -15,3 +15,17 @@ As of now, only Buildings.json has a proper schema
|
|||||||
|
|
||||||
Tada! Now Android Studio will recognize all Buildings.json files as belonging to that schema, and will warn you of inconsistencies!
|
Tada! Now Android Studio will recognize all Buildings.json files as belonging to that schema, and will warn you of inconsistencies!
|
||||||
|
|
||||||
|
## Using VSCode
|
||||||
|
|
||||||
|
- ctrl-shift-p, search "open user settings (json)", enter
|
||||||
|
- Copy this into the settings:
|
||||||
|
```json
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"*/Buildings.json"
|
||||||
|
],
|
||||||
|
"url": "https://raw.githubusercontent.com/yairm210/Unciv/14c5d9eb177cee719843336512b587780b59c452/docs/Modders/schemas/buildings.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
@ -2,48 +2,52 @@
|
|||||||
"$schema": "http://json-schema.org/draft-07/schema",
|
"$schema": "http://json-schema.org/draft-07/schema",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"allOf": [
|
||||||
"properties": {
|
{ "$ref": "#/definitions/stats"},
|
||||||
"name": { "type": "string" },
|
{
|
||||||
"uniques": {
|
"type": "object",
|
||||||
"type": "array",
|
"properties": {
|
||||||
"items": {
|
"name": { "type": "string" },
|
||||||
"type": "string",
|
"uniques": {
|
||||||
"pattern": "^[^><]*(\\<[^>]*\\>[^><]*)*$"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[^><]*(\\<[^>]*\\>[^><]*)*$"
|
||||||
|
},
|
||||||
|
"uniqueItems": true // Can't imagine you mean to include the same thing twice
|
||||||
|
},
|
||||||
|
"civilopediaText": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/civilopediaText"}
|
||||||
|
},
|
||||||
|
"requiredTech": { "type": "string" },
|
||||||
|
"cost": { "type": "number" },
|
||||||
|
"maintenance": { "type": "number" },
|
||||||
|
"percentStatBonus": { "$ref": "#/definitions/stats" },
|
||||||
|
"specialistSlots": { "type": "object" },
|
||||||
|
"greatPersonPoints": { "type": "object" },
|
||||||
|
"hurryCostModifier": { "type": "number" },
|
||||||
|
"isWonder": { "type": "boolean" },
|
||||||
|
"isNationalWonder": { "type": "boolean" },
|
||||||
|
"requiredBuilding": { "type": "string" },
|
||||||
|
"requiredResource": { "type": "string" },
|
||||||
|
"requiredNearbyImprovedResources": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" }
|
||||||
|
},
|
||||||
|
"cityStrength": { "type": "number" },
|
||||||
|
"cityHealth": { "type": "number" },
|
||||||
|
"replaces": { "type": "string" },
|
||||||
|
"uniqueTo": { "type": "string" },
|
||||||
|
"quote": { "type": "string" },
|
||||||
|
"replacementTextForUniques": { "type": "string" }
|
||||||
},
|
},
|
||||||
"uniqueItems": true // Can't imagine you mean to include the same thing twice
|
"required": [
|
||||||
},
|
"name"
|
||||||
"civilopediaText": {
|
],
|
||||||
"type": "array",
|
"additionalProperties": false
|
||||||
"items": { "$ref": "#/definitions/civilopediaText"}
|
}
|
||||||
},
|
|
||||||
"requiredTech": { "type": "string" },
|
|
||||||
"cost": { "type": "number" },
|
|
||||||
"maintenance": { "type": "number" },
|
|
||||||
"percentStatBonus": { "$ref": "#/definitions/stats" },
|
|
||||||
"specialistSlots": { "type": "object" },
|
|
||||||
"greatPersonPoints": { "type": "object" },
|
|
||||||
"hurryCostModifier": { "type": "number" },
|
|
||||||
"isWonder": { "type": "boolean" },
|
|
||||||
"isNationalWonder": { "type": "boolean" },
|
|
||||||
"requiredBuilding": { "type": "string" },
|
|
||||||
"requiredResource": { "type": "string" },
|
|
||||||
"requiredNearbyImprovedResources": {
|
|
||||||
"type": "array",
|
|
||||||
"items": { "type": "string" }
|
|
||||||
},
|
|
||||||
"cityStrength": { "type": "number" },
|
|
||||||
"cityHealth": { "type": "number" },
|
|
||||||
"replaces": { "type": "string" },
|
|
||||||
"uniqueTo": { "type": "string" },
|
|
||||||
"quote": { "type": "string" },
|
|
||||||
"replacementTextForUniques": { "type": "string" }
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"name"
|
|
||||||
],
|
],
|
||||||
"allOf": [{ "$ref": "#/definitions/stats"}],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"stats": {
|
"stats": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user