ENH: Weapon quality icons

master
U~man 2020-07-17 13:17:43 +02:00
parent e4e2bfd042
commit fd8b564c9a
15 changed files with 44 additions and 17 deletions

BIN
src/assets/blunt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
src/assets/brace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
src/assets/charge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src/assets/reload.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
src/assets/slow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
src/assets/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

@ -188,9 +188,6 @@
"OSE.items.RollTarget": "Target",
"OSE.items.RollType": "Type",
"OSE.items.Damage": "Damage",
"OSE.items.Melee": "Melee",
"OSE.items.Missile": "Missile",
"OSE.items.Slow": "Slow",
"OSE.items.ArmorAC": "AC",
"OSE.items.ArmorAAC": "AAC",
"OSE.items.Bonus": "Bonus",
@ -201,6 +198,16 @@
"OSE.items.typeTag": "Type a comma separated list of tag e.g 'Melee,Missile (510 / 1120 / 2130)'",
"OSE.items.pattern": "Attack pattern marker",
"OSE.items.Melee": "Melee",
"OSE.items.Missile": "Missile",
"OSE.items.Slow": "Slow",
"OSE.items.TwoHanded": "Two-handed",
"OSE.items.Blunt": "Blunt",
"OSE.items.Brace": "Brace",
"OSE.items.Splash": "Splash weapon",
"OSE.items.Reload": "Reload",
"OSE.items.Charge": "Charge",
"OSE.armor.type": "Armor Type",
"OSE.armor.unarmored": "Unarmored",
"OSE.armor.light": "Light",

View File

@ -70,17 +70,22 @@ export const OSE = {
melee: "OSE.items.Melee",
missile: "OSE.items.Missile",
slow: "OSE.items.Slow",
blunt: "OSE.items.Blunt",
reload: "OSE.items.Reload",
splash: "OSE.items.Splash",
brace: "OSE.items.Brace",
twohanded: "OSE.items.TwoHanded",
blunt: "OSE.items.Blunt",
brace: "OSE.items.Brace",
splash: "OSE.items.Splash",
reload: "OSE.items.Reload",
charge: "OSE.items.Charge",
},
tag_images: {
melee: "/systems/ose/assets/melee.png",
missile: "/systems/ose/assets/missile.png",
slow: "<i class='fas fa-snail'></i>",
slow: "/systems/ose/assets/slow.png",
twohanded: "/systems/ose/assets/twohanded.png",
blunt: "/systems/ose/assets/blunt.png",
brace: "/systems/ose/assets/brace.png",
splash: "/systems/ose/assets/splash.png",
reload: "/systems/ose/assets/reload.png",
charge: "/systems/ose/assets/charge.png",
}
};
// fa-sign-language

View File

@ -38,6 +38,11 @@ export const registerHelpers = async function () {
return Math.round(parseFloat(weight) / 100) / 10;
});
Handlebars.registerHelper("getTagIcon", function (tag) {
let idx = Object.keys(CONFIG.OSE.tags).find(k => (CONFIG.OSE.tags[k] == tag));
return CONFIG.OSE.tag_images[idx];
});
Handlebars.registerHelper("counter", function (status, value, max) {
return status
? Math.clamped((100.0 * value) / max, 0, 100)

View File

@ -190,8 +190,9 @@ export class OseItem extends Item {
let title = "";
if (matches) {
title = matches[1];
val = val.substring(0, matches.index);
val = val.substring(0, matches.index).trim();
} else {
val = val.trim();
title = val;
}
// Auto fill checkboxes

View File

@ -290,6 +290,11 @@
img {
border: none;
margin: 3px 1px;
flex: 0 0 24px;
}
span {
font-size: 12px;
flex-grow: 0;
}
}
.field-flex {

View File

@ -3,7 +3,7 @@
<li class="item-titles flexrow">
<div class="item-caret"><i class="fas fa-caret-down"></i></div>
<div class="item-name">{{localize "OSE.items.Weapons"}}</div>
<div class="field-longer">{{localize "OSE.items.Qualities"}}</div>
<div class="icon-row">{{localize "OSE.items.Qualities"}}</div>
<div class="field-short"><i class="fas fa-weight-hanging"></i></div>
<div class="item-controls">
<a class="item-control item-create" data-type="weapon" title="{{localize 'OSE.Add'}}"><i
@ -22,14 +22,18 @@
</h4>
</a>
</div>
<div class="icon-row field-longer">
<div class="icon-row flexrow">
{{#each item.data.tags as |tag|}}
{{#if (lookup @root.config.tag_images tag.value)}}
<img title="{{tag.title}}" src="{{lookup @root.config.tag_images tag.value}}" width="24" height="24"/>
{{else}}
<span title="{{tag.title}}">{{tag.value}}</span>
{{#if (getTagIcon tag.value)}}
<img title="{{tag.title}}" src="{{getTagIcon tag.value}}" width="24" height="24"/>
{{/if}}
{{/each}}
{{#each item.data.tags as |tag|}}
{{#unless (getTagIcon tag.value)}}
<span title="{{tag.title}}">{{tag.value}}{{#unless @last}},{{/unless}}</span>
{{/unless}}
{{/each}}
</div>
<div class="field-short">
{{#if @root.config.encumbranceBasic}}_{{else}}{{item.data.weight}}{{/if}}