mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
e8354908c3
Minor changes: * default log level set to trace * LOG_TRACE raii guardian lifetime will last till the end of block * compile fixes * minor refactorings
226 lines
5.4 KiB
JSON
226 lines
5.4 KiB
JSON
// This is schema for checking game settings from settings.json
|
|
// Any new settings should be added in this file for correct serialization and initialization
|
|
{
|
|
"type" : "object",
|
|
"$schema": "http://json-schema.org/draft-04/schema",
|
|
"required" : [ "general", "video", "adventure", "battle", "server", "logging" ],
|
|
"definitions" : {
|
|
"logLevelEnum" : {
|
|
"type" : "string",
|
|
"enum" : [ "trace", "debug", "info", "warn", "error" ]
|
|
}
|
|
},
|
|
"additionalProperties" : false,
|
|
"properties":
|
|
{
|
|
"general" : {
|
|
"type" : "object",
|
|
"default": {},
|
|
"additionalProperties" : false,
|
|
"required" : [ "classicCreatureWindow", "playerName", "showfps", "music", "sound" ],
|
|
"properties" : {
|
|
"classicCreatureWindow" : {
|
|
"type" : "boolean",
|
|
"default" : false
|
|
},
|
|
"playerName" : {
|
|
"type":"string",
|
|
"default" : "Player"
|
|
},
|
|
"showfps" : {
|
|
"type" : "boolean",
|
|
"default" : false
|
|
},
|
|
"music" : {
|
|
"type" : "number",
|
|
"default" : 88
|
|
},
|
|
"sound" : {
|
|
"type" : "number",
|
|
"default" : 88
|
|
}
|
|
}
|
|
},
|
|
"video" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default": {},
|
|
"required" : [ "screenRes", "bitsPerPixel", "fullscreen" ],
|
|
"properties" : {
|
|
"screenRes" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"required" : [ "width", "height" ],
|
|
"properties" : {
|
|
"width" : { "type" : "number" },
|
|
"height" : { "type" : "number" }
|
|
},
|
|
"default": {"width" : 800, "height": 600 }
|
|
},
|
|
"bitsPerPixel" : {
|
|
"type" : "number",
|
|
"default" : 24
|
|
},
|
|
"fullscreen" : {
|
|
"type" : "boolean",
|
|
"default" : false
|
|
}
|
|
}
|
|
},
|
|
"adventure" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default": {},
|
|
"required" : [ "heroSpeed", "enemySpeed", "scrollSpeed", "heroReminder" ],
|
|
"properties" : {
|
|
"heroSpeed" : {
|
|
"type" : "number",
|
|
"default" : 2
|
|
},
|
|
"enemySpeed" : {
|
|
"type" : "number",
|
|
"default" : 2
|
|
},
|
|
"scrollSpeed" : {
|
|
"type" : "number",
|
|
"default" : 1
|
|
},
|
|
"heroReminder" : {
|
|
"type" : "boolean",
|
|
"default" : true
|
|
}
|
|
}
|
|
},
|
|
"battle" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default": {},
|
|
"required" : [ "animationSpeed", "mouseShadow", "cellBorders", "stackRange", "showQueue" ],
|
|
"properties" : {
|
|
"animationSpeed" : {
|
|
"type" : "number",
|
|
"default" : 2
|
|
},
|
|
"mouseShadow" : {
|
|
"type":"boolean",
|
|
"default" : true
|
|
},
|
|
"cellBorders" : {
|
|
"type" : "boolean",
|
|
"default" : false
|
|
},
|
|
"stackRange" : {
|
|
"type" : "boolean",
|
|
"default" : true
|
|
},
|
|
"showQueue" : {
|
|
"type" : "boolean",
|
|
"default" : true
|
|
}
|
|
}
|
|
},
|
|
"server" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default": {},
|
|
"required" : [ "server", "port", "localInformation", "playerAI", "neutralAI" ],
|
|
"properties" : {
|
|
"server" : {
|
|
"type":"string",
|
|
"default" : "127.0.0.1"
|
|
},
|
|
"port" : {
|
|
"type" : "number",
|
|
"default" : 3030
|
|
},
|
|
"localInformation" : {
|
|
"type" : "number",
|
|
"default" : 2
|
|
},
|
|
"playerAI" : {
|
|
"type" : "string",
|
|
"default" : "VCAI"
|
|
},
|
|
"neutralAI" : {
|
|
"type" : "string",
|
|
"default" : "StupidAI"
|
|
}
|
|
}
|
|
},
|
|
"logging" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default" : {},
|
|
"required" : [ "console", "file", "loggers" ],
|
|
"properties" : {
|
|
"console" : {
|
|
"type" : "object",
|
|
"default" : {},
|
|
"required" : [ "format", "threshold", "coloredOutputEnabled", "colorMapping" ],
|
|
"properties" : {
|
|
"format" : {
|
|
"type" : "string",
|
|
"default" : "%m"
|
|
},
|
|
"threshold" : {
|
|
"$ref" : "#/definitions/logLevelEnum",
|
|
"default" : "info",
|
|
},
|
|
"coloredOutputEnabled" : {
|
|
"type" : "boolean",
|
|
"default" : true
|
|
},
|
|
"colorMapping" : {
|
|
"type" : "array",
|
|
"default" : [
|
|
{ "domain" : "global", "level" : "trace", "color" : "gray"},
|
|
{ "domain" : "global", "level" : "debug", "color" : "white"},
|
|
{ "domain" : "global", "level" : "info", "color" : "green"},
|
|
{ "domain" : "global", "level" : "warn", "color" : "yellow"},
|
|
{ "domain" : "global", "level" : "error", "color" : "red"}
|
|
],
|
|
"items" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default" : {},
|
|
"required" : [ "domain", "level", "color" ],
|
|
"properties" : {
|
|
"domain" : { "type" : "string" },
|
|
"level" : { "$ref" : "#/definitions/logLevelEnum" },
|
|
"color" : { "type" : "string", "enum" : [ "default", "green", "red", "magenta", "yellow", "white", "gray", "teal" ] }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"file" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"default" : {},
|
|
"required" : [ "format" ],
|
|
"properties" : {
|
|
"format" : {
|
|
"type" : "string",
|
|
"default" : "%d %l %n [%t] - %m"
|
|
}
|
|
}
|
|
},
|
|
"loggers" : {
|
|
"type" : "array",
|
|
"default" : [ { "domain" : "global", "level" : "trace" } ],
|
|
"items" : {
|
|
"type" : "object",
|
|
"additionalProperties" : false,
|
|
"required" : [ "level", "domain" ],
|
|
"properties" : {
|
|
"domain" : { "type" : "string" },
|
|
"level" : { "$ref" : "#/definitions/logLevelEnum" }
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|