Update types
This commit is contained in:
parent
05bd1335ba
commit
5cb75a4001
3 changed files with 25 additions and 30 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -3119,7 +3119,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"foundry-vtt-types": {
|
"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",
|
"from": "github:League-of-Foundry-Developers/foundry-vtt-types#foundry-0.7.9",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|
|
@ -33,7 +33,7 @@ Hooks.once("init", async function () {
|
||||||
CONFIG.Item.typeLabels = DS4.i18n.itemTypes;
|
CONFIG.Item.typeLabels = DS4.i18n.itemTypes;
|
||||||
|
|
||||||
// Configure Dice
|
// Configure Dice
|
||||||
CONFIG.Dice.types.push(DS4Check); // TODO(types) fix upstream
|
CONFIG.Dice.types.push(DS4Check);
|
||||||
CONFIG.Dice.terms.s = DS4Check;
|
CONFIG.Dice.terms.s = DS4Check;
|
||||||
|
|
||||||
// Register system settings
|
// Register system settings
|
||||||
|
|
|
@ -131,37 +131,32 @@ async function askGmModifier(
|
||||||
const renderedHtml = await renderTemplate(usedTemplate, templateData);
|
const renderedHtml = await renderTemplate(usedTemplate, templateData);
|
||||||
|
|
||||||
const dialogPromise = new Promise<HTMLFormElement>((resolve) => {
|
const dialogPromise = new Promise<HTMLFormElement>((resolve) => {
|
||||||
new Dialog(
|
new Dialog({
|
||||||
{
|
title: usedTitle,
|
||||||
title: usedTitle,
|
content: renderedHtml,
|
||||||
content: renderedHtml,
|
buttons: {
|
||||||
buttons: {
|
ok: {
|
||||||
ok: {
|
label: game.i18n.localize("DS4.RollDialogOkButton"),
|
||||||
label: game.i18n.localize("DS4.RollDialogOkButton"),
|
callback: (html) => {
|
||||||
callback: (html) => {
|
if (!("jquery" in html)) {
|
||||||
if (!("jquery" in html)) {
|
throw new Error(
|
||||||
throw new Error(
|
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
|
||||||
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
|
exType: "JQuery",
|
||||||
exType: "JQuery",
|
realType: "HTMLElement",
|
||||||
realType: "HTMLElement",
|
}),
|
||||||
}),
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
const innerForm = html[0].querySelector("form");
|
||||||
const innerForm = html[0].querySelector("form");
|
resolve(innerForm);
|
||||||
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
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
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
|
default: "ok",
|
||||||
).render(true);
|
}).render(true);
|
||||||
});
|
});
|
||||||
const dialogForm = await dialogPromise;
|
const dialogForm = await dialogPromise;
|
||||||
return parseDialogFormData(dialogForm);
|
return parseDialogFormData(dialogForm);
|
||||||
|
|
Loading…
Reference in a new issue