reverse token is now a drop-down, and some clean up

This commit is contained in:
Vlyan
2024-08-07 09:30:09 +02:00
parent 0a1a74c84b
commit 7a2587083b
9 changed files with 63 additions and 17 deletions

View File

@@ -6,6 +6,9 @@ Date format : day/month/year
> - `foundry-version`: Stick to the major version of FoundryVTT. > - `foundry-version`: Stick to the major version of FoundryVTT.
> - `system-version`: System functionalities and Fixes. > - `system-version`: System functionalities and Fixes.
## 1.12.2 - ??/08/2024 - ???
- Modified : The checkbox "reverseFatigueBar" is now a drop-down with `none`/`fatigue`/`strife`/`both`, and is now an client preference.
## 1.12.1 - 19/06/2024 - Compendium update (mostly french) ## 1.12.1 - 19/06/2024 - Compendium update (mostly french)
- Updated the names and pages number from the official French translation of `Celestial Realms` and `Fields of Victory`. - Updated the names and pages number from the official French translation of `Celestial Realms` and `Fields of Victory`.
- Added some missing from `Celestial Realms` and `Celestial Realms - Deathly Turns`: - Added some missing from `Celestial Realms` and `Celestial Realms - Deathly Turns`:

View File

@@ -5,7 +5,14 @@
}, },
"SETTINGS": { "SETTINGS": {
"None": "No option", "None": "No option",
"ReverseFatigueBar": "Reverse token fatigue bar", "ReverseTokenBars": {
"Title": "Reverse tokens bar",
"Hint": "Change the order in which the bars under the tokens are filled in",
"None": "None",
"Fatigue": "Fatigue only",
"Strife": "Strife",
"Both": "Both Fatigue and Strife"
},
"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"

View File

@@ -5,7 +5,14 @@
}, },
"SETTINGS": { "SETTINGS": {
"None": "Sin opción", "None": "Sin opción",
"ReverseFatigueBar": "Invertir la barra de fatiga de los token", "ReverseTokenBars": {
"Title": "Reverse tokens bar",
"Hint": "Change the order in which the bars under the tokens are filled in",
"None": "None",
"Fatigue": "Fatigue only",
"Strife": "Strife",
"Both": "Both Fatigue and Strife"
},
"RollNKeep": { "RollNKeep": {
"DeleteOldMessage": "TyG Eliminar el mensaje anterior del chat", "DeleteOldMessage": "TyG Eliminar el mensaje anterior del chat",
"DeleteOldMessageHint": "Elige si mantener o borrar el mensaje anterior de la serie TyG" "DeleteOldMessageHint": "Elige si mantener o borrar el mensaje anterior de la serie TyG"
@@ -22,6 +29,10 @@
"Title": "Custom Compendium Name", "Title": "Custom Compendium Name",
"Hint": "For advanced users that want to change the name of the custom compendiums (Used to disables the embedded ones).", "Hint": "For advanced users that want to change the name of the custom compendiums (Used to disables the embedded ones).",
"Notification": "Unable set Custom Compendium: '{name}'. Is it activated and registered with Babele?" "Notification": "Unable set Custom Compendium: '{name}'. Is it activated and registered with Babele?"
},
"CustomItemsHeight": {
"Title": "Default items windows height",
"Hint": "Set the default height for 'Items' windows types (techniques, weapons...), in pixels"
} }
}, },
"TYPES": { "TYPES": {

View File

@@ -5,7 +5,14 @@
}, },
"SETTINGS": { "SETTINGS": {
"None": "Aucune option", "None": "Aucune option",
"ReverseFatigueBar": "Inverser la barre de fatigue des token", "ReverseTokenBars": {
"Title": "Inverser la barre des tokens",
"Hint": "Change l'ordre de remplissage des barres sous les tokens",
"None": "Aucun",
"Fatigue": "Fatigue uniquement",
"Strife": "Conflit uniquement",
"Both": "Les deux (Fatigue et Conflit)"
},
"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"

View File

@@ -5,7 +5,14 @@
}, },
"SETTINGS": { "SETTINGS": {
"None": "Niente", "None": "Niente",
"ReverseFatigueBar": "Inverti barra della Stanchezza", "ReverseTokenBars": {
"Title": "Reverse tokens bar",
"Hint": "Change the order in which the bars under the tokens are filled in",
"None": "None",
"Fatigue": "Fatigue only",
"Strife": "Strife",
"Both": "Both Fatigue and Strife"
},
"RollNKeep": { "RollNKeep": {
"DeleteOldMessage": "Il Tira e Tieni cancella il messaggio in chat precedente", "DeleteOldMessage": "Il Tira e Tieni cancella il messaggio in chat precedente",
"DeleteOldMessageHint": "Scegli se mantenere o eliminare il messaggio precedente in una serie di Tira e Tieni" "DeleteOldMessageHint": "Scegli se mantenere o eliminare il messaggio precedente in una serie di Tira e Tieni"
@@ -22,6 +29,10 @@
"Title": "Custom Compendium Name", "Title": "Custom Compendium Name",
"Hint": "For advanced users that want to change the name of the custom compendiums (Used to disables the embedded ones).", "Hint": "For advanced users that want to change the name of the custom compendiums (Used to disables the embedded ones).",
"Notification": "Unable set Custom Compendium: '{name}'. Is it activated and registered with Babele?" "Notification": "Unable set Custom Compendium: '{name}'. Is it activated and registered with Babele?"
},
"CustomItemsHeight": {
"Title": "Default items windows height",
"Hint": "Set the default height for 'Items' windows types (techniques, weapons...), in pixels"
} }
}, },
"TYPES": { "TYPES": {

View File

@@ -1,11 +1,11 @@
/** /**
* L5R5e Base Die * L5R5e Base Die
*/ */
export class L5rBaseDie extends DiceTerm { export class L5rBaseDie extends foundry.dice.terms.DiceTerm {
/** Need to be override */ /** Need to be overridden */
static DENOMINATION = ""; static DENOMINATION = "";
/** Need to be override */ /** Need to be overridden */
static FACES = {}; static FACES = {};
/** @override */ /** @override */

View File

@@ -208,7 +208,8 @@ Hooks.once("init", async () => {
// Override the default Token _drawBar function to allow fatigue bar reversing. // Override the default Token _drawBar function to allow fatigue bar reversing.
Token.prototype._drawBar = function (number, bar, data) { Token.prototype._drawBar = function (number, bar, data) {
const reverseBar = data.attribute === "fatigue" && game.settings.get(L5R5E.namespace, "token-reverseFatigueBar"); const barSettings = game.settings.get(L5R5E.namespace, "token-reverse-token-bars");
const reverseBar = barSettings === 'both' || barSettings === data.attribute;
// Bar value // Bar value
const pct = Math.clamp(Number(data.value), 0, data.max) / data.max; const pct = Math.clamp(Number(data.value), 0, data.max) / data.max;

View File

@@ -23,13 +23,6 @@ export const RegisterSettings = function () {
type: Boolean, type: Boolean,
default: true, default: true,
}); });
game.settings.register(CONFIG.l5r5e.namespace, "token-reverseFatigueBar", {
name: "SETTINGS.ReverseFatigueBar",
scope: "world",
config: true,
type: Boolean,
default: false,
});
game.settings.register(CONFIG.l5r5e.namespace, "techniques-customs", { game.settings.register(CONFIG.l5r5e.namespace, "techniques-customs", {
name: "SETTINGS.CustomTechniques.Title", name: "SETTINGS.CustomTechniques.Title",
hint: "SETTINGS.CustomTechniques.Hint", hint: "SETTINGS.CustomTechniques.Hint",
@@ -47,7 +40,7 @@ export const RegisterSettings = function () {
type: String, type: String,
default: "l5r5e-custom-compendiums", default: "l5r5e-custom-compendiums",
onChange: (name) => { onChange: (name) => {
if (!Babele.get().modules.find((module) => module.module === name)) { if (game.babele && !game.babele.modules.find((module) => module.module === name)) {
ui.notifications.warn(game.i18n.format("SETTINGS.CustomCompendiumName.Notification", { name }), { permanent: true }); ui.notifications.warn(game.i18n.format("SETTINGS.CustomCompendiumName.Notification", { name }), { permanent: true });
} }
} }
@@ -70,6 +63,20 @@ export const RegisterSettings = function () {
}, },
default: 800, default: 800,
}); });
game.settings.register(CONFIG.l5r5e.namespace, "token-reverse-token-bars", {
name: "SETTINGS.ReverseTokenBars.Title",
hint: "SETTINGS.ReverseTokenBars.Hint",
scope: "client",
config: true,
default: "none",
choices: {
"none": "SETTINGS.ReverseTokenBars.None",
"fatigue": "SETTINGS.ReverseTokenBars.Fatigue",
"strife": "SETTINGS.ReverseTokenBars.Strife",
"both": "SETTINGS.ReverseTokenBars.Both"
},
type: String,
});
/* ------------------------------------ */ /* ------------------------------------ */
/* Update */ /* Update */

View File

@@ -14,7 +14,6 @@
"verified": "12", "verified": "12",
"maximum": "12" "maximum": "12"
}, },
"manifestPlusVersion": "1.2.0",
"socket": true, "socket": true,
"authors": [ "authors": [
{ {