modified stance internal usage checkboxes->radio
This commit is contained in:
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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) => `<textarea>${JSON.stringify(e)}</textarea>`));
|
||||
});
|
||||
|
||||
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() {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<div class="conflict-top-content">
|
||||
<div class="conflict-stances-content">
|
||||
<h4 class="section-header">{{ localize 'l5r5e.conflict.stance' }}</h4>
|
||||
{{#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}}
|
||||
</div>
|
||||
{{> 'systems/l5r5e/templates/item/weapons.html' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="stance-content">
|
||||
<input type="checkbox" name="data.stances.{{stanceId}}.isSelected.value" {{ checked stance.isSelected.value }}/>
|
||||
<label class="stance-title {{stanceId}}">{{ localizeRing stanceId }}</label>
|
||||
<p class="quick-rules" style="display: inline;"> {{ localizeStanceTip stanceId }}</p>
|
||||
<input id="stance_{{ringId}}" type="radio" name="data.stance" value="{{ringId}}" {{radioChecked ringId stance}}/>
|
||||
<label for="stance_{{ringId}}" class="stance-title {{ringId}}">{{ localizeRing ringId }}</label>
|
||||
<p class="quick-rules" style="display: inline;"> {{ localizeStanceTip ringId }}</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user