-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgame.js
More file actions
28 lines (28 loc) · 849 Bytes
/
game.js
File metadata and controls
28 lines (28 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
onPage("Game", function () {
debug("Playing Game");
eventManager.emit("GameStart");
eventManager.emit("PlayingGame");
eventManager.on(':loaded', () => {
function callGameHooks(data, original) {
const run = !eventManager.emit('PreGameEvent', data, true).canceled;
try {
if (run) original(data);
} catch (e) {
console.error(e);
}
eventManager.emit('GameEvent', data);
}
if (undefined !== window.bypassQueueEvents) {
const oRunEvent = runEvent;
const oBypassEvent = bypassQueueEvent;
runEvent = function runEventScript(event) {
callGameHooks(event, oRunEvent);
};
bypassQueueEvent = function runEventScript(event) {
callGameHooks(event, oBypassEvent);
};
} else {
debug('Update your code yo');
}
});
});