#87 : Bouton de +1/-1 pour l'init, via menu ou HUD
This commit is contained in:
@ -27,15 +27,23 @@ export class RdDTokenHud {
|
||||
app.hasExtension = true;
|
||||
|
||||
let armesList = RdDUtility.buildListeActionsCombat(combatant) ;
|
||||
const hudData = { combatant: combatant, armes: armesList };
|
||||
const hudData = { combatant: combatant, armes: armesList,
|
||||
commandes: [{ name: 'Initiative +1', command: 'inc', value: 0.01}, { name: 'Initiative -1',command: 'dec', value: -0.01}] };
|
||||
|
||||
// initiative
|
||||
await RdDTokenHud._configureSubMenu(html.find('.control-icon.combat'), 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html', hudData,
|
||||
(event) => {
|
||||
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
|
||||
let initCommand = event.currentTarget.attributes['data-command'].value;
|
||||
let combatantId = event.currentTarget.attributes['data-combatant-id'].value;
|
||||
let arme = armesList[armeIndex];
|
||||
RdDUtility.rollInitiativeCompetence(combatantId, arme);
|
||||
if ( !initCommand ) {
|
||||
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
|
||||
let arme = armesList[armeIndex];
|
||||
RdDUtility.rollInitiativeCompetence(combatantId, arme);
|
||||
} else if (initCommand == 'inc') {
|
||||
RdDUtility.incDecInit( combatantId, 0.01 );
|
||||
} else if ( initCommand == 'dec') {
|
||||
RdDUtility.incDecInit( combatantId, -0.01 );
|
||||
}
|
||||
});
|
||||
|
||||
// combat
|
||||
|
Reference in New Issue
Block a user