Last active
February 16, 2025 00:28
-
-
Save Reycko/5062bd47bc204d1d4d99db1a22518d26 to your computer and use it in GitHub Desktop.
Psych Engine settings.json schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "Settings array", | |
"description": "The root of the JSON file. This contains all of the settings.", | |
"type": "array", | |
"uniqueItems": true, | |
"items": { | |
"type": "object", | |
"required": ["save", "name", "type"], | |
"properties": { | |
"save": { | |
"description": "This is the internal name of the setting that will be in the save data and LUA.", | |
"type": "string" | |
}, | |
"name": { | |
"description": "The 'pretty name' of the setting. This is what will be shown to players.", | |
"type": "string" | |
}, | |
"type": { | |
"description": "The type of the setting.", | |
"oneOf": [ | |
{ | |
"type": "string", | |
"enum": ["bool"], | |
"description": "Type: A boolean value. Can be either `true` or `false`." | |
}, | |
{ | |
"type": "string", | |
"enum": ["int"], | |
"description": "Type: Any whole number. If your number needs to be a decimal number, consider `float`s or `percent`s for percentages." | |
}, | |
{ | |
"type": "string", | |
"enum": ["float"], | |
"description": "Type: Any number. Can have decimals, unlike `int`s." | |
}, | |
{ | |
"type": "string", | |
"enum": ["percent"], | |
"description": "Type: Functionally the same as `float`s, but are formatted as a percentage to a user." | |
}, | |
{ | |
"type": "string", | |
"enum": ["string"], | |
"description": "Type: Lets the user choose any value from the `options` array." | |
}, | |
{ | |
"type": "string", | |
"enum": ["keybind"], | |
"description": "Type: A custom keybind. Not yet implemented as of Psych Engine v1.0.1." | |
} | |
] | |
}, | |
"description": { | |
"type": "string", | |
"description": "The option's description, which will show at the bottom center of the screen when it is hovered." | |
}, | |
"format": { | |
"type": "string", | |
"description": "Formatting for the option. `%v` is the current value, and `%d` is the default." | |
} | |
}, | |
"allOf": [ | |
{ | |
"if": { | |
"required": ["type"], | |
"properties": { | |
"type": { | |
"type": "string", | |
"const": "string" | |
} | |
} | |
}, | |
"then": { | |
"required": ["options"], | |
"properties": { | |
"value": { | |
"type": "string", | |
"description": "The default value of the option." | |
}, | |
"options": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"description": "A list of string values the user will be able to cycle through." | |
} | |
} | |
} | |
}, | |
{ | |
"if": { | |
"required": ["type"], | |
"properties": { | |
"type": { | |
"type": "string", | |
"const": "bool" | |
} | |
} | |
}, | |
"then": { | |
"required": ["value"], | |
"properties": { | |
"value": { | |
"type": "boolean", | |
"description": "The default boolean value of the option." | |
} | |
} | |
} | |
}, | |
{ | |
"if": { | |
"required": ["type"], | |
"properties": { | |
"type": { | |
"type": "string", | |
"const": "int" | |
} | |
} | |
}, | |
"then": { | |
"required": ["value", "min", "max"], | |
"properties": { | |
"value": { | |
"type": "integer", | |
"description": "The default value of the option. If you need decimals, use a `float` or `percent`." | |
}, | |
"min": { | |
"type": "integer", | |
"description": "The minimum value of the option. If you need decimals, use a `float` or `percent`." | |
}, | |
"max": { | |
"type": "integer", | |
"description": "The maximum value of the option. If you need decimals, use a `float` or `percent`." | |
}, | |
"step": { | |
"type": "integer", | |
"description": "By how much to change the value when the user modifies it. If you need decimals, use a `float` or `percent`." | |
} | |
} | |
} | |
}, | |
{ | |
"if": { | |
"required": ["type"], | |
"properties": { | |
"type": { | |
"type": "string", | |
"enum": ["float", "percent"] | |
} | |
} | |
}, | |
"then": { | |
"required": ["value", "min", "max"], | |
"properties": { | |
"value": { | |
"type": "number", | |
"description": "The default value of the option. Allows decimals." | |
}, | |
"min": { | |
"type": "number", | |
"description": "The minimum value of the option. Allows decimals." | |
}, | |
"max": { | |
"type": "number", | |
"description": "The maximum value of the option. Allows decimals." | |
}, | |
"step": { | |
"type": "number", | |
"description": "By how much to change the value when the user modifies it. Allows decimals." | |
}, | |
"decimals": { | |
"type": "integer", | |
"description": "The amount decimals the option should have." | |
}, | |
"scroll": { | |
"type": "number", | |
"description": "The speed to scroll when holding the left or right eyes. Measures in changes per second (changes/s). Allows decimals." | |
} | |
} | |
} | |
}, | |
{ | |
"if": { | |
"required": ["type"], | |
"properties": { | |
"type": { | |
"type": "string", | |
"const": "keybind" | |
} | |
} | |
}, | |
"then": { | |
"required": ["keyboard", "gamepad"], | |
"properties": { | |
"keyboard": { | |
"type": "string", | |
"enum": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" | |
,"ALT", "BACKSLASH", "BACKSPACE", "BREAK", "CAPSLOCK", "COMMA", "CONTROL", "DELETE", "ENTER", "ESCAPE", "GRAVEACCENT", "HOME", "INSERT", "LBRACKET", "MENU", "MINUS", "NUMLOCK", "PAGEDOWN", "PAGEUP", "PERIOD", "PLUS", "PRINTSCREEN", "QUOTE", "RBRACKET" | |
,"SCROLL_LOCK", "SEMICOLON", "SHIFT", "SLASH", "SPACE", "TAB", "WINDOWS" | |
,"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12" | |
,"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE" | |
,"NUMPADZERO", "NUMPADONE", "NUMPADTWO", "NUMPADTHREE", "NUMPADFOUR", "NUMPADFIVE", "NUMPADSIX", "NUMPADSEVEN", "NUMPADEIGHT", "NUMPADNINE", "NUMPADMINUS", "NUMPADMULTIPLY", "NUMPADPERIOD", "NUMPADPLUS", "NUMPADSLASH" | |
,"LEFT", "DOWN", "UP", "RIGHT"], | |
"description": "The string default keybind of the option.\nFull list of possible values: https://api.haxeflixel.com/flixel/input/keyboard/FlxKeyList.html" | |
}, | |
"gamepad": { | |
"type": "string", | |
"enum": ["A", "B" | |
,"BACK", "START" | |
,"DPAD_DOWN", "DPAD_LEFT", "DPAD_RIGHT", "DPAD_UP" | |
,"EXTRA_0", "EXTRA_1", "EXTRA_2", "EXTRA_3", "EXTRA_4" | |
,"LEFT_SHOULDER", "LEFT_TRIGGER", "LEFT_TRIGGER_BUTTON", "RIGHT_SHOULDER", "RIGHT_TRIGGER", "RIGHT_TRIGGER_BUTTON" | |
,"LEFT_STICK_CLICK", "LEFT_STICK_DIGITAL_LEFT", "LEFT_STICK_DIGITAL_DOWN", "LEFT_STICK_DIGITAL_UP", "LEFT_STICK_DIGITAL_RIGHT" | |
,"RIGHT_STICK_CLICK", "RIGHT_STICK_DIGITAL_LEFT", "RIGHT_STICK_DIGITAL_DOWN", "RIGHT_STICK_DIGITAL_UP", "RIGHT_STICK_DIGITAL_RIGHT"], | |
"description": "The string default gamepad bind of the option. Mirrors the Xbox 360 layout." | |
} | |
} | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment