#55 Added default item height in settings

This commit is contained in:
Vlyan
2024-05-11 12:11:38 +02:00
parent 7ca9ee6cba
commit 5687a2f34b
22 changed files with 40 additions and 51 deletions

View File

@@ -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

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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

View File

@@ -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;

View File

@@ -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",
});
}

View File

@@ -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");
});
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}
}

View File

@@ -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 }],
});

View File

@@ -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" }],
});
}
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}
}

View File

@@ -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" }],
});
}
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}

View File

@@ -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" }],
});
}

View File

@@ -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 */
/* ------------------------------------ */