diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ab423..87c7ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Changelog Date format : day/month/year -## 1.11.1 - ??/02/2024 - Compendium fix +## 1.11.1 - ??/05/2024 - Little fixes again +- Added ability to players to set their default Item's windows height in settings (#55). - Moved `The blade with no name: Ancestral sword of the Dragon [Blessed Treasure]` from items to weapons compendium. ## 1.11.0 - 13/12/2023 - Little fixes diff --git a/system/lang/en-en.json b/system/lang/en-en.json index a8c6ec7..55cfe70 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -22,6 +22,10 @@ "Title": "Custom Compendium Name", "Hint": "For advanced users that want to change the name of the custom compendiums (Used to disables the embedded ones).", "Notification": "Unable set Custom Compendium: '{name}'. Is it activated and registered with Babele?" + }, + "CustomItemsHeight": { + "Title": "Default items windows height", + "Hint": "Set the default height for 'Items' windows types (techniques, weapons...), in pixels" } }, "TYPES": { diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index f03066c..ba5bb5b 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -22,6 +22,10 @@ "Title": "Nom du CustomCompendium", "Hint": "Pour les utilisateurs avancés qui souhaitent modifier le nom du compendium personnalisé (utilisé pour désactiver ceux intégrés).", "Notification": "Impossible de définir le compendium personnalisé : '{name}'. Est-il activé et enregistré auprès de Babele ?" + }, + "CustomItemsHeight": { + "Title": "Hauteur par défaut des fenêtres d'objets", + "Hint": "Définir la hauteur par défaut des fenêtres de type Item (techniques, armes...) en pixels" } }, "TYPES": { diff --git a/system/scripts/actors/base-character-sheet.js b/system/scripts/actors/base-character-sheet.js index a8c368a..b44825a 100644 --- a/system/scripts/actors/base-character-sheet.js +++ b/system/scripts/actors/base-character-sheet.js @@ -238,7 +238,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e { return e.type === "technique" && e.system.technique_type === itemData.system.technique_type; }) ) { - ui.notifications.info(game.i18n.localize("l5r5e.techniques.only_one")); + ui.notifications.info("l5r5e.techniques.only_one", {localize: true}); return; } @@ -249,7 +249,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e { } else { // Check if technique is allowed for this character // if (!game.user.isGM && !this.actor.system.techniques[itemData.system.technique_type]) { - // ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed")); + // ui.notifications.info("l5r5e.techniques.not_allowed", {localize: true}); // return; // } @@ -625,11 +625,11 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e { if (isInitiative) { if (!game.combat) { - ui.notifications.warn(game.i18n.localize("COMBAT.NoneActive")); + ui.notifications.warn("COMBAT.NoneActive", {localize: true}); return; } if (!this.actor.canDoInitiativeRoll) { - ui.notifications.error(game.i18n.localize("l5r5e.conflict.initiative.already_set")); + ui.notifications.error("l5r5e.conflict.initiative.already_set", {localize: true}); return; } // Minion specific diff --git a/system/scripts/actors/twenty-questions-dialog.js b/system/scripts/actors/twenty-questions-dialog.js index 83e86a2..f9f1815 100644 --- a/system/scripts/actors/twenty-questions-dialog.js +++ b/system/scripts/actors/twenty-questions-dialog.js @@ -292,7 +292,7 @@ export class TwentyQuestionsDialog extends FormApplication { } // } else if (!this.object.data.step3.allowed_techniques?.[item.system.technique_type]) { // // Tech not allowed - // ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed")); + // ui.notifications.info("l5r5e.techniques.not_allowed", {localize: true}); // return; } break; diff --git a/system/scripts/dice/dice-picker-dialog.js b/system/scripts/dice/dice-picker-dialog.js index 6f76657..801df3e 100644 --- a/system/scripts/dice/dice-picker-dialog.js +++ b/system/scripts/dice/dice-picker-dialog.js @@ -530,7 +530,7 @@ export class DicePickerDialog extends FormApplication { // If initiative roll, check if player already have if (this.object.isInitiativeRoll) { if (!game.combat) { - ui.notifications.warn(game.i18n.localize("COMBAT.NoneActive")); + ui.notifications.warn("COMBAT.NoneActive", {localize: true}); return this.close(); } @@ -678,15 +678,15 @@ export class DicePickerDialog extends FormApplication { name = name + " - " + this.object.skill.name; } - let command = `new game.l5r5e.DicePickerDialog(${JSON.stringify(params)}).render(true);`; + const command = `new game.l5r5e.DicePickerDialog(${JSON.stringify(params)}).render(true);`; - let macro = game.macros.contents.find((m) => m.name === name && m.command === command); + let macro = game.macros.contents.find((m) => m.name === name && m.command === command && m.isAuthor); if (!macro) { macro = await Macro.create({ - name: name, + name, type: "script", scope: "global", - command: command, + command, img: this._actor?.img ? this._actor.img : "systems/l5r5e/assets/dices/default/ring_et.svg", }); } diff --git a/system/scripts/help/help-dialog.js b/system/scripts/help/help-dialog.js index e252692..4900c0d 100644 --- a/system/scripts/help/help-dialog.js +++ b/system/scripts/help/help-dialog.js @@ -50,7 +50,7 @@ export class HelpDialog extends FormApplication { event.preventDefault(); event.stopPropagation(); const name = $(event.currentTarget).data("type"); - ui.notifications.info(game.i18n.localize(`l5r5e.logo.${name}.info`)); + ui.notifications.info(`l5r5e.logo.${name}.info`, {localize: true}); window.open(game.i18n.localize(`l5r5e.logo.${name}.link`), "_blank"); }); } diff --git a/system/scripts/items/advancement-sheet.js b/system/scripts/items/advancement-sheet.js index eaf47dd..e2b8e03 100644 --- a/system/scripts/items/advancement-sheet.js +++ b/system/scripts/items/advancement-sheet.js @@ -14,9 +14,6 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "advancement"], template: CONFIG.l5r5e.paths.templates + "items/advancement/advancement-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/armor-sheet.js b/system/scripts/items/armor-sheet.js index e88799b..770da52 100644 --- a/system/scripts/items/armor-sheet.js +++ b/system/scripts/items/armor-sheet.js @@ -9,9 +9,6 @@ export class ArmorSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "armor"], template: CONFIG.l5r5e.paths.templates + "items/armor/armor-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } } diff --git a/system/scripts/items/army-cohort-sheet.js b/system/scripts/items/army-cohort-sheet.js index d41f834..4bfc1f1 100644 --- a/system/scripts/items/army-cohort-sheet.js +++ b/system/scripts/items/army-cohort-sheet.js @@ -9,8 +9,6 @@ export class ArmyCohortSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "army-cohort"], template: CONFIG.l5r5e.paths.templates + "items/army-cohort/army-cohort-sheet.html", - width: 520, - height: 520, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "infos" }], dragDrop: [{ dragSelector: ".item", dropSelector: null }], }); diff --git a/system/scripts/items/army-fortification-sheet.js b/system/scripts/items/army-fortification-sheet.js index 24b09de..404d192 100644 --- a/system/scripts/items/army-fortification-sheet.js +++ b/system/scripts/items/army-fortification-sheet.js @@ -9,9 +9,6 @@ export class ArmyFortificationSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "army-fortification"], template: CONFIG.l5r5e.paths.templates + "items/army-fortification/army-fortification-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } } diff --git a/system/scripts/items/base-item-sheet.js b/system/scripts/items/base-item-sheet.js index 07c8237..0333099 100644 --- a/system/scripts/items/base-item-sheet.js +++ b/system/scripts/items/base-item-sheet.js @@ -9,7 +9,7 @@ export class BaseItemSheetL5r5e extends ItemSheet { classes: ["l5r5e", "sheet", "item"], //template: CONFIG.l5r5e.paths.templates + "items/item/item-sheet.html", width: 520, - height: 480, + height: game.settings.get(CONFIG.l5r5e.namespace, "custom-items-windows-height") || 800, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/bond-sheet.js b/system/scripts/items/bond-sheet.js index df977fb..ee4f674 100644 --- a/system/scripts/items/bond-sheet.js +++ b/system/scripts/items/bond-sheet.js @@ -9,9 +9,6 @@ export class BondSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "bond"], template: CONFIG.l5r5e.paths.templates + "items/bond/bond-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } } diff --git a/system/scripts/items/item-pattern-sheet.js b/system/scripts/items/item-pattern-sheet.js index d8b55d9..647170c 100644 --- a/system/scripts/items/item-pattern-sheet.js +++ b/system/scripts/items/item-pattern-sheet.js @@ -9,9 +9,6 @@ export class ItemPatternSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "item-pattern"], template: CONFIG.l5r5e.paths.templates + "items/item-pattern/item-pattern-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/item-sheet.js b/system/scripts/items/item-sheet.js index a43851d..4efe3b1 100644 --- a/system/scripts/items/item-sheet.js +++ b/system/scripts/items/item-sheet.js @@ -10,9 +10,6 @@ export class ItemSheetL5r5e extends BaseItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "item"], template: CONFIG.l5r5e.paths.templates + "items/item/item-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/peculiarity-sheet.js b/system/scripts/items/peculiarity-sheet.js index 9d332b1..bc6aa94 100644 --- a/system/scripts/items/peculiarity-sheet.js +++ b/system/scripts/items/peculiarity-sheet.js @@ -15,9 +15,6 @@ export class PeculiaritySheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "peculiarity"], template: CONFIG.l5r5e.paths.templates + "items/peculiarity/peculiarity-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/property-sheet.js b/system/scripts/items/property-sheet.js index dfa739f..a26cd22 100644 --- a/system/scripts/items/property-sheet.js +++ b/system/scripts/items/property-sheet.js @@ -9,9 +9,6 @@ export class PropertySheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "property"], template: CONFIG.l5r5e.paths.templates + "items/property/property-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } } diff --git a/system/scripts/items/signature-scroll-sheet.js b/system/scripts/items/signature-scroll-sheet.js index 1f3425a..c4f85fc 100644 --- a/system/scripts/items/signature-scroll-sheet.js +++ b/system/scripts/items/signature-scroll-sheet.js @@ -9,9 +9,6 @@ export class SignatureScrollSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "signature-scroll"], template: CONFIG.l5r5e.paths.templates + "items/signature-scroll/signature-scroll-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } } diff --git a/system/scripts/items/technique-sheet.js b/system/scripts/items/technique-sheet.js index bb0b623..4655675 100644 --- a/system/scripts/items/technique-sheet.js +++ b/system/scripts/items/technique-sheet.js @@ -9,9 +9,6 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "technique"], template: CONFIG.l5r5e.paths.templates + "items/technique/technique-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/title-sheet.js b/system/scripts/items/title-sheet.js index 705c662..d60e173 100644 --- a/system/scripts/items/title-sheet.js +++ b/system/scripts/items/title-sheet.js @@ -9,9 +9,6 @@ export class TitleSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "title"], template: CONFIG.l5r5e.paths.templates + "items/title/title-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/items/weapon-sheet.js b/system/scripts/items/weapon-sheet.js index dab3da1..3d8e0d6 100644 --- a/system/scripts/items/weapon-sheet.js +++ b/system/scripts/items/weapon-sheet.js @@ -9,9 +9,6 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["l5r5e", "sheet", "weapon"], template: CONFIG.l5r5e.paths.templates + "items/weapon/weapon-sheet.html", - width: 520, - height: 480, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], }); } diff --git a/system/scripts/settings.js b/system/scripts/settings.js index b273ed2..9f538ef 100644 --- a/system/scripts/settings.js +++ b/system/scripts/settings.js @@ -53,6 +53,24 @@ export const RegisterSettings = function () { } }); + /* ------------------------------------ */ + /* Client preferences */ + /* ------------------------------------ */ + game.settings.register(CONFIG.l5r5e.namespace, "custom-items-windows-height", { + name: "SETTINGS.CustomItemsHeight.Title", + hint: "SETTINGS.CustomItemsHeight.Hint", + scope: "client", + config: true, + requiresReload: true, + type: Number, + range: { + min: 400, + max: 2000, + step: 50 + }, + default: 800, + }); + /* ------------------------------------ */ /* Update */ /* ------------------------------------ */