Create libhooktick.js

This commit is contained in:
MollTheCoder 2023-01-16 17:02:21 -05:00 committed by GitHub
parent 7da79ef8e7
commit ca0f110a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

11
mods/libhooktick.js Normal file
View File

@ -0,0 +1,11 @@
const oldTick = tick;
let __registeredTickCallbacks = [];
function everyTick(callback){
__registeredTickCallbacks.push(callback);
}
tick = function(){
oldTick();
__registeredTickCallbacks.forEach(func=>{
func();
});
}