From 180774793e5b319407dca6df566eecfdd5c6e1ee Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Mon, 9 Sep 2024 01:15:02 +0300 Subject: [PATCH] update settings --- mods/settings-v3.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mods/settings-v3.md b/mods/settings-v3.md index 399ce34..fd47dc3 100644 --- a/mods/settings-v3.md +++ b/mods/settings-v3.md @@ -94,6 +94,8 @@ All setting types, including custom ones if they opt-in, share a common set of b | `enable-if` | [`enable-if` Scheme](#enable-if) | A way to disable settings based on other settings; see [Enable If Schemes](#enable-if) for more | | `enable-if-description` | String | Human-readable description for what the `enable-if` scheme does. If not provided, Geode will try to synthesize a legible one from the `enable-if` scheme itself. However, specifying a custom description is heavily recommended if you use saved values, or have more complex schemes | +--- + ### Title (`title`) ![An image showcasing a basic title setting](/assets/settings/title.png) @@ -110,6 +112,8 @@ Title settings are cosmetic settings that can be used to group other settings. } ``` +--- + ### Boolean (`bool`) ![An image showcasing a basic boolean setting](/assets/settings/bool.png) @@ -129,6 +133,8 @@ Boolean settings are a simple toggle for whether the setting is enabled or not. auto value = Mod::get()->template getSettingValue("bool-setting-example"); ``` +--- + ### Integer (`int`) ![An image showcasing a basic integer setting](/assets/settings/int.png) @@ -171,11 +177,13 @@ Integer settings are a whole number. By default, they have a slider, arrows to i auto value = Mod::get()->template getSettingValue("int-setting-example"); ``` +--- + ### Float (`float`) ![An image showcasing a basic float setting](/assets/settings/float.png) -Float settings are just like int settings, but for floats!. +Float settings are just like int settings, but for floats! ```json "float-setting-example": { @@ -207,9 +215,12 @@ Float settings are just like int settings, but for floats!. } ``` +--- + ### String (`string`) ![An image showcasing a basic string setting](/assets/settings/string.png) +![An image showcasing a basic enum string setting via the `one-of` property](/assets/settings/string-one-of.png) String settings are simple strings that can be controlled by character limits or a regex pattern. These can also be used to create **enum settings** via the `one-of` key. @@ -233,6 +244,8 @@ String settings are simple strings that can be controlled by character limits or auto value = Mod::get()->template getSettingValue("string-setting-example"); ``` +--- + ### File (`file`) ![An image showcasing a basic file setting](/assets/settings/file.png) @@ -280,6 +293,8 @@ The default value for file settings support a set of known path prefixes to allo auto value = Mod::get()->template getSettingValue("file-setting-example"); ``` +--- + ### Folder (`folder`) ![An image showcasing a basic folder setting](/assets/settings/folder.png) @@ -302,6 +317,8 @@ The default value for folder settings support the same set of known path setting auto value = Mod::get()->template getSettingValue("folder-setting-example"); ``` +--- + ### Color (`color` / `rgb` / `rgba`) ![An image showcasing a basic RGB setting](/assets/settings/rgb.png) @@ -327,6 +344,8 @@ auto rgb = Mod::get()->template getSettingValue("rgb-settin auto rgba = Mod::get()->template getSettingValue("rgba-setting-example"); ``` +--- + ## Custom Settings Mods can also specify custom setting types. Unlike the old system, where custom settings where defined per-setting, under the new system you can reuse the same custom setting type for multiple settings.