Skip to content

Commit 9b34e63

Browse files
committed
Added support for NG+
1 parent 7e8bcc5 commit 9b34e63

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

timer/hooks.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
export class Hooks {
22

33
hookNewGameButton(callback) {
4+
if (ig.game && ig.game.start) {
5+
const original = ig.game.start;
6+
ig.game.start = (...args) => {
7+
callback(...args);
8+
return original.apply(ig.game, args);
9+
};
10+
}
11+
12+
413
const buttonNumber = ig.platform === 1 ? 3 : 2;
514
const buttons = simplify.getInnerGui(cc.ig.GUI.menues[15].children[2])[entries.buttons];
615
const newGameButton = buttons[buttonNumber];

timer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "timer",
33
"main": "mod.js",
44
"module": true,
5-
"version": "2.1.1",
5+
"version": "2.2.0",
66
"dependencies": {
77
"ccloader": "^2.7.7",
88
"Simplify": "^2.0.3"

0 commit comments

Comments
 (0)