Minor fixes

This commit is contained in:
sladecraven 2022-01-08 22:48:04 +01:00
parent 2f19ba1948
commit 0f20a66cd2
6 changed files with 10 additions and 10 deletions

View File

@ -249,7 +249,6 @@ export class BoLUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static removeChatMessageId(messageId) { static removeChatMessageId(messageId) {
if (messageId){ if (messageId){
game.messages.get(messageId)?.delete(); game.messages.get(messageId)?.delete();

View File

@ -4,6 +4,10 @@ export const registerHandlebarsHelpers = function () {
return val == null; return val == null;
}); });
Handlebars.registerHelper('exists', function (val) {
return val != null && val != undefined;
});
Handlebars.registerHelper('isEmpty', function (list) { Handlebars.registerHelper('isEmpty', function (list) {
if (list) return list.length == 0; if (list) return list.length == 0;
else return 0; else return 0;

View File

@ -7,8 +7,8 @@
"url": "https://github.com/ZigmundKreud/bol", "url": "https://github.com/ZigmundKreud/bol",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"flags": {}, "flags": {},
"version": "0.8.9.2", "version": "0.8.9.4",
"templateVersion": 10, "templateVersion": 13,
"minimumCoreVersion": "0.8.6", "minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "9", "compatibleCoreVersion": "9",
"scripts": [], "scripts": [],

View File

@ -109,6 +109,7 @@
"key": "power", "key": "power",
"label": "BOL.resources.power", "label": "BOL.resources.power",
"value": 0, "value": 0,
"bonus": 0,
"max": 0 "max": 0
} }
} }

View File

@ -1,10 +1,3 @@
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-name flex2">{{localize "BOL.ui.maneuvers"}}</div>
</li>
<li class="item flexrow"><div class="item-image roll-weapon"><img src="icons/skills/melee/unarmed-punch-fist.webp" title="Attaque à mains nues"/></div><h4 class="item-name flex2"><a class="item-edit">Attaque à mains nues</a></h4></li>
</ol>
{{#each combat as |combatType id|}} {{#each combat as |combatType id|}}
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">

View File

@ -27,6 +27,9 @@
<div class="resource stat flex1 flex-group-center"> <div class="resource stat flex1 flex-group-center">
<label class="stat-label">{{localize label}}</label><br/> <label class="stat-label">{{localize label}}</label><br/>
<input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/> <input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/>
{{#if (exists bonus)}}
<span class="flexrow"><label class="stat-max">Bonus:</label><input class="stat-max" type="text" name="data.resources.{{key}}.bonus" value="{{numberFormat bonus decimals=0 sign=false}}" data-dtype="Number"/></span>
{{/if}}
<input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/> <input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/>
</div> </div>
{{/each}} {{/each}}