Fix sur armes et affichage

This commit is contained in:
LeRatierBretonnien 2023-03-08 20:24:19 +01:00
parent 165c836f39
commit 9944ebe64d
8 changed files with 25 additions and 22 deletions

View File

@ -372,7 +372,7 @@ export class MaleficesActor extends Actor {
arme = duplicate(arme) arme = duplicate(arme)
let rollData = this.getCommonRollData() let rollData = this.getCommonRollData()
if (arme.system.armetype == "mainsnues" || arme.system.armetype == "epee") { if (arme.system.armetype == "mainsnues" || arme.system.armetype == "epee") {
rollData.attr = { label: "(Physique+Habilité)/2", value: Math.floor( (this.getPhysiqueMalus()+this.system.attributs.physique+this.system.attributs.habilite) / 2) } rollData.attr = { label: "(Physique+Habilité)/2", value: Math.floor( (this.getPhysiqueMalus()+this.system.attributs.physique.value+this.system.attributs.habilite.value) / 2) }
} else { } else {
rollData.attr = duplicate(this.system.attributs.habilite) rollData.attr = duplicate(this.system.attributs.habilite)
} }

View File

@ -64,6 +64,8 @@ Hooks.once("init", async function () {
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-malefices", MaleficesItemSheet, { makeDefault: true }); Items.registerSheet("fvtt-malefices", MaleficesItemSheet, { makeDefault: true });
MaleficesUtility.init()
}); });
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -120,12 +122,6 @@ Hooks.once("ready", function () {
}); });
} }
// CSS patch for v9
if (game.version) {
let sidebar = document.getElementById("sidebar");
sidebar.style.width = "min-content";
}
registerUsageCount('fvtt-malefices') registerUsageCount('fvtt-malefices')
welcomeMessage(); welcomeMessage();
MaleficesUtility.ready() MaleficesUtility.ready()

View File

@ -5,18 +5,18 @@ import { MaleficesCommands } from "./malefices-commands.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
export class MaleficesUtility { export class MaleficesUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async ready() { static async init() {
Hooks.on('renderChatLog', (log, html, data) => MaleficesUtility.chatListeners(html)); Hooks.on('renderChatLog', (log, html, data) => MaleficesUtility.chatListeners(html));
/*Hooks.on("dropCanvasData", (canvas, data) => {
MaleficesUtility.dropItemOnToken(canvas, data)
});*/
this.rollDataStore = {} this.rollDataStore = {}
this.defenderStore = {} this.defenderStore = {}
MaleficesCommands.init(); MaleficesCommands.init();
}
/* -------------------------------------------- */
static async ready() {
Handlebars.registerHelper('count', function (list) { Handlebars.registerHelper('count', function (list) {
return list.length; return list.length;

View File

@ -235,6 +235,11 @@ table {border: 1px solid #7a7971;}
object-position: 50% 0; object-position: 50% 0;
border-width: 0px; border-width: 0px;
} }
.profile-img-container {
margin-right: 0.2rem;
max-width: 140px;
width: 140px;
}
.button-img { .button-img {
vertical-align: baseline; vertical-align: baseline;
@ -954,8 +959,6 @@ ul, li {
} }
#sidebar #sidebar-tabs i{ #sidebar #sidebar-tabs i{
width: 25px;
height: 25px;
display: inline-block; display: inline-block;
background-position:center; background-position:center;
background-size:cover; background-size:cover;

View File

@ -72,7 +72,7 @@
], ],
"title": "Maléfices, le Jeu de Rôle", "title": "Maléfices, le Jeu de Rôle",
"url": "https://www.uberwald.me/gitea/public/fvtt-malefices", "url": "https://www.uberwald.me/gitea/public/fvtt-malefices",
"version": "10.1.2", "version": "10.1.3",
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.1.2.zip", "download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.1.3.zip",
"background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp" "background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp"
} }

View File

@ -132,7 +132,7 @@
"description": "" "description": ""
}, },
"arme": { "arme": {
"armetype": 0, "armetype": "",
"porteecourte": "", "porteecourte": "",
"porteemoyenne": "", "porteemoyenne": "",
"dommagenormale": 0, "dommagenormale": 0,

View File

@ -4,7 +4,11 @@
<header class="sheet-header"> <header class="sheet-header">
<div class="header-fields"> <div class="header-fields">
<div class="flexrow"> <div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="profile-img-container">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
</div>
<div class="flexcol"> <div class="flexcol">
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1> <h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>

View File

@ -33,25 +33,25 @@
<li><label class="chat-result-text chat-result-success ">Réussite Critique !</label></li> <li><label class="chat-result-text chat-result-success ">Réussite Critique !</label></li>
{{#if arme}} {{#if arme}}
{{#if arme.system.dommagecritiquemort}} {{#if arme.system.dommagecritiquemort}}
<li><label class="chat-result-text chat-result-success">La victime est morte !</label></li> <li><label class="chat-result-success">La victime est morte !</label></li>
{{else}} {{else}}
{{#if arme.system.dommagecritiqueko}} {{#if arme.system.dommagecritiqueko}}
<li><label class="chat-result-text chat-result-success ">La victime est KO !</label></li> <li><label class="chat-result-text chat-result-success ">La victime est KO !</label></li>
{{/if}} {{/if}}
<li><label class="chat-result-text chat-result-success ">La victime subit {{arme.system.dommagecritique}} dommages</label></li> <li><label class="chat-result-success ">La victime subit {{arme.system.dommagecritique}} dommages</label></li>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{else}} {{else}}
{{#if isPart}} {{#if isPart}}
<li><label class="chat-result-text chat-result-success ">Réussite Particulière !</label></li> <li><label class="chat-result-text chat-result-success ">Réussite Particulière !</label></li>
{{#if arme}} {{#if arme}}
<li><label class="chat-result-text chat-result-success ">La victime subit {{arme.system.dommagepart}} dommages</label></li> <li><label class="chat-result-success ">La victime subit {{arme.system.dommagepart}} dommages</label></li>
{{/if}} {{/if}}
{{else}} {{else}}
<li><label class="chat-result-text chat-result-success ">Succés !</label></li> <li><label class="chat-result-text chat-result-success ">Succés !</label></li>
{{#if arme}} {{#if arme}}
<li><label class="chat-result-text chat-result-success ">La victime subit {{arme.system.dommagenormale}} dommages</label></li> <li><label class="chat-result-success ">La victime subit {{arme.system.dommagenormale}} dommages</label></li>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}