From 77f31cd37baca25396e242a405db05540b4e1f26 Mon Sep 17 00:00:00 2001 From: mat <26722564+matcool@users.noreply.github.com> Date: Sun, 21 Apr 2024 12:28:28 -0300 Subject: [PATCH] fix setting keys, add example for `default` remove unimplemented `one-of` key, rename `regex` to `match` --- mods/settings.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/mods/settings.md b/mods/settings.md index b8a9e69..b53ff19 100644 --- a/mods/settings.md +++ b/mods/settings.md @@ -58,25 +58,49 @@ $execute { ## Supported setting types +*Tip: If you have our VSCode extension, you will get validation for these setting types* + +Most of these can have a `default` key to set a default value. +```json +"my-setting": { + "type": "string", + "default": "John" +} +``` + +It can also be an object, for specifying the default value per platform: +```json +"my-setting": { + "type": "string", + "default": { + "win": "Bill", + "mac": "Steve", + "android": "John" + } +} +``` + +--- + ### `bool` A simple boolean toggle. ### `int` -A 64-bit integer value. Value may be limited with the `min`, `max`, and `one-of` properties. Available controls include a slider, arrows (buttons that increment/decrement by a predetermined amount), and a text input. +A 64-bit integer value. Value may be limited with the `min` and `max` properties. Available controls include a slider, arrows (buttons that increment/decrement by a predetermined amount), and a text input. In code, the value type is `int64_t`. ### `float` -A 64-bit floating point (decimal) value. Value may be limited with the `min`, `max`, and `one-of` properties. Available controls include a slider, arrows (buttons that increment/decrement by a predetermined amount), and a text input. +A 64-bit floating point (decimal) value. Value may be limited with the `min` and `max` properties. Available controls include a slider, arrows (buttons that increment/decrement by a predetermined amount), and a text input. In code, the value type is `double`. ### `string` -A piece of text. Value may be constrained with the `regex` key that specifies a regex that the string is matched against. +A piece of text. Value may be constrained with the `match` key that specifies a regex that the string is matched against. In code, the value type is `std::string`.