From c9c282b3ad0b9b2730ed4efab9bc8b6a2cd22ba0 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Sat, 12 Dec 2020 13:22:49 +0100 Subject: [PATCH] modified stance internal usage checkboxes->radio --- system/lang/fr-fr.json | 2 +- system/scripts/main-l5r5e.js | 13 +++++++++---- system/scripts/preloadTemplates.js | 2 +- system/styles/scss/ui.scss | 3 +++ system/template.json | 18 +----------------- .../{adquisition.html => acquisition.html} | 0 system/templates/sheets/actor/conflict.html | 6 +++--- system/templates/sheets/actor/stance.html | 6 +++--- 8 files changed, 21 insertions(+), 29 deletions(-) rename system/templates/sheets/actor/{adquisition.html => acquisition.html} (100%) diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 0d1239b..408c158 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -174,7 +174,7 @@ "focustip": "Air + Feu", "vigilante": "Vigilance", "vigilantetip": "(Air + Eau) /2", - "voidPoints": "Points de Vide", + "voidpoints": "Points de Vide", "fatigue": "Fatigue", "strife": "Conflit" }, diff --git a/system/scripts/main-l5r5e.js b/system/scripts/main-l5r5e.js index c90fa61..49f80f0 100644 --- a/system/scripts/main-l5r5e.js +++ b/system/scripts/main-l5r5e.js @@ -61,8 +61,9 @@ Hooks.once("init", async function () { Items.registerSheet("l5r5e", FeatSheetL5r5e, { types: ["feat"], makeDefault: true }); // for debug - Handlebars.registerHelper("json", function (object) { - return new Handlebars.SafeString(JSON.stringify(object)); + Handlebars.registerHelper("json", function (...objects) { + objects.pop(); // remove this function call + return new Handlebars.SafeString(objects.map((e) => ``)); }); Handlebars.registerHelper("localizeSkillCategory", function (skillName) { @@ -70,6 +71,11 @@ Hooks.once("init", async function () { return game.i18n.localize(key); }); + // Add props "checked" if a and b are equal ({{radioChecked a b}} + Handlebars.registerHelper("radioChecked", function (a, b) { + return a === b ? new Handlebars.SafeString('checked="checked"') : ""; + }); + Handlebars.registerHelper("localizeSkill", function (skillCategory, skillName) { const key = "l5r5e.skills." + skillCategory.toLowerCase() + "." + skillName.toLowerCase(); return game.i18n.localize(key); @@ -115,7 +121,7 @@ Hooks.once("setup", function () { Hooks.once("ready", function () { // Do anything once the system is ready // Add title on button dice icon - $.find(".chat-control-icon")[0].title = game.i18n.localize("l5r5e.chatdices.dicepicker"); + $(".chat-control-icon")[0].title = game.i18n.localize("l5r5e.chatdices.dicepicker"); }); /* ------------------------------------ */ @@ -175,7 +181,6 @@ Hooks.once("diceSoNiceReady", (dice3d) => { }); // Logo & Menu options - Hooks.once("ready", async function () { // -- Function Open Edge-Studio Website function openEdge() { diff --git a/system/scripts/preloadTemplates.js b/system/scripts/preloadTemplates.js index f0ef11a..56ad80a 100644 --- a/system/scripts/preloadTemplates.js +++ b/system/scripts/preloadTemplates.js @@ -12,7 +12,7 @@ export const PreloadTemplates = async function () { "systems/l5r5e/templates/sheets/actor/stance.html", "systems/l5r5e/templates/sheets/actor/feats.html", "systems/l5r5e/templates/sheets/actor/experience.html", - "systems/l5r5e/templates/sheets/actor/adquisition.html", + "systems/l5r5e/templates/sheets/actor/acquisition.html", // items "systems/l5r5e/templates/item/weapon-sheet.html", "systems/l5r5e/templates/item/items.html", diff --git a/system/styles/scss/ui.scss b/system/styles/scss/ui.scss index 46962ef..37e0e86 100644 --- a/system/styles/scss/ui.scss +++ b/system/styles/scss/ui.scss @@ -54,6 +54,9 @@ button { } } .sidebar-tab { + .chat-control-icon { + cursor: url("../l5r-ui/ui/cursors/pointer.webp"), pointer; + } .action-buttons button { cursor: default; color: $white; diff --git a/system/template.json b/system/template.json index 340da90..e50bf17 100644 --- a/system/template.json +++ b/system/template.json @@ -77,23 +77,7 @@ }, "fatigue": 0, "strife": 0, - "stances": { - "air": { - "isSelected": false - }, - "earth": { - "isSelected": false - }, - "fire": { - "isSelected": false - }, - "water": { - "isSelected": false - }, - "void": { - "isSelected": false - } - } + "stance": "air" }, "xp": { "xp_total": 0, diff --git a/system/templates/sheets/actor/adquisition.html b/system/templates/sheets/actor/acquisition.html similarity index 100% rename from system/templates/sheets/actor/adquisition.html rename to system/templates/sheets/actor/acquisition.html diff --git a/system/templates/sheets/actor/conflict.html b/system/templates/sheets/actor/conflict.html index c3379f4..e586a7e 100644 --- a/system/templates/sheets/actor/conflict.html +++ b/system/templates/sheets/actor/conflict.html @@ -2,10 +2,10 @@

{{ localize 'l5r5e.conflict.stance' }}

- {{#each data.stances as |stance stanceId|}} - {{> 'systems/l5r5e/templates/sheets/actor/stance.html' stance=stance stanceId=stanceId }} + {{#each data.rings as |ringValue ringId|}} + {{> 'systems/l5r5e/templates/sheets/actor/stance.html' stance=../data.stance ringId=ringId }} {{/each}}
{{> 'systems/l5r5e/templates/item/weapons.html' }}
- \ No newline at end of file + diff --git a/system/templates/sheets/actor/stance.html b/system/templates/sheets/actor/stance.html index 6f8e83f..b17f5b2 100644 --- a/system/templates/sheets/actor/stance.html +++ b/system/templates/sheets/actor/stance.html @@ -1,5 +1,5 @@
- - -

{{ localizeStanceTip stanceId }}

+ + +

{{ localizeStanceTip ringId }}

\ No newline at end of file