Added ability to switch between stance/prepared on mouse clic (left/right).
This commit is contained in:
@@ -274,6 +274,15 @@ export class GmMonitor extends FormApplication {
|
||||
// Mouse bt : middle = 0, left +1, right -1
|
||||
const add = event.which === 2 ? -999 : event.which === 1 ? 1 : -1;
|
||||
|
||||
// Stance
|
||||
let stanceIdx =
|
||||
CONFIG.l5r5e.stances.findIndex((s) => s === actor.data.data.stance) + (event.which === 1 ? 1 : -1);
|
||||
if (stanceIdx < 0) {
|
||||
stanceIdx = CONFIG.l5r5e.stances.length - 1;
|
||||
} else if (stanceIdx > CONFIG.l5r5e.stances.length - 1) {
|
||||
stanceIdx = 0;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
// *** Characters ***
|
||||
case "fatigue":
|
||||
@@ -309,6 +318,22 @@ export class GmMonitor extends FormApplication {
|
||||
});
|
||||
break;
|
||||
|
||||
case "stance":
|
||||
await actor.update({
|
||||
data: {
|
||||
stance: CONFIG.l5r5e.stances[stanceIdx],
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
case "prepared":
|
||||
await actor.update({
|
||||
data: {
|
||||
prepared: !actor.data.data.prepared,
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
// *** Armies ***
|
||||
case "casualties":
|
||||
await actor.update({
|
||||
|
||||
Reference in New Issue
Block a user