Update vtt types

This commit is contained in:
Johannes Loher 2021-07-07 19:22:35 +02:00
parent 623558dc78
commit c57960c153
24 changed files with 144 additions and 107 deletions

View file

@ -6,6 +6,7 @@
// SPDX-License-Identifier: MIT
import { DS4 } from "../config";
import { getGame } from "../helpers";
export default function registerForSetupHooks(): void {
Hooks.once("setup", () => {
@ -21,7 +22,7 @@ function localizeAndSortConfigObjects() {
const localizeObject = <T extends { [s: string]: string }>(obj: T, sort = true): T => {
const localized = Object.entries(obj).map(([key, value]) => {
return [key, game.i18n.localize(value)];
return [key, getGame().i18n.localize(value)];
});
if (sort) localized.sort((a, b) => a[1].localeCompare(b[1]));
return Object.fromEntries(localized);