Update CSS/Look & feel

This commit is contained in:
2026-04-03 00:39:39 +02:00
parent 23b105a47e
commit 9754bbc3a8
265 changed files with 12355 additions and 47899 deletions

View File

@@ -16,15 +16,12 @@ export class MournbladeCYD2RollDialog {
difficulte: String(rollData.difficulte || 0),
img: actor.img,
name: actor.name,
config: game.system.mournbladecyd2.config
config: game.system.mournbladecyd2.config,
attributs: game.system.mournbladecyd2.config.attributs,
};
if (rollData.attrKey === "tochoose") {
context.selectableAttributes = actor.system.attributs;
}
const content = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-mournblade-cyd2/templates/roll-dialog-generic.hbs",
"systems/fvtt-mournblade-cyd-2-0/templates/roll-dialog-generic.hbs",
context
);

View File

@@ -16,10 +16,10 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"],
position: {
width: 640,
height: 720,
width: 750,
height: 820,
},
form: {
submitOnChange: true,
@@ -44,6 +44,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
createItem: MournbladeCYD2ActorSheetV2.#onCreateItem,
equipItem: MournbladeCYD2ActorSheetV2.#onEquipItem,
modifyQuantity: MournbladeCYD2ActorSheetV2.#onModifyQuantity,
modifyAdversite: MournbladeCYD2ActorSheetV2.#onModifyAdversite,
modifySante: MournbladeCYD2ActorSheetV2.#onModifySante,
modifyAme: MournbladeCYD2ActorSheetV2.#onModifyAme,
rollAttribut: MournbladeCYD2ActorSheetV2.#onRollAttribut,
@@ -53,7 +54,11 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
rollArmeSpecial: MournbladeCYD2ActorSheetV2.#onRollArmeSpecial,
rollArmeDegats: MournbladeCYD2ActorSheetV2.#onRollArmeDegats,
rollAssommer: MournbladeCYD2ActorSheetV2.#onRollAssommer,
rollCoupBas: MournbladeCYD2ActorSheetV2.#onRollCoupBas,
rollImmobiliser: MournbladeCYD2ActorSheetV2.#onRollImmobiliser,
rollRepousser: MournbladeCYD2ActorSheetV2.#onRollRepousser,
rollDesengager: MournbladeCYD2ActorSheetV2.#onRollDesengager,
rollInitiative: MournbladeCYD2ActorSheetV2.#onRollInitiative,
rollFuir: MournbladeCYD2ActorSheetV2.#onRollFuir,
},
};
@@ -226,6 +231,15 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
}
}
static async #onModifyAdversite(event, target) {
const li = target.closest('[data-adversite]');
const adversiteKey = li?.dataset.adversite;
if (!adversiteKey) return;
const value = Number.parseInt(target.dataset.adversiteValue);
const current = this.document.system.adversite[adversiteKey] || 0;
await this.document.update({ [`system.adversite.${adversiteKey}`]: Math.max(0, current + value) });
}
static async #onModifySante(event, target) {
const type = target.dataset.type;
const value = Number.parseInt(target.dataset.value);
@@ -254,25 +268,44 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
}
static async #onRollArmeOffensif(event, target) {
await this.document.rollArmeOffensif(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeOffensif(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollArmeSpecial(event, target) {
await this.document.rollArmeSpecial(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeSpecial(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollArmeDegats(event, target) {
await this.document.rollArmeDegats(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeDegats(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollAssommer(event, target) {
await this.document.rollAssomer();
}
static async #onRollCoupBas(event, target) {
await this.document.rollCoupBas();
}
static async #onRollImmobiliser(event, target) {
await this.document.rollImmobiliser();
}
static async #onRollRepousser(event, target) {
await this.document.rollRepousser();
}
static async #onRollDesengager(event, target) {
await this.document.rollDesengager();
}
static async #onRollInitiative(event, target) {
await this.document.rollAttribut("adr", true);
}
static async #onRollFuir(event, target) {
await this.document.rollFuir();
}

View File

@@ -13,7 +13,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade-cyd2", "item"],
classes: ["fvtt-mournblade-cyd-2-0", "item"],
position: {
width: 620,
height: 600,
@@ -107,7 +107,24 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
}
static async #onPostItem(event) {
await this.document.toChat?.();
event.preventDefault();
const item = this.document;
const chatData = foundry.utils.duplicate(item);
if (item.actor) {
chatData.actor = { id: item.actor.id };
}
if (chatData.img?.includes("/blank.png")) {
chatData.img = null;
}
chatData.jsondata = JSON.stringify({
compendium: "postedItem",
payload: chatData,
});
const html = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-mournblade-cyd-2-0/templates/post-item.hbs",
chatData
);
ChatMessage.create({ user: game.user.id, content: html });
}
static async #onAddPredilection(event) {

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ArmeSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-arme-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-arme-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2CompetenceSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-competence-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-competence-sheet.hbs",
},
};

