Some test on gm toolbox
This commit is contained in:
@@ -109,6 +109,15 @@
|
|||||||
"keep_drop_here": "Keep",
|
"keep_drop_here": "Keep",
|
||||||
"bt_validate": "Finalize this step"
|
"bt_validate": "Finalize this step"
|
||||||
},
|
},
|
||||||
|
"gm_toolbox": {
|
||||||
|
"title": "GM ToolBox",
|
||||||
|
"difficulty_hidden": "Change difficulty visibility",
|
||||||
|
"difficulty": "Change difficulty (right: add, left: subtract, middle: TN 2)",
|
||||||
|
"clear_conflict": "Clear all conflict on Characters",
|
||||||
|
"clear_conflict_info": "All conflict on Characters was reset",
|
||||||
|
"starting_void_point": "Reset void points on Characters (half max value)",
|
||||||
|
"starting_void_point_info": "All void points on Characters was reset"
|
||||||
|
},
|
||||||
"max": "Max",
|
"max": "Max",
|
||||||
"current": "Current",
|
"current": "Current",
|
||||||
"quantity": "Quantity",
|
"quantity": "Quantity",
|
||||||
|
|||||||
@@ -109,6 +109,15 @@
|
|||||||
"keep_drop_here": "Guardar",
|
"keep_drop_here": "Guardar",
|
||||||
"bt_validate": "Finalizar"
|
"bt_validate": "Finalizar"
|
||||||
},
|
},
|
||||||
|
"gm_toolbox": {
|
||||||
|
"title": "GM ToolBox",
|
||||||
|
"difficulty_hidden": "Change difficulty visibility",
|
||||||
|
"difficulty": "Change difficulty (right: add, left: subtract, middle: TN 2)",
|
||||||
|
"clear_conflict": "Clear all conflict on Characters",
|
||||||
|
"clear_conflict_info": "All conflict on Characters was reset",
|
||||||
|
"starting_void_point": "Reset void points on Characters (half max value)",
|
||||||
|
"starting_void_point_info": "All void points on Characters was reset"
|
||||||
|
},
|
||||||
"max": "Máx",
|
"max": "Máx",
|
||||||
"current": "Actuales",
|
"current": "Actuales",
|
||||||
"quantity": "Cantidad",
|
"quantity": "Cantidad",
|
||||||
|
|||||||
@@ -109,6 +109,15 @@
|
|||||||
"keep_drop_here": "Garder",
|
"keep_drop_here": "Garder",
|
||||||
"bt_validate": "Finaliser cette étape"
|
"bt_validate": "Finaliser cette étape"
|
||||||
},
|
},
|
||||||
|
"gm_toolbox": {
|
||||||
|
"title": "GM ToolBox",
|
||||||
|
"difficulty_hidden": "Modifier la visibilité de la difficulté",
|
||||||
|
"difficulty": "Modifier la difficulté (droite: ajout, gauche: soustraction, milieu: ND 2)",
|
||||||
|
"clear_conflict": "Enlever tous les points de conflit des personnages",
|
||||||
|
"clear_conflict_info": "Les personnages sont maintenant plus serins",
|
||||||
|
"starting_void_point": "Réinitialiser les points du vide à leurs moitié",
|
||||||
|
"starting_void_point_info": "Tous les points du vide ont été réinitialisés"
|
||||||
|
},
|
||||||
"max": "Max",
|
"max": "Max",
|
||||||
"current": "Actuel",
|
"current": "Actuel",
|
||||||
"quantity": "Quantité",
|
"quantity": "Quantité",
|
||||||
|
|||||||
@@ -19,11 +19,8 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
id: "l5r5e-gm-tools-dialog",
|
id: "l5r5e-gm-tools-dialog",
|
||||||
classes: ["l5r5e", "gm-tools-dialog"],
|
classes: ["l5r5e", "gm-tools-dialog"],
|
||||||
template: CONFIG.l5r5e.paths.templates + "dice/gm-tools-dialog.html",
|
template: CONFIG.l5r5e.paths.templates + "dice/gm-tools-dialog.html",
|
||||||
title: game.i18n.localize("l5r5e.dicepicker.difficulty_title"),
|
title: game.i18n.localize("l5r5e.gm_toolbox.title"),
|
||||||
width: 200, // ignored under 200px
|
left: x - 540,
|
||||||
height: 130, // ignored under 50px
|
|
||||||
scale: 0.5, // so scale /2 :D
|
|
||||||
left: x - 470,
|
|
||||||
top: y - 94,
|
top: y - 94,
|
||||||
closeOnSubmit: false,
|
closeOnSubmit: false,
|
||||||
submitOnClose: false,
|
submitOnClose: false,
|
||||||
@@ -67,6 +64,8 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
if (!game.user.isGM) {
|
if (!game.user.isGM) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
this.position.width = "auto";
|
||||||
|
this.position.height = "auto";
|
||||||
return super.render(force, options);
|
return super.render(force, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +103,8 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
|
|
||||||
// Modify difficulty hidden
|
// Modify difficulty hidden
|
||||||
html.find(`.difficulty_hidden`).on("click", (event) => {
|
html.find(`.difficulty_hidden`).on("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
this.object.difficultyHidden = !this.object.difficultyHidden;
|
this.object.difficultyHidden = !this.object.difficultyHidden;
|
||||||
game.settings
|
game.settings
|
||||||
.set("l5r5e", "initiative.difficulty.hidden", this.object.difficultyHidden)
|
.set("l5r5e", "initiative.difficulty.hidden", this.object.difficultyHidden)
|
||||||
@@ -130,6 +131,13 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
}
|
}
|
||||||
game.settings.set("l5r5e", "initiative.difficulty.value", this.object.difficulty).then(() => this.submit());
|
game.settings.set("l5r5e", "initiative.difficulty.value", this.object.difficulty).then(() => this.submit());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Halve max void points & Clear conflict
|
||||||
|
html.find(`.gm_actor_updates`).on("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
this._updatesActors($(event.currentTarget).data("type"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -151,4 +159,41 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
|
|
||||||
this.render(false);
|
this.render(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update all actors
|
||||||
|
* @param {string} type
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_updatesActors(type) {
|
||||||
|
if (!game.user.isGM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
game.actors.entities.forEach((actor) => {
|
||||||
|
switch (type) {
|
||||||
|
case "starting_void_point":
|
||||||
|
// Starting void points : Max Void point / 2 rounded up for all actors
|
||||||
|
actor.data.data.void_points.value = Math.ceil(actor.data.data.void_points.max / 2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "clear_conflict":
|
||||||
|
// Clear all actor conflict
|
||||||
|
actor.data.data.strife.value = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
actor.update({
|
||||||
|
data: {
|
||||||
|
void_points: {
|
||||||
|
value: actor.data.data.void_points.value,
|
||||||
|
},
|
||||||
|
strife: {
|
||||||
|
value: actor.data.data.strife.value,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.notifications.info(game.i18n.localize(`l5r5e.gm_toolbox.${type}_info`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ export class RollnKeepDialog extends FormApplication {
|
|||||||
classes: ["l5r5e", "roll-n-keep-dialog"],
|
classes: ["l5r5e", "roll-n-keep-dialog"],
|
||||||
template: CONFIG.l5r5e.paths.templates + "dice/roll-n-keep-dialog.html",
|
template: CONFIG.l5r5e.paths.templates + "dice/roll-n-keep-dialog.html",
|
||||||
title: game.i18n.localize("l5r5e.roll_n_keep.title"),
|
title: game.i18n.localize("l5r5e.roll_n_keep.title"),
|
||||||
width: 660,
|
|
||||||
height: 454,
|
|
||||||
closeOnSubmit: false,
|
closeOnSubmit: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -104,6 +102,8 @@ export class RollnKeepDialog extends FormApplication {
|
|||||||
if (!this.message) {
|
if (!this.message) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.position.width = "auto";
|
||||||
|
this.position.height = "auto";
|
||||||
return super.render(force, options);
|
return super.render(force, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -199,8 +199,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#l5r5e-gm-tools-dialog {
|
#l5r5e-gm-tools-dialog {
|
||||||
bottom: 0;
|
//bottom: 0;
|
||||||
right: 0.5rem;
|
//right: 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<form class="l5r5e gm-tools-dialog" autocomplete="off">
|
<form class="l5r5e gm-tools-dialog" autocomplete="off">
|
||||||
<p class="gm-tools-container">
|
<p class="gm-tools-container">
|
||||||
<a class="difficulty_hidden"><i class="fa fa-eye{{#if data.difficultyHidden}}-slash{{/if}}"></i></a>
|
<a class="difficulty_hidden" title="{{localize 'l5r5e.gm_toolbox.difficulty_hidden'}}"><i class="fa fa-eye{{#if data.difficultyHidden}}-slash{{/if}}"></i></a>
|
||||||
<strong class="difficulty">{{data.difficulty}}</strong>
|
<strong class="difficulty" title="{{localize 'l5r5e.gm_toolbox.difficulty'}}">{{data.difficulty}}</strong>
|
||||||
|
<a class="gm_actor_updates clear_conflict" data-type="clear_conflict" title="{{localize 'l5r5e.gm_toolbox.clear_conflict'}}"><i class="fa fa-bed"></i></a>
|
||||||
|
<a class="gm_actor_updates starting_void_point" data-type="starting_void_point" title="{{localize 'l5r5e.gm_toolbox.starting_void_point'}}"><i class="fas fa-star-half-alt"></i></a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user