isaacscript 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
|
+
import { log } from "isaacscript-common";
|
|
2
3
|
|
|
3
4
|
const MOD_NAME = "MOD-NAME-TO-REPLACE";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
main();
|
|
7
|
+
|
|
8
|
+
function main(): void {
|
|
6
9
|
// Instantiate a new mod object, which grants the ability to add callback functions that
|
|
7
10
|
// correspond to in-game events.
|
|
8
11
|
const mod = RegisterMod(MOD_NAME, 1);
|
|
9
12
|
|
|
10
|
-
//
|
|
13
|
+
// Register a callback function that corresponds to when a new run is started.
|
|
11
14
|
mod.AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted);
|
|
12
15
|
|
|
13
|
-
// Print an
|
|
14
|
-
|
|
16
|
+
// Print an message to the "log.txt" file.
|
|
17
|
+
log(`${MOD_NAME} initialized.`);
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
function postGameStarted() {
|
|
18
|
-
|
|
21
|
+
log("Callback triggered: POST_GAME_STARTED");
|
|
19
22
|
}
|