settings.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. // This is schema for checking game settings from settings.json
  2. // Any new settings should be added in this file for correct serialization and initialization
  3. {
  4. "type" : "object",
  5. "$schema" : "http://json-schema.org/draft-04/schema",
  6. "required" : [ "general", "video", "adventure", "battle", "input", "server", "logging", "launcher", "lobby", "gameTweaks" ],
  7. "definitions" : {
  8. "logLevelEnum" : {
  9. "type" : "string",
  10. "enum" : [ "trace", "debug", "info", "warn", "error" ]
  11. }
  12. },
  13. "additionalProperties" : false,
  14. "properties" :
  15. {
  16. "general" : {
  17. "type" : "object",
  18. "default" : {},
  19. "additionalProperties" : false,
  20. "required" : [
  21. "playerName",
  22. "music",
  23. "sound",
  24. "saveRandomMaps",
  25. "lastMap",
  26. "language",
  27. "gameDataLanguage",
  28. "lastSave",
  29. "lastSettingsTab",
  30. "lastCampaign",
  31. "lastDifficulty",
  32. "saveFrequency",
  33. "notifications",
  34. "extraDump",
  35. "userRelativePointer",
  36. "relativePointerSpeedMultiplier",
  37. "hapticFeedback",
  38. "longTouchTimeMilliseconds",
  39. "autosaveCountLimit",
  40. "useSavePrefix",
  41. "savePrefix",
  42. "startTurnAutosave",
  43. "enableUiEnhancements",
  44. "audioMuteFocus"
  45. ],
  46. "properties" : {
  47. "playerName" : {
  48. "type" : "string",
  49. "default" : "Player"
  50. },
  51. "music" : {
  52. "type" : "number",
  53. "default" : 88
  54. },
  55. "sound" : {
  56. "type" : "number",
  57. "default" : 88
  58. },
  59. "saveRandomMaps" : {
  60. "type" : "boolean",
  61. "default" : false
  62. },
  63. "lastMap" : {
  64. "type" : "string",
  65. "default" : "Maps/Arrogance"
  66. },
  67. "language" : {
  68. "type" : "string",
  69. "enum" : [ "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ],
  70. "default" : "english"
  71. },
  72. "gameDataLanguage" : {
  73. "type" : "string",
  74. "enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ],
  75. "default" : "auto"
  76. },
  77. "lastSave" : {
  78. "type" : "string",
  79. "default" : "NEWGAME"
  80. },
  81. "lastSettingsTab" : {
  82. "type" : "number",
  83. "default" : 0
  84. },
  85. "lastCampaign" : {
  86. "type" : "string",
  87. "default" : ""
  88. },
  89. "lastDifficulty" : {
  90. "type" : "number",
  91. "default" : 1
  92. },
  93. "saveFrequency" : {
  94. "type" : "number",
  95. "default" : 1
  96. },
  97. "notifications" : {
  98. "type" : "boolean",
  99. "default" : false
  100. },
  101. "extraDump" : {
  102. "type" : "boolean",
  103. "default" : false
  104. },
  105. "userRelativePointer" : {
  106. "type" : "boolean",
  107. "default" : false
  108. },
  109. "relativePointerSpeedMultiplier" : {
  110. "type" : "number",
  111. "default" : 1
  112. },
  113. "longTouchTimeMilliseconds" : {
  114. "type" : "number",
  115. "default" : 1000
  116. },
  117. "hapticFeedback" : {
  118. "type" : "boolean",
  119. "default" : true
  120. },
  121. "autosaveCountLimit" : {
  122. "type" : "number",
  123. "default": 5
  124. },
  125. "useSavePrefix" : {
  126. "type": "boolean",
  127. "default": true
  128. },
  129. "savePrefix" : {
  130. "type": "string",
  131. "default": ""
  132. },
  133. "startTurnAutosave" : {
  134. "type": "boolean",
  135. "default": false
  136. },
  137. "enableUiEnhancements" : {
  138. "type": "boolean",
  139. "default": true
  140. },
  141. "audioMuteFocus" : {
  142. "type": "boolean",
  143. "default": false
  144. }
  145. }
  146. },
  147. "video" : {
  148. "type" : "object",
  149. "additionalProperties" : false,
  150. "default" : {},
  151. "required" : [
  152. "resolution",
  153. "reservedWidth",
  154. "fullscreen",
  155. "realFullscreen",
  156. "cursor",
  157. "showIntro",
  158. "spellbookAnimation",
  159. "driver",
  160. "displayIndex",
  161. "showfps",
  162. "targetfps",
  163. "vsync",
  164. "scalingMode"
  165. ],
  166. "properties" : {
  167. "resolution" : {
  168. "type" : "object",
  169. "additionalProperties" : false,
  170. "required" : [ "width", "height", "scaling" ],
  171. "properties" : {
  172. "width" : { "type" : "number" },
  173. "height" : { "type" : "number" },
  174. "scaling" : { "type" : "number" }
  175. },
  176. "defaultIOS" : {"width" : 800, "height" : 600, "scaling" : 200 },
  177. "defaultAndroid" : {"width" : 800, "height" : 600, "scaling" : 200 },
  178. "default" : {"width" : 800, "height" : 600, "scaling" : 100 }
  179. },
  180. "reservedWidth" : {
  181. "type" : "number",
  182. "defaultIOS" : 0.1, // iOS camera cutout / notch is excluded from available area by SDL
  183. "default" : 0
  184. },
  185. "fullscreen" : {
  186. "type" : "boolean",
  187. "default" : false
  188. },
  189. "realFullscreen" : {
  190. "type" : "boolean",
  191. "default" : false
  192. },
  193. "cursor" : {
  194. "type" : "string",
  195. "enum" : [ "hardware", "software" ],
  196. "default" : "hardware"
  197. },
  198. "showIntro" : {
  199. "type" : "boolean",
  200. "default" : true
  201. },
  202. "spellbookAnimation" : {
  203. "type" : "boolean",
  204. "default" : true
  205. },
  206. "driver" : {
  207. "type" : "string",
  208. "defaultWindows" : "",
  209. "default" : "opengl",
  210. "description" : "preferred graphics backend driver name for SDL2"
  211. },
  212. "displayIndex" : {
  213. "type" : "number",
  214. "default" : 0
  215. },
  216. "showfps" : {
  217. "type" : "boolean",
  218. "default" : false
  219. },
  220. "targetfps" : {
  221. "type" : "number",
  222. "default" : 60
  223. },
  224. "vsync" : {
  225. "type" : "boolean",
  226. "default" : true
  227. },
  228. "scalingMode" : {
  229. "type" : "string",
  230. "enum" : [ "nearest", "linear", "best" ],
  231. "default" : "best"
  232. }
  233. }
  234. },
  235. "input" : {
  236. "type" : "object",
  237. "additionalProperties" : false,
  238. "default" : {},
  239. "required" : [
  240. "radialWheelGarrisonSwipe",
  241. "touchToleranceDistance",
  242. "mouseToleranceDistance",
  243. "shortcutToleranceDistance",
  244. "enableMouse",
  245. "enableTouch",
  246. "enableController",
  247. "controllerTriggerTreshold",
  248. "controllerAxisDeadZone",
  249. "controllerAxisFullZone",
  250. "controllerAxisSpeed",
  251. "controllerAxisScale"
  252. ],
  253. "properties" : {
  254. "radialWheelGarrisonSwipe" : {
  255. "type" : "boolean",
  256. "default" : true
  257. },
  258. "touchToleranceDistance" : {
  259. "type" : "number",
  260. "default" : 20
  261. },
  262. "mouseToleranceDistance" : {
  263. "type" : "number",
  264. "default" : 0
  265. },
  266. "shortcutToleranceDistance" : {
  267. "type" : "number",
  268. "default" : 0
  269. },
  270. "enableMouse" : {
  271. "type" : "boolean",
  272. "default" : true
  273. },
  274. "enableTouch" : {
  275. "type" : "boolean",
  276. "default" : true
  277. },
  278. "enableController" : {
  279. "type" : "boolean",
  280. "default" : true
  281. },
  282. "controllerTriggerTreshold" : {
  283. "type" : "number",
  284. "default" : 0.3
  285. },
  286. "controllerAxisDeadZone" : {
  287. "type" : "number",
  288. "default" : 0.2
  289. },
  290. "controllerAxisFullZone" : {
  291. "type" : "number",
  292. "default" : 1.0
  293. },
  294. "controllerAxisSpeed" : {
  295. "type" : "number",
  296. "default" : 1000
  297. },
  298. "controllerAxisScale" : {
  299. "type" : "number",
  300. "default" : 2
  301. }
  302. }
  303. },
  304. "adventure" : {
  305. "type" : "object",
  306. "additionalProperties" : false,
  307. "default" : {},
  308. "required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging", "backgroundDimLevel", "hideBackground", "backgroundDimSmallWindows" ],
  309. "properties" : {
  310. "heroMoveTime" : {
  311. "type" : "number",
  312. "default" : 150
  313. },
  314. "enemyMoveTime" : {
  315. "type" : "number",
  316. "default" : 150
  317. },
  318. "scrollSpeedPixels" : {
  319. "type" : "number",
  320. "default" : 800
  321. },
  322. "heroReminder" : {
  323. "type" : "boolean",
  324. "default" : true
  325. },
  326. "quickCombat" : {
  327. "type" : "boolean",
  328. "default" : false
  329. },
  330. "objectAnimation" : {
  331. "type" : "boolean",
  332. "default" : true
  333. },
  334. "terrainAnimation" : {
  335. "type" : "boolean",
  336. "default" : true
  337. },
  338. "forceQuickCombat" : {
  339. "type" : "boolean",
  340. "default" : false
  341. },
  342. "borderScroll" :
  343. {
  344. "type" : "boolean",
  345. "defaultIOS" : false,
  346. "defaultAndroid" : false,
  347. "default" : true
  348. },
  349. "leftButtonDrag" : {
  350. "type" : "boolean",
  351. "default" : false
  352. },
  353. "smoothDragging" : {
  354. "type" : "boolean",
  355. "default" : true
  356. },
  357. "backgroundDimLevel" : {
  358. "type" : "number",
  359. "default" : 128
  360. },
  361. "hideBackground" : {
  362. "type" : "boolean",
  363. "default" : false
  364. },
  365. "backgroundDimSmallWindows" : {
  366. "type" : "boolean",
  367. "default" : false
  368. }
  369. }
  370. },
  371. "battle" : {
  372. "type" : "object",
  373. "additionalProperties" : false,
  374. "default" : {},
  375. "required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "rangeLimitHighlightOnHover", "showQueue", "swipeAttackDistance", "queueSize", "stickyHeroInfoWindows", "enableAutocombatSpells", "endWithAutocombat", "queueSmallSlots", "queueSmallOutside" ],
  376. "properties" : {
  377. "speedFactor" : {
  378. "type" : "number",
  379. "default" : 2
  380. },
  381. "mouseShadow" : {
  382. "type" : "boolean",
  383. "default" : true
  384. },
  385. "cellBorders" : {
  386. "type" : "boolean",
  387. "default" : false
  388. },
  389. "stackRange" : {
  390. "type" : "boolean",
  391. "default" : true
  392. },
  393. "movementHighlightOnHover" : {
  394. "type" : "boolean",
  395. "default" : true
  396. },
  397. "rangeLimitHighlightOnHover" : {
  398. "type" : "boolean",
  399. "default" : false
  400. },
  401. "showQueue" : {
  402. "type" : "boolean",
  403. "default" : true
  404. },
  405. "swipeAttackDistance" : {
  406. "type" : "number",
  407. "default" : 250
  408. },
  409. "queueSize" : {
  410. "type" : "string",
  411. "default" : "auto",
  412. "enum" : [ "auto", "small", "big" ]
  413. },
  414. "stickyHeroInfoWindows" : {
  415. "type" : "boolean",
  416. "default" : true
  417. },
  418. "enableAutocombatSpells" : {
  419. "type": "boolean",
  420. "default": true
  421. },
  422. "endWithAutocombat" : {
  423. "type": "boolean",
  424. "default": false
  425. },
  426. "queueSmallSlots" : {
  427. "type": "number",
  428. "default": 10
  429. },
  430. "queueSmallOutside" : {
  431. "type": "boolean",
  432. "default": false
  433. }
  434. }
  435. },
  436. "server" : {
  437. "type" : "object",
  438. "additionalProperties" : false,
  439. "default" : {},
  440. "required" : [ "localHostname", "localPort", "remoteHostname", "remotePort", "playerAI", "alliedAI", "friendlyAI", "neutralAI", "enemyAI" ],
  441. "properties" : {
  442. "localHostname" : {
  443. "type" : "string",
  444. "default" : "127.0.0.1"
  445. },
  446. "localPort" : {
  447. "type" : "number",
  448. "default" : 3030
  449. },
  450. "remoteHostname" : {
  451. "type" : "string",
  452. "default" : ""
  453. },
  454. "remotePort" : {
  455. "type" : "number",
  456. "default" : 3030
  457. },
  458. "playerAI" : {
  459. "type" : "string",
  460. "default" : "Nullkiller"
  461. },
  462. "alliedAI" : {
  463. "type" : "string",
  464. "default" : "Nullkiller"
  465. },
  466. "friendlyAI" : {
  467. "type" : "string",
  468. "default" : "BattleAI"
  469. },
  470. "neutralAI" : {
  471. "type" : "string",
  472. "default" : "StupidAI"
  473. },
  474. "enemyAI" : {
  475. "type" : "string",
  476. "default" : "BattleAI"
  477. }
  478. }
  479. },
  480. "logging" : {
  481. "type" : "object",
  482. "additionalProperties" : false,
  483. "default" : {},
  484. "required" : [ "console", "file", "loggers" ],
  485. "properties" : {
  486. "console" : {
  487. "type" : "object",
  488. "default" : {},
  489. "required" : [ "format", "threshold", "coloredOutputEnabled", "colorMapping" ],
  490. "properties" : {
  491. "format" : {
  492. "type" : "string",
  493. "default" : "%m"
  494. },
  495. "threshold" : {
  496. "$ref" : "#/definitions/logLevelEnum",
  497. "default" : "info"
  498. },
  499. "coloredOutputEnabled" : {
  500. "type" : "boolean",
  501. "default" : true
  502. },
  503. "colorMapping" : {
  504. "type" : "array",
  505. "default" : [
  506. { "domain" : "global", "level" : "trace", "color" : "gray"},
  507. { "domain" : "global", "level" : "debug", "color" : "white"},
  508. { "domain" : "global", "level" : "info", "color" : "green"},
  509. { "domain" : "global", "level" : "warn", "color" : "yellow"},
  510. { "domain" : "global", "level" : "error", "color" : "red"}
  511. ],
  512. "items" : {
  513. "type" : "object",
  514. "additionalProperties" : false,
  515. "default" : {},
  516. "required" : [ "domain", "level", "color" ],
  517. "properties" : {
  518. "domain" : { "type" : "string" },
  519. "level" : { "$ref" : "#/definitions/logLevelEnum" },
  520. "color" : { "type" : "string", "enum" : [ "default", "green", "red", "magenta", "yellow", "white", "gray", "teal" ] }
  521. }
  522. }
  523. }
  524. }
  525. },
  526. "file" : {
  527. "type" : "object",
  528. "additionalProperties" : false,
  529. "default" : {},
  530. "required" : [ "format" ],
  531. "properties" : {
  532. "format" : {
  533. "type" : "string",
  534. "default" : "[%c] %l [%t] %n - %m"
  535. }
  536. }
  537. },
  538. "loggers" : {
  539. "type" : "array",
  540. "default" : [ { "domain" : "global", "level" : "trace" } ],
  541. "items" : {
  542. "type" : "object",
  543. "additionalProperties" : false,
  544. "required" : [ "level", "domain" ],
  545. "properties" : {
  546. "domain" : { "type" : "string" },
  547. "level" : { "$ref" : "#/definitions/logLevelEnum" }
  548. }
  549. }
  550. }
  551. }
  552. },
  553. "launcher" : {
  554. "type" : "object",
  555. "default" : {},
  556. "additionalProperties" : false,
  557. "required" : [
  558. "setupCompleted",
  559. "defaultRepositoryEnabled",
  560. "defaultRepositoryURL",
  561. "extraRepositoryURL",
  562. "extraRepositoryEnabled",
  563. "enableInstalledMods",
  564. "autoCheckRepositories",
  565. "ignoreSslErrors",
  566. "updateOnStartup",
  567. "updateConfigUrl"
  568. ],
  569. "properties" : {
  570. "defaultRepositoryEnabled" : {
  571. "type" : "boolean",
  572. "default" : true,
  573. },
  574. "defaultRepositoryURL" : {
  575. "type" : "string",
  576. "default" : "https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/vcmi-1.5.json",
  577. },
  578. "extraRepositoryEnabled" : {
  579. "type" : "boolean",
  580. "default" : false,
  581. },
  582. "extraRepositoryURL" : {
  583. "type" : "string",
  584. "default" : "",
  585. },
  586. "setupCompleted" : {
  587. "type" : "boolean",
  588. "default" : false
  589. },
  590. "enableInstalledMods" : {
  591. "type" : "boolean",
  592. "default" : true
  593. },
  594. "ignoreSslErrors" : {
  595. "type" : "boolean",
  596. "default" : false
  597. },
  598. "autoCheckRepositories" : {
  599. "type" : "boolean",
  600. "default" : true
  601. },
  602. "updateOnStartup" : {
  603. "type" : "boolean",
  604. "default" : true
  605. },
  606. "updateConfigUrl" : {
  607. "type" : "string",
  608. "default" : "https://raw.githubusercontent.com/vcmi/vcmi-updates/master/vcmi-updates.json"
  609. }
  610. }
  611. },
  612. "lobby" : {
  613. "type" : "object",
  614. "additionalProperties" : false,
  615. "default" : {},
  616. "required" : [ "mapPreview", "hostname", "port", "roomPlayerLimit", "roomType", "roomMode" ],
  617. "properties" : {
  618. "mapPreview" : {
  619. "type" : "boolean",
  620. "default" : true
  621. },
  622. "hostname" : {
  623. "type" : "string",
  624. "default" : "beholder.vcmi.eu"
  625. },
  626. "port" : {
  627. "type" : "number",
  628. "default" : 3031
  629. },
  630. "roomPlayerLimit" : {
  631. "type" : "number",
  632. "default" : 2
  633. },
  634. "roomType" : {
  635. "type" : "number",
  636. "default" : 0
  637. },
  638. "roomMode" : {
  639. "type" : "number",
  640. "default" : 0
  641. }
  642. }
  643. },
  644. "gameTweaks" : {
  645. "type" : "object",
  646. "default" : {},
  647. "additionalProperties" : false,
  648. "required" : [
  649. "showGrid",
  650. "forceMovementInfo",
  651. "numericCreaturesQuantities",
  652. "availableCreaturesAsDwellingLabel",
  653. "compactTownCreatureInfo",
  654. "infoBarPick",
  655. "skipBattleIntroMusic",
  656. "infoBarCreatureManagement",
  657. "enableLargeSpellbook",
  658. "skipAdventureMapAnimations"
  659. ],
  660. "properties" : {
  661. "showGrid" : {
  662. "type" : "boolean",
  663. "default" : false
  664. },
  665. "forceMovementInfo" : {
  666. "type" : "boolean",
  667. "default" : false
  668. },
  669. "numericCreaturesQuantities" : {
  670. "type" : "boolean",
  671. "default" : false
  672. },
  673. "availableCreaturesAsDwellingLabel" : {
  674. "type" : "boolean",
  675. "default" : false
  676. },
  677. "compactTownCreatureInfo" : {
  678. "type" : "boolean",
  679. "default" : false
  680. },
  681. "infoBarPick" : {
  682. "type" : "boolean",
  683. "default" : false
  684. },
  685. "skipBattleIntroMusic" : {
  686. "type" : "boolean",
  687. "default" : false
  688. },
  689. "infoBarCreatureManagement": {
  690. "type" : "boolean",
  691. "default" : true
  692. },
  693. "enableLargeSpellbook" : {
  694. "type": "boolean",
  695. "default": true
  696. },
  697. "skipAdventureMapAnimations": {
  698. "type": "boolean",
  699. "default": false
  700. }
  701. }
  702. }
  703. }
  704. }