Skip to content

Commit

Permalink
update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Sep 8, 2024
1 parent cc2407a commit 1807747
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion mods/settings-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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>("bool-setting-example");
```

---

### Integer (`int`)

![An image showcasing a basic integer setting](/assets/settings/int.png)
Expand Down Expand Up @@ -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<int64_t>("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": {
Expand Down Expand Up @@ -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.

Expand All @@ -233,6 +244,8 @@ String settings are simple strings that can be controlled by character limits or
auto value = Mod::get()->template getSettingValue<std::string>("string-setting-example");
```

---

### File (`file`)

![An image showcasing a basic file setting](/assets/settings/file.png)
Expand Down Expand Up @@ -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<std::filesystem::path>("file-setting-example");
```

---

### Folder (`folder`)

![An image showcasing a basic folder setting](/assets/settings/folder.png)
Expand All @@ -302,6 +317,8 @@ The default value for folder settings support the same set of known path setting
auto value = Mod::get()->template getSettingValue<std::filesystem::path>("folder-setting-example");
```

---

### Color (`color` / `rgb` / `rgba`)

![An image showcasing a basic RGB setting](/assets/settings/rgb.png)
Expand All @@ -327,6 +344,8 @@ auto rgb = Mod::get()->template getSettingValue<cocos2d::ccColor3B>("rgb-settin
auto rgba = Mod::get()->template getSettingValue<cocos2d::ccColor4B>("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.
Expand Down

0 comments on commit 1807747

Please sign in to comment.