You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/09-migration/09-02-0.5.0-to-0.6.0.md
+24
Original file line number
Diff line number
Diff line change
@@ -30,3 +30,27 @@ video.play(videoPath);
30
30
// You can also run video.load() in advance before playing the video.
31
31
if (video.load(videoPath)) video.play();
32
32
```
33
+
34
+
# Options Menu Changes
35
+
36
+
The options menu received a minor refactor internally. The `pages` list was moved to its own class, which changes the code needed to access the "Preferences" menu (mainly done to add custom preferences).
37
+
38
+
We would like to standardize the process of adding custom user preferences to mods in the future eventually, but in the meantime you can make the necessary tweaks:
39
+
40
+
```haxe
41
+
// BEFORE: Retrieve the value from the page Map.
42
+
if (Std.isOfType(currentState, OptionsState)) {
43
+
var preferencesPage = currentState.pages.get("preferences");
44
+
45
+
// Create a new option.
46
+
prefs.createPrefItemCheckbox(...);
47
+
}
48
+
49
+
// AFTER: Retrieve the value from the page Map, which is now inside a Codex.
50
+
if (Std.isOfType(currentState, OptionsState)) {
51
+
var preferencesPage = currentState.optionsCodex.pages.get("preferences");
0 commit comments