diff --git a/lang/en.json b/lang/en.json index fc65894..7594682 100644 --- a/lang/en.json +++ b/lang/en.json @@ -192,6 +192,8 @@ "DG.Mental.Motivations": "Motivation", "DG.Mental.Disorders": "Disorder", + "DG.Gear.WeaponTypes.Firearms": "Firearms", + "DG.Gear.WeaponTypes.Melee": "Melee", "DG.Gear.Weapons": "WEAPONS", "DG.Gear.Armor": "ARMOR", "DG.Gear.OtherGear": "OTHER GEAR", diff --git a/module/roll/roll.js b/module/roll/roll.js index d700525..af59a02 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -3,6 +3,7 @@ import DGUtils from "../other/utility-functions.js"; import DG from "../config.js"; const { renderTemplate } = foundry.applications.handlebars; +const { DialogV2 } = foundry.applications.api; export class DGRoll extends Roll { /** @@ -177,7 +178,7 @@ export class DGPercentileRoll extends DGRoll { }; }); - new foundry.applications.api.DialogV2({ + new DialogV2({ content, window: { title: DGUtils.localizeWithFallback( @@ -705,7 +706,7 @@ export class DGDamageRoll extends DGRoll { const content = await renderTemplate(template, backingData); return new Promise((resolve, reject) => { - new foundry.applications.api.DialogV2({ + new DialogV2({ content, window: { title: game.i18n.localize("DG.ModifySkillRollDialogue.Title"), diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index b100541..0213bfa 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -8,6 +8,7 @@ import { import DGSheetMixin from "./base-sheet.js"; const { ActorSheetV2 } = foundry.applications.sheets; +const { DialogV2 } = foundry.applications.api; export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { /** @override */ @@ -841,7 +842,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { htmlContent += ` `; htmlContent += ``; - new foundry.applications.api.DialogV2({ + new DialogV2({ content: htmlContent, window: { title: @@ -912,7 +913,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { htmlContent += ` `; htmlContent += ``; - new foundry.applications.api.DialogV2({ + new DialogV2({ content: htmlContent, window: { title: @@ -1079,7 +1080,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { ); // Prepare and render dialog with above template. - new foundry.applications.api.DialogV2({ + new DialogV2({ content, window: { title: game.i18n.localize("DG.SpecialTraining.Dialog.Title"), @@ -1273,12 +1274,12 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { const { packType } = target.dataset; switch (packType) { case "weapon": { - new foundry.applications.api.DialogV2({ + new DialogV2({ window: { title: "Select Compendium" }, buttons: [ { action: "firearms", - label: "Firearms", + label: game.i18n.localize("DG.Gear.WeaponTypes.Firearms"), icon: '', callback: () => game.packs @@ -1287,7 +1288,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { }, { action: "melee", - label: "Melee", + label: game.i18n.localize("DG.Gear.WeaponTypes.Melee"), icon: '', callback: () => game.packs