diff --git a/party-overview.js b/party-overview.js index 368fd4e..b1ade01 100644 --- a/party-overview.js +++ b/party-overview.js @@ -10,34 +10,36 @@ Hooks.once("init", () => { registerApiSettings(); partyOverview = new PartyOverviewApp(); - game.keybindings.register("party-overview", "openPartyOverview", { - name: game.i18n.localize("party-overview.keybinds.open.name"), - hint: game.i18n.localize("party-overview.keybinds.open.hint"), - onDown: () => { - partyOverview.render(true); - }, - onUp: () => {}, - precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, - }); - game.keybindings.register("party-overview", "closePartyOverview", { - name: game.i18n.localize("party-overview.keybinds.close.name"), - hint: game.i18n.localize("party-overview.keybinds.close.hint"), - onDown: () => { - partyOverview.close(); - }, - onUp: () => {}, - precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, - }); - game.keybindings.register("party-overview", "togglePartyOverview", { - name: game.i18n.localize("party-overview.keybinds.toggle.name"), - hint: game.i18n.localize("party-overview.keybinds.toggle.hint"), - onDown: () => { - if (!partyOverview.rendering) partyOverview.render(true); - else partyOverview.close(); - }, - onUp: () => {}, - precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, - }); + if (game.keybindings) { + game.keybindings.register("party-overview", "openPartyOverview", { + name: game.i18n.localize("party-overview.keybinds.open.name"), + hint: game.i18n.localize("party-overview.keybinds.open.hint"), + onDown: () => { + partyOverview.render(true); + }, + onUp: () => {}, + precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, + }); + game.keybindings.register("party-overview", "closePartyOverview", { + name: game.i18n.localize("party-overview.keybinds.close.name"), + hint: game.i18n.localize("party-overview.keybinds.close.hint"), + onDown: () => { + partyOverview.close(); + }, + onUp: () => {}, + precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, + }); + game.keybindings.register("party-overview", "togglePartyOverview", { + name: game.i18n.localize("party-overview.keybinds.toggle.name"), + hint: game.i18n.localize("party-overview.keybinds.toggle.hint"), + onDown: () => { + if (!partyOverview.rendering) partyOverview.render(true); + else partyOverview.close(); + }, + onUp: () => {}, + precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL, + }); + } return loadTemplates([ "modules/party-overview/templates/parts/Tabs.html", "modules/party-overview/templates/parts/FilterButton.html",