Update types

This commit is contained in:
Johannes Loher 2021-02-05 20:37:52 +01:00
parent 05bd1335ba
commit 5cb75a4001
3 changed files with 25 additions and 30 deletions

2
package-lock.json generated
View file

@ -3119,7 +3119,7 @@
}
},
"foundry-vtt-types": {
"version": "github:League-of-Foundry-Developers/foundry-vtt-types#dc5ff5a9c75cda3f4999603221275ed8d7d9212c",
"version": "github:League-of-Foundry-Developers/foundry-vtt-types#865f9522eb8b81e15f34f06793e2cbf09e48d601",
"from": "github:League-of-Foundry-Developers/foundry-vtt-types#foundry-0.7.9",
"dev": true,
"requires": {

View file

@ -33,7 +33,7 @@ Hooks.once("init", async function () {
CONFIG.Item.typeLabels = DS4.i18n.itemTypes;
// Configure Dice
CONFIG.Dice.types.push(DS4Check); // TODO(types) fix upstream
CONFIG.Dice.types.push(DS4Check);
CONFIG.Dice.terms.s = DS4Check;
// Register system settings

View file

@ -131,37 +131,32 @@ async function askGmModifier(
const renderedHtml = await renderTemplate(usedTemplate, templateData);
const dialogPromise = new Promise<HTMLFormElement>((resolve) => {
new Dialog(
{
title: usedTitle,
content: renderedHtml,
buttons: {
ok: {
label: game.i18n.localize("DS4.RollDialogOkButton"),
callback: (html) => {
if (!("jquery" in html)) {
throw new Error(
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
exType: "JQuery",
realType: "HTMLElement",
}),
);
} else {
const innerForm = html[0].querySelector("form");
resolve(innerForm);
}
},
icon: "", // TODO(types): Remove once https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues/266 is fixed
},
cancel: {
label: game.i18n.localize("DS4.RollDialogCancelButton"),
icon: "", // TODO(types): Remove once https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues/266 is fixed
new Dialog({
title: usedTitle,
content: renderedHtml,
buttons: {
ok: {
label: game.i18n.localize("DS4.RollDialogOkButton"),
callback: (html) => {
if (!("jquery" in html)) {
throw new Error(
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
exType: "JQuery",
realType: "HTMLElement",
}),
);
} else {
const innerForm = html[0].querySelector("form");
resolve(innerForm);
}
},
},
default: "ok",
cancel: {
label: game.i18n.localize("DS4.RollDialogCancelButton"),
},
},
{}, // TODO(types): Remove once https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues/267 is resolved
).render(true);
default: "ok",
}).render(true);
});
const dialogForm = await dialogPromise;
return parseDialogFormData(dialogForm);