-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.es
33 lines (28 loc) · 1.1 KB
/
index.es
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
29
30
31
32
33
import { Notifier } from './lib/notifier';
import { DBG_EXTRA_HANDLER_NAME } from './lib/constant';
import { ResourceNotifier } from 'views/services/resource-notifier'
let notifier = {};
export const
pluginDidLoad = (e) => {
dbg.extra(DBG_EXTRA_HANDLER_NAME);
notifier = new Notifier();
notifier.handleSountRequest = function (e) {
if (e.url.includes('/kcs/sound/')) {
try {
notifier.handleResponseDetails(e)
} catch (err) {
console.error(err)
}
}
};
notifier.initialize(() => {
const __ = notifier.__.bind(notifier)
window.addEventListener('game.response', notifier.handleGameResponse);
ResourceNotifier.addListener('request', notifier.handleSountRequest);
});
},
pluginWillUnload = (e) => {
ResourceNotifier.removeListener('request', notifier.handleSountRequest);
window.removeEventListener('game.response', notifier.handleGameResponse);
};
export { settingsClass } from './lib/settings';