feat: basic hooks test
This commit is contained in:
parent
8451ba6e3d
commit
249cfdf95f
1
lang/de.json
Normal file
1
lang/de.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
1
lang/en.json
Normal file
1
lang/en.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
1
lang/hr.json
Normal file
1
lang/hr.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
17
module.json
17
module.json
@ -14,6 +14,9 @@
|
||||
"minimum": 12,
|
||||
"verified": 12
|
||||
},
|
||||
"esmodules": [
|
||||
"src/timer.js"
|
||||
],
|
||||
"languages": [
|
||||
{
|
||||
"lang": "en",
|
||||
@ -21,17 +24,17 @@
|
||||
"path": "lang/en.json"
|
||||
},
|
||||
{
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/en.json"
|
||||
"lang": "de",
|
||||
"name": "Deutsch",
|
||||
"path": "lang/de.json"
|
||||
},
|
||||
{
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/en.json"
|
||||
"lang": "hr",
|
||||
"name": "Hrvatski",
|
||||
"path": "lang/hr.json"
|
||||
}
|
||||
],
|
||||
"url": "https://zlatko.dev/projects/vtt-timer",
|
||||
"manifest": "https://gitea.zlatko.dev/vtt/timer",
|
||||
"download": "missing-url"
|
||||
"download": "https://gitea.zlatko.dev/vtt/timer/archive/v0.1.0.zip"
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
"name": "@zladuric/timer",
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
21
src/timer.js
Normal file
21
src/timer.js
Normal file
@ -0,0 +1,21 @@
|
||||
console.log('We just booted!');
|
||||
|
||||
Hooks.on('init', function() {
|
||||
console.log('Timer module init');
|
||||
});
|
||||
|
||||
Hooks.on('ready', function() {
|
||||
console.log('Timer module ready');
|
||||
});
|
||||
|
||||
Hooks.on('error', function(location, error, payload) {
|
||||
console.error(`Timer module error at ${location}`, error, payload ?? 'no payload');
|
||||
});
|
||||
|
||||
Hooks.on('pauseGame', function(paused) {
|
||||
if (paused) {
|
||||
console.log('Game paused.');
|
||||
} else {
|
||||
console.log('Game unpaused');
|
||||
}
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user