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: docs/src/ScriptingReference/core-callbacks.md
+23-1Lines changed: 23 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
On top of callbacks which are registered by your application, BMS provides a set of core callbacks which are always available.
4
4
5
-
The two core callbacks are:
5
+
The three core callbacks are:
6
6
-`on_script_loaded`
7
7
-`on_script_unloaded`
8
+
-`on_script_reloaded`
8
9
9
10
## `on_script_loaded`
10
11
@@ -30,3 +31,24 @@ function on_script_unloaded()
30
31
print("Goodbye world")
31
32
end
32
33
```
34
+
35
+
## `on_script_reloaded`
36
+
37
+
This will be called twice: right before and after a script is reloaded.
38
+
39
+
The first parameter `save` informs you whether it is time to save a value or restore it.
40
+
41
+
Before the reload, it is called with one argument: `true`. After the script is reloaded, it is called with two parameters: the first is `false` and the second is value returned from before.
0 commit comments