Add an option to set the TN to 1 when the encounter type is selected (Intrigue, Duel, Skirmish or Mass battle)
This commit is contained in:
@@ -18,9 +18,12 @@
|
|||||||
- Added a booster for loading compendium's core items (speed up 20Q)
|
- Added a booster for loading compendium's core items (speed up 20Q)
|
||||||
- Added confirm dialog on item's deletion (Hold "ctrl" on the click, if you want to bypass it)
|
- Added confirm dialog on item's deletion (Hold "ctrl" on the click, if you want to bypass it)
|
||||||
- Added "Sleep" & "Scene End" buttons in "GM ToolBox" (old "difficulty" box)
|
- Added "Sleep" & "Scene End" buttons in "GM ToolBox" (old "difficulty" box)
|
||||||
- Added an option to reverse the token's bar on fatigue (thanks to Jzrzmy), and colorize in red the strife bar if compromise
|
- Token's bar:
|
||||||
|
- The strife bar is now displayed in red if the actor is compromised
|
||||||
|
- Added an option, off by default, to reverse the fatigue's token bar (thanks to Jzrzmy).
|
||||||
|
- Added an option, on by default, to set the TN to 1 when the encounter type is selected (Intrigue, Duel, Skirmish or Mass battle)
|
||||||
- Split Techniques & Items by category in actor sheet (pc & npc) for better readability
|
- Split Techniques & Items by category in actor sheet (pc & npc) for better readability
|
||||||
- Armor & Weapon added in the conflict tab now set the "eqquiped" props by default
|
- Armor & Weapon added in the conflict tab now set the "eqquiped" property by default
|
||||||
|
|
||||||
## 1.1.2 - One Compendium to bring them all
|
## 1.1.2 - One Compendium to bring them all
|
||||||
- Added compendiums (Thanks to Stéfano Fara for the English version !) Partial for French as PoW and CR are not translated yet
|
- Added compendiums (Thanks to Stéfano Fara for the English version !) Partial for French as PoW and CR are not translated yet
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
"RollNKeep": {
|
"RollNKeep": {
|
||||||
"DeleteOldMessage": "RnK Delete previous chat message",
|
"DeleteOldMessage": "RnK Delete previous chat message",
|
||||||
"DeleteOldMessageHint": "Choose to keep or delete the previous message for a RnK series"
|
"DeleteOldMessageHint": "Choose to keep or delete the previous message for a RnK series"
|
||||||
|
},
|
||||||
|
"Initiative": {
|
||||||
|
"SetTn1OnTypeChange": "Set TN to 1 on encounter change",
|
||||||
|
"SetTn1OnTypeChangeHint": "Set the TN to 1 when the encounter type is selected (Intrigue, Duel, Skirmish or Mass battle)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ACTOR": {
|
"ACTOR": {
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
"RollNKeep": {
|
"RollNKeep": {
|
||||||
"DeleteOldMessage": "RnK Delete previous chat message",
|
"DeleteOldMessage": "RnK Delete previous chat message",
|
||||||
"DeleteOldMessageHint": "Choose to keep or delete the previous message for a RnK series"
|
"DeleteOldMessageHint": "Choose to keep or delete the previous message for a RnK series"
|
||||||
|
},
|
||||||
|
"Initiative": {
|
||||||
|
"SetTn1OnTypeChange": "Set TN to 1 on encounter change",
|
||||||
|
"SetTn1OnTypeChangeHint": "Set the TN to 1 when the encounter type is selected (Intrigue, Duel, Skirmish or Mass battle)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ACTOR": {
|
"ACTOR": {
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
"RollNKeep": {
|
"RollNKeep": {
|
||||||
"DeleteOldMessage": "RnK Supprime le précédent message du chat",
|
"DeleteOldMessage": "RnK Supprime le précédent message du chat",
|
||||||
"DeleteOldMessageHint": "Si coché, on supprime le message précédent pour la série de jets via le RnK"
|
"DeleteOldMessageHint": "Si coché, on supprime le message précédent pour la série de jets via le RnK"
|
||||||
|
},
|
||||||
|
"Initiative": {
|
||||||
|
"SetTn1OnTypeChange": "ND 1 à la sélection du type de rencontre",
|
||||||
|
"SetTn1OnTypeChangeHint": "Met le ND à 1 lorsqu'on modifie le type de rencontre (Intrigue, Duel, Escarmouche ou Bataille rangée)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ACTOR": {
|
"ACTOR": {
|
||||||
|
|||||||
@@ -34,6 +34,25 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
*/
|
*/
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
super(options);
|
super(options);
|
||||||
|
this._initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refresh data (used from socket)
|
||||||
|
*/
|
||||||
|
async refresh() {
|
||||||
|
if (!game.user.isGM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._initialize();
|
||||||
|
this.render(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the values
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_initialize() {
|
||||||
this.object = {
|
this.object = {
|
||||||
difficulty: game.settings.get("l5r5e", "initiative.difficulty.value"),
|
difficulty: game.settings.get("l5r5e", "initiative.difficulty.value"),
|
||||||
difficultyHidden: game.settings.get("l5r5e", "initiative.difficulty.hidden"),
|
difficultyHidden: game.settings.get("l5r5e", "initiative.difficulty.hidden"),
|
||||||
@@ -148,15 +167,6 @@ export class GmToolsDialog extends FormApplication {
|
|||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
async _updateObject(event, formData) {
|
async _updateObject(event, formData) {
|
||||||
// Notify the change to other players if they already have opened the DicePicker
|
|
||||||
game.l5r5e.sockets.refreshAppId("l5r5e-dice-picker-dialog");
|
|
||||||
|
|
||||||
// If the current GM also have the DP open
|
|
||||||
const app = Object.values(ui.windows).find((e) => e.id === "l5r5e-dice-picker-dialog");
|
|
||||||
if (app && typeof app.refresh === "function") {
|
|
||||||
app.refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.render(false);
|
this.render(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,4 +238,16 @@ export class HelpersL5r5e {
|
|||||||
},
|
},
|
||||||
}).render(true);
|
}).render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify Applications using Difficulty settings that the values was changed
|
||||||
|
*/
|
||||||
|
static notifyDifficultyChange() {
|
||||||
|
["l5r5e-dice-picker-dialog", "l5r5e-gm-tools-dialog"].forEach((appId) => {
|
||||||
|
const app = Object.values(ui.windows).find((e) => e.id === appId);
|
||||||
|
if (app && typeof app.refresh === "function") {
|
||||||
|
app.refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,24 +125,17 @@ export default class HooksL5r5e {
|
|||||||
html.find(".prepared-control").on("click", (event) => {
|
html.find(".prepared-control").on("click", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
let preparedId = $(event.currentTarget).data("id");
|
const preparedId = $(event.currentTarget).data("id");
|
||||||
if (!Object.hasOwnProperty.call(prepared, preparedId)) {
|
if (!Object.hasOwnProperty.call(prepared, preparedId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let value = prepared[preparedId];
|
const nextValue = {
|
||||||
switch (value) {
|
false: "true",
|
||||||
case "false":
|
true: "null",
|
||||||
value = "true";
|
null: "false",
|
||||||
break;
|
};
|
||||||
case "true":
|
|
||||||
value = "null";
|
|
||||||
break;
|
|
||||||
case "null":
|
|
||||||
value = "false";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
game.settings
|
game.settings
|
||||||
.set("l5r5e", `initiative.prepared.${preparedId}`, value)
|
.set("l5r5e", `initiative.prepared.${preparedId}`, nextValue[prepared[preparedId]])
|
||||||
.then(() => HooksL5r5e._gmCombatBar(app, html, data));
|
.then(() => HooksL5r5e._gmCombatBar(app, html, data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,21 @@ export const RegisterSettings = function () {
|
|||||||
default: true,
|
default: true,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
});
|
});
|
||||||
|
game.settings.register("l5r5e", "initiative.setTn1OnTypeChange", {
|
||||||
|
name: "SETTINGS.Initiative.SetTn1OnTypeChange",
|
||||||
|
hint: "SETTINGS.Initiative.SetTn1OnTypeChangeHint",
|
||||||
|
scope: "world",
|
||||||
|
config: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
});
|
||||||
|
game.settings.register("l5r5e", "token.reverseFatigueBar", {
|
||||||
|
name: "SETTINGS.ReverseFatigueBar",
|
||||||
|
scope: "world",
|
||||||
|
config: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
/* ------------------------------------ */
|
/* ------------------------------------ */
|
||||||
/* Update */
|
/* Update */
|
||||||
@@ -34,6 +49,7 @@ export const RegisterSettings = function () {
|
|||||||
config: false,
|
config: false,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(),
|
||||||
});
|
});
|
||||||
game.settings.register("l5r5e", "initiative.difficulty.value", {
|
game.settings.register("l5r5e", "initiative.difficulty.value", {
|
||||||
name: "Initiative difficulty value",
|
name: "Initiative difficulty value",
|
||||||
@@ -41,6 +57,7 @@ export const RegisterSettings = function () {
|
|||||||
config: false,
|
config: false,
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 2,
|
default: 2,
|
||||||
|
onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(),
|
||||||
});
|
});
|
||||||
game.settings.register("l5r5e", "initiative.encounter", {
|
game.settings.register("l5r5e", "initiative.encounter", {
|
||||||
name: "Initiative encounter type",
|
name: "Initiative encounter type",
|
||||||
@@ -48,6 +65,11 @@ export const RegisterSettings = function () {
|
|||||||
config: false,
|
config: false,
|
||||||
type: String,
|
type: String,
|
||||||
default: "skirmish",
|
default: "skirmish",
|
||||||
|
onChange: () => {
|
||||||
|
if (game.settings.get("l5r5e", "initiative.setTn1OnTypeChange")) {
|
||||||
|
game.settings.set("l5r5e", "initiative.difficulty.value", 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
game.settings.register("l5r5e", "initiative.prepared.character", {
|
game.settings.register("l5r5e", "initiative.prepared.character", {
|
||||||
name: "Initiative PC prepared or not",
|
name: "Initiative PC prepared or not",
|
||||||
@@ -70,15 +92,4 @@ export const RegisterSettings = function () {
|
|||||||
type: String,
|
type: String,
|
||||||
default: "null",
|
default: "null",
|
||||||
});
|
});
|
||||||
|
|
||||||
/* ------------------------------------ */
|
|
||||||
/* Token bars */
|
|
||||||
/* ------------------------------------ */
|
|
||||||
game.settings.register("l5r5e", "token.reverseFatigueBar", {
|
|
||||||
name: game.i18n.localize("SETTINGS.ReverseFatigueBar"),
|
|
||||||
scope: "world",
|
|
||||||
config: true,
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user