Fix templates for new appv2

This commit is contained in:
2025-06-02 23:25:49 +02:00
parent c25320755a
commit a0f42204d5
24 changed files with 421 additions and 113 deletions

View File

@ -15,6 +15,7 @@ import { ItemAction } from "../item/item-actions.js";
* @extends {ActorSheet}
*/
export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet {
static _warnedAppV1 = true
/** @override */
static get defaultOptions() {

View File

@ -53,7 +53,7 @@ export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry
static DEFAULT_OPTIONS = {
classes: ["fvtt-rdd", "item"],
position: {
width: 600,
width: 448,
height: "auto",
},
form: {

View File

@ -13,7 +13,7 @@ export default class RdDMonnaieSheet extends RdDItemBaseSheet {
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "monnaie"],
position: { width: 400 },
position: { width: 448 },
window: { contentClasses: ["monnaie-content"] }
})

View File

@ -12,7 +12,7 @@ export default class RdDMunitionSheet extends RdDItemBaseSheet {
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "munition"],
position: { width: 400 },
position: { width: 448 },
window: { contentClasses: ["munition-content"] }
})

View File

@ -12,7 +12,7 @@ export default class RdDTarotSheet extends RdDItemBaseSheet {
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "tarot"],
position: { width: 400 },
position: { width: 448 },
window: { contentClasses: ["tarot-content"] }
})

View File

@ -1,7 +1,11 @@
import { RdDItem } from "../item.js";
export default class RdDItemMonnaie extends RdDItem {
static get defaultIcon() {
return 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp'
constructor(data, context) {
if (!data.img) {
data.img = 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp'
}
super(data, context);
}
}

View File

@ -2,6 +2,6 @@ import { RdDItem } from "../item.js";
export default class RdDItemTarot extends RdDItem {
static get defaultIcon() {
return 'systems/foundryvtt-reve-de-dragon/icons/objets/tarot.webp'
return 'systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp'
}
}

View File

@ -78,6 +78,8 @@ export const defaultItemImg = {
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp",
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
monnaie:"systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp"
}
/* -------------------------------------------- */

View File

@ -112,6 +112,7 @@ export class RdDTokenHud {
/* -------------------------------------------- */
static async addTokenHudExtensions(app, html, tokenId) {
console.log(`Adding token HUD extensions for token ${tokenId}`);
const controlIconCombat = $(html).find('.control-icon[data-action=combat]');
if (controlIconCombat.length > 0) {
controlIconCombat.click(event => {
@ -129,7 +130,7 @@ export class RdDTokenHud {
/* -------------------------------------------- */
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
const hud = $(await renderTemplate(template, hudData));
const hud = $(await foundry.applications.handlebars.renderTemplate(template, hudData));
const list = hud.find('div.rdd-hud-list');
RdDTokenHud._toggleHudListActive(hud, list);

View File

@ -15,6 +15,8 @@ const TEMPLATE_CALENDRIER = "systems/foundryvtt-reve-de-dragon/templates/time/ca
const INITIAL_CALENDAR_POS = { top: 200, left: 200, horlogeAnalogique: true };
/* -------------------------------------------- */
export class RdDCalendrier extends Application {
static _warnedAppV1 = true
static initSettings() {
game.settings.register(SYSTEM_RDD, "liste-nombre-astral", {
name: "liste-nombre-astral",
@ -242,7 +244,7 @@ export class RdDCalendrier extends Application {
}
/**
*
*
* @param {*} indexDate la date pour laquelle obtenir le nombre astral. Si undefined, on prend la date du jour
* @returns le nombre astral pour la date, ou pour la date du jour si la date n'est pas fournie.
* Si aucun nombre astral n'est trouvé, retourne 0 (cas où l'on demanderait un nombre astral en dehors des 12 jours courant et à venir)