View File

@@ -1,4 +1,5 @@
import MournbladeCYD2ActorSheetV2 from "./base-actor-sheet.mjs";
import { MournbladeCYD2Utility } from "../../mournblade-cyd2-utility.js";
export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorSheetV2 {
@@ -15,7 +16,7 @@ export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorShee
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade-cyd2/templates/creature-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/creature-sheet.hbs",
},
};
@@ -28,6 +29,7 @@ export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorShee
const actor = this.document;
context.skills = actor.getSkills?.() ?? [];
context.combativiteList = MournbladeCYD2Utility.getCombativiteList(actor.system.sante?.nbcombativite || 0);
context.armes = foundry.utils.duplicate(actor.getWeapons?.() ?? []);
context.protections = foundry.utils.duplicate(actor.getArmors?.() ?? []);
context.runes = foundry.utils.duplicate(actor.getRunes?.() ?? []);

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2DonSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-don-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-don-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2EquipementSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-equipement-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-equipement-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2HistoriqueSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-historique-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-historique-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2MonnaieSheet extends MournbladeCYD2ItemSheetV
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-monnaie-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-monnaie-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2PacteSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-pacte-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-pacte-sheet.hbs",
},
};

View File

@@ -1,4 +1,5 @@
import MournbladeCYD2ActorSheetV2 from "./base-actor-sheet.mjs";
import { MournbladeCYD2Utility } from "../../mournblade-cyd2-utility.js";
export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSheetV2 {
@@ -15,7 +16,7 @@ export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSh
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/actor-sheet.hbs",
},
};
@@ -27,6 +28,10 @@ export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSh
const context = await super._prepareContext();
const actor = this.document;
context.combativiteList = MournbladeCYD2Utility.getCombativiteList(actor.system.sante.nbcombativite);
context.ameList = MournbladeCYD2Utility.getAmeList(actor.system.ame.nbame, actor.getAmeMax?.() ?? 0);
context.ameMaxList = MournbladeCYD2Utility.getAmeMaxList(actor.system.ame.nbame);
context.skills = actor.getSkills?.() ?? [];
context.armes = foundry.utils.duplicate(actor.getWeapons?.() ?? []);
context.protections = foundry.utils.duplicate(actor.getArmors?.() ?? []);

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ProfilSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-profil-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-profil-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ProtectionSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-protection-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-protection-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RessourceSheet extends MournbladeCYD2ItemShee
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-ressource-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-ressource-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RuneSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-rune-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-rune-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RuneEffectSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-runeeffect-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-runeeffect-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TalentSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-talent-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-talent-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TendanceSheet extends MournbladeCYD2ItemSheet
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-tendance-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-tendance-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TraitChaotiqueSheet extends MournbladeCYD2Ite
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-traitchaotique-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-traitchaotique-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TraitEspeceSheet extends MournbladeCYD2ItemSh
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-traitespece-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-traitespece-sheet.hbs",
},
};