Move HUD button attaque

This commit is contained in:
2025-09-29 01:47:35 +02:00
parent 1360992daa
commit 053bc23d12
3 changed files with 14 additions and 12 deletions

View File

@@ -1954,13 +1954,13 @@ select,
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
top: 4.6rem; top: 10rem;
left: -19rem; left: -9rem;
} }
.system-foundryvtt-reve-de-dragon .token-hud-ext.soins { .system-foundryvtt-reve-de-dragon .token-hud-ext.soins {
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
top: 14.7rem; top: 15.5rem;
left: -6rem; left: -6rem;
max-width: 8rem; max-width: 8rem;
line-height: 1rem; line-height: 1rem;

View File

@@ -1319,13 +1319,13 @@
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
top: 4.6rem; top: 10rem;
left: -19rem; left: -9rem;
} }
.token-hud-ext.soins { .token-hud-ext.soins {
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
top: 14.7rem; top: 15.5rem;
left: -6rem; left: -6rem;
max-width: 8rem; max-width: 8rem;
line-height: 1rem; line-height: 1rem;

View File

@@ -50,7 +50,7 @@ export class RdDTokenHud {
{ name: 'Initiative -1', command: 'dec', value: -0.01 }] { name: 'Initiative -1', command: 'dec', value: -0.01 }]
}; };
const controlIconCombat = $(html).find('.control-icon[data-action=combat]'); const controlIconCombat = $(html).find('.control-icon[data-action=combat]');
await RdDTokenHud._configureSubMenu(controlIconCombat, await RdDTokenHud._configureSubMenu(it => controlIconCombat.after(it),
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs', 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs',
hudData, hudData,
(event) => { (event) => {
@@ -69,8 +69,10 @@ export class RdDTokenHud {
static async addExtensionHudCombat(html, combatant, token, actions) { static async addExtensionHudCombat(html, combatant, token, actions) {
const hudData = { combatant, token, actions, commandes: [] }; const hudData = { combatant, token, actions, commandes: [] };
const controlIconTarget = $(html).find('.control-icon[data-action=target]'); const divColLeft = $(html).find('div.col.left');
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData, await RdDTokenHud._configureSubMenu(it => divColLeft.append(it),
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs',
hudData,
(event) => { (event) => {
const actionIndex = event.currentTarget.attributes['data-action-index']?.value; const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
const action = hudData.actions[actionIndex]; const action = hudData.actions[actionIndex];
@@ -90,7 +92,7 @@ export class RdDTokenHud {
const hudSoins = { blessures: target.actor.blessuresASoigner() ?? [] }; const hudSoins = { blessures: target.actor.blessuresASoigner() ?? [] };
if (hudSoins.blessures.length > 0) { if (hudSoins.blessures.length > 0) {
const controlIconTarget = $(html).find('.control-icon[data-action=combat]'); const controlIconTarget = $(html).find('.control-icon[data-action=combat]');
await RdDTokenHud._configureSubMenu(controlIconTarget, await RdDTokenHud._configureSubMenu(it => controlIconTarget.after(it),
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-soins.hbs', 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-soins.hbs',
hudSoins, hudSoins,
(event) => { (event) => {
@@ -129,7 +131,7 @@ export class RdDTokenHud {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) { static async _configureSubMenu(insertMethod, template, hudData, onMenuItem) {
const hud = $(await foundry.applications.handlebars.renderTemplate(template, hudData)); const hud = $(await foundry.applications.handlebars.renderTemplate(template, hudData));
const list = hud.find('div.rdd-hud-list'); const list = hud.find('div.rdd-hud-list');
@@ -138,7 +140,7 @@ export class RdDTokenHud {
hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list)); hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list));
list.find('.rdd-hud-menu').click(onMenuItem); list.find('.rdd-hud-menu').click(onMenuItem);
insertionPoint.after(hud); insertMethod(hud);
} }
static _toggleHudListActive(hud, list) { static _toggleHudListActive(hud, list) {