Merge branch '004_equipment_tracking' into 'master'

Icons and abbreviations in items list

See merge request dungeonslayers/ds4!8
This commit is contained in:
Johannes Loher 2020-12-30 14:50:36 +01:00
commit 589a3c87ce
8 changed files with 114 additions and 50 deletions

BIN
src/assets/DS4-MAT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/DS4-MRA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/DS4-RAT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -38,12 +38,21 @@
"DS4.ArmorValue": "Armor Value",
"DS4.ArmorValueAbbr": "AV",
"DS4.ArmorTypeBody": "Body",
"DS4.ArmorTypeBodyAbbr": "Body",
"DS4.ArmorTypeHelmet": "Helmet",
"DS4.ArmorTypeHelmetAbbr": "Helm",
"DS4.ArmorTypeVambrace": "Vambrace",
"DS4.ArmorTypeVambraceAbbr": "Vambr",
"DS4.ArmorTypeGreaves": "Greaves",
"DS4.ArmorTypeGreavesAbbr": "Greav",
"DS4.ArmorTypeVambraceGreaves": "Vambrace + Greaves",
"DS4.ArmorTypeVambraceGreavesAbbr": "V+G",
"DS4.ArmorMaterialTypeCloth": "Cloth",
"DS4.ArmorMaterialTypeClothAbbr": "Cloth",
"DS4.ArmorMaterialTypeLeather": "Leather",
"DS4.ArmorMaterialTypeLeatherAbbr": "Leath",
"DS4.ArmorMaterialTypeChain": "Chain",
"DS4.ArmorMaterialTypePlate": "Plate"
"DS4.ArmorMaterialTypeChainAbbr": "Chain",
"DS4.ArmorMaterialTypePlate": "Plate",
"DS4.ArmorMaterialTypePlateAbbr": "Plate"
}

View file

@ -18,6 +18,16 @@ export const DS4 = {
meleeRanged: "DS4.AttackTypeMeleeRanged",
},
/**
* * Define the file paths to icon images
* @type {Object}
*/
attackTypesIcons: {
melee: "systems/ds4/assets/DS4-MAT.png",
meleeRanged: "systems/ds4/assets/DS4-MRA.png",
ranged: "systems/ds4/assets/DS4-RAT.png",
},
/**
* Define the set of item availabilties
* @type {Object}
@ -56,6 +66,18 @@ export const DS4 = {
vambraceGreaves: "DS4.ArmorTypeVambraceGreaves",
},
/**
* * Define abbreviations for the armor types
* @type {Object}
*/
armorTypesAbbr: {
body: "DS4.ArmorTypeBodyAbbr",
helmet: "DS4.ArmorTypeHelmetAbbr",
vambrace: "DS4.ArmorTypeVambraceAbbr",
greaves: "DS4.ArmorTypeGreavesAbbr",
vambraceGreaves: "DS4.ArmorTypeVambraceGreavesAbbr",
},
/**
* * Define the set of armor materials, used to determine if a characer may wear the armor without additional penalties
* @type {Object}
@ -66,4 +88,15 @@ export const DS4 = {
chain: "DS4.ArmorMaterialTypeChain",
plate: "DS4.ArmorMaterialTypePlate",
},
/**
* * Define the abbreviations of armor materials
* @type {Object}
*/
armorMaterialTypesAbbr: {
cloth: "DS4.ArmorMaterialTypeClothAbbr",
leather: "DS4.ArmorMaterialTypeLeatherAbbr",
chain: "DS4.ArmorMaterialTypeChainAbbr",
plate: "DS4.ArmorMaterialTypePlateAbbr",
},
};

View file

@ -50,7 +50,15 @@ async function registerHandlebarsPartials() {
*/
Hooks.once("setup", function () {
// Localize CONFIG objects once up-front
const toLocalize = ["attackTypes", "itemAvailabilities", "itemTypes", "armorTypes", "armorMaterialTypes"];
const toLocalize = [
"attackTypes",
"itemAvailabilities",
"itemTypes",
"armorTypes",
"armorTypesAbbr",
"armorMaterialTypes",
"armorMaterialTypesAbbr",
];
// Exclude some from sorting where the default order matters
const noSort = [];

View file

@ -21,6 +21,7 @@
img {
display: block;
border: none;
}
}

View file

@ -3,26 +3,28 @@
<div class="tab items" data-group="primary" data-tab="items">
{{!-- WEAPONS --}}
<h4 class="items-list-title">{{localize "DS4.ItemTypeWeapon"}}</h4> {{!-- SPECIFIC --}}
<h4 class="items-list-title">{{localize 'DS4.ItemTypeWeapon'}}</h4> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
<div title="{{localize "DS4.ItemEquipped"}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div title="{{localize 'DS4.ItemEquipped'}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div class="item-image"></div>
<div class="item-num-val" title="{{localize "DS4.Quantity"}}">#</div> {{!-- amount --}}
<div class="item-num-val" title="{{localize 'DS4.Quantity'}}">#</div> {{!-- amount --}}
</div>
<div class="item-name flex3">{{localize "DS4.ItemName"}}</div>
<div title="{{localize "DS4.AttackType"}}">{{localize "DS4.AttackTypeAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="item-name flex3">{{localize 'DS4.ItemName'}}</div>
<div title="{{localize 'DS4.AttackType'}}">{{localize 'DS4.AttackTypeAbbr'}}</div> {{!-- SPECIFIC --}}
<div class="flexrow flex15">
<div class="item-num-val" title="{{localize "DS4.WeaponBonus"}}">{{localize "DS4.WeaponBonusAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="item-num-val" title="{{localize "DS4.OpponentDefense"}}">{{localize "DS4.OpponentDefenseAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="item-num-val" title="{{localize 'DS4.WeaponBonus'}}">{{localize 'DS4.WeaponBonusAbbr'}}
</div> {{!-- SPECIFIC --}}
<div class="item-num-val" title="{{localize 'DS4.OpponentDefense'}}">{{localize
'DS4.OpponentDefenseAbbr'}}</div> {{!-- SPECIFIC --}}
</div>
<div class="flex4">{{localize "DS4.Description"}}</div>
<div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="weapon"{{!-- SPECIFIC --}}>
<a class="item-control item-create" title="Create item" data-type="weapon" {{!-- SPECIFIC --}}>
<i class="fas fa-plus"></i>
{{localize "DS4.UserInteractionAddItem"}}</a>
{{localize 'DS4.UserInteractionAddItem'}}</a>
</div>
</li>
{{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}}
@ -43,7 +45,10 @@
{{!-- name --}}
<h4 class="item-name flex3">{{item.name}}</h4>
{{!-- item specifics --}}
<div>{{lookup ../../config.attackTypes itemData.attackType}}</div> {{!-- SPECIFIC --}}
<div>
<img src="{{lookup ../../config.attackTypesIcons itemData.attackType}}"
title="{{lookup ../../config.attackTypes itemData.attackType}}" width="24" height="24" />
</div> {{!-- SPECIFIC --}}
<div class="flexrow flex15">
<div class="item-num-val">{{itemData.weaponBonus}}</div> {{!-- SPECIFIC --}}
<div class="item-num-val">{{itemData.opponentDefense}}</div> {{!-- SPECIFIC --}}
@ -61,24 +66,27 @@
</ol>
{{!-- ARMOR --}}
<h4 class="items-list-title">{{localize "DS4.ItemTypeArmor"}}</h4> {{!-- SPECIFIC --}}
<h4 class="items-list-title">{{localize 'DS4.ItemTypeArmor'}}</h4> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
<div title="{{localize "DS4.ItemEquipped"}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div title="{{localize 'DS4.ItemEquipped'}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div class="item-image"></div>
<div class="item-num-val" title="{{localize "DS4.Quantity"}}">#</div> {{!-- amount --}}
<div class="item-num-val" title="{{localize 'DS4.Quantity'}}">#</div> {{!-- amount --}}
</div>
<div class="item-name flex3">{{localize "DS4.ItemName"}}</div>
<div title="{{localize "DS4.ArmorMaterialType"}}">{{localize "DS4.ArmorMaterialTypeAbbr"}}</div> {{!-- SPECIFIC --}}
<div title="{{localize "DS4.ArmorType"}}">{{localize "DS4.ArmorTypeAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="flex05 item-num-val" title="{{localize "DS4.ArmorValue"}}">{{localize "DS4.ArmorValueAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize "DS4.Description"}}</div>
<div class="item-name flex3">{{localize 'DS4.ItemName'}}</div>
<div title="{{localize 'DS4.ArmorMaterialType'}}">{{localize 'DS4.ArmorMaterialTypeAbbr'}}</div> {{!--
SPECIFIC --}}
<div title="{{localize 'DS4.ArmorType'}}">{{localize 'DS4.ArmorTypeAbbr'}}</div> {{!-- SPECIFIC --}}
<div class="flex05 item-num-val" title="{{localize 'DS4.ArmorValue'}}">
{{localize 'DS4.ArmorValueAbbr'}}
</div> {{!-- SPECIFIC --}}
<div class="flex3">{{localize 'DS4.Description'}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="armor"{{!-- SPECIFIC --}}>
<a class="item-control item-create" title="Create item" data-type="armor" {{!-- SPECIFIC --}}>
<i class="fas fa-plus"></i>
{{localize "DS4.UserInteractionAddItem"}}</a>
{{localize 'DS4.UserInteractionAddItem'}}</a>
</div>
</li>
{{#each itemsByType.armor as |item id|}} {{!-- SPECIFIC --}}
@ -99,11 +107,15 @@
{{!-- name --}}
<h4 class="item-name flex3">{{item.name}}</h4>
{{!-- item specifics --}}
<div>{{lookup ../../config.armorMaterialTypes itemData.armorMaterialType}}</div> {{!-- SPECIFIC --}}
<div>{{lookup ../../config.armorTypes itemData.armorType}}</div> {{!-- SPECIFIC --}}
<div title="{{lookup ../../config.armorMaterialTypes itemData.armorMaterialType}}">
{{lookup ../../config.armorMaterialTypesAbbr itemData.armorMaterialType}}
</div> {{!-- SPECIFIC --}}
<div title="{{lookup ../../config.armorTypes itemData.armorType}}">
{{lookup ../../config.armorTypesAbbr itemData.armorType}}
</div> {{!-- SPECIFIC --}}
<div class="flex05 item-num-val">{{itemData.armorValue}}</div> {{!-- SPECIFIC --}}
{{!-- description --}}
<div class="flex4 item-description">{{{itemData.description}}}</div>
<div class="flex3 item-description">{{{itemData.description}}}</div>
{{!-- edit & delete buttons --}}
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
@ -116,22 +128,23 @@
{{!-- SHIELD --}}
<h4 class="items-list-title">{{localize "DS4.ItemTypeShield"}}</h4> {{!-- SPECIFIC --}}
<h4 class="items-list-title">{{localize 'DS4.ItemTypeShield'}}</h4> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
<div title="{{localize "DS4.ItemEquipped"}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div title="{{localize 'DS4.ItemEquipped'}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div class="item-image"></div>
<div class="item-num-val" title="{{localize "DS4.Quantity"}}">#</div> {{!-- amount --}}
<div class="item-num-val" title="{{localize 'DS4.Quantity'}}">#</div> {{!-- amount --}}
</div>
<div class="item-name flex3">{{localize "DS4.ItemName"}}</div>
<div class="flex05 item-num-val" title="{{localize "DS4.ArmorValue"}}">{{localize "DS4.ArmorValueAbbr"}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize "DS4.Description"}}</div>
<div class="item-name flex3">{{localize 'DS4.ItemName'}}</div>
<div class="flex05 item-num-val" title="{{localize 'DS4.ArmorValue'}}">{{localize 'DS4.ArmorValueAbbr'}}
</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="shield"{{!-- SPECIFIC --}}>
<a class="item-control item-create" title="Create item" data-type="shield" {{!-- SPECIFIC --}}>
<i class="fas fa-plus"></i>
{{localize "DS4.UserInteractionAddItem"}}</a>
{{localize 'DS4.UserInteractionAddItem'}}</a>
</div>
</li>
{{#each itemsByType.shield as |item id|}} {{!-- SPECIFIC --}}
@ -166,22 +179,22 @@
</ol>
{{!-- TRINKET --}}
<h4 class="items-list-title">{{localize "DS4.ItemTypeTrinket"}}</h4> {{!-- SPECIFIC --}}
<h4 class="items-list-title">{{localize 'DS4.ItemTypeTrinket'}}</h4> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
<div title="{{localize "DS4.ItemEquipped"}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div title="{{localize 'DS4.ItemEquipped'}}">E</div> {{!-- equipped --}} {{!-- SPECIFIC --}}
<div class="item-image"></div>
<div class="item-num-val" title="{{localize "DS4.Quantity"}}">#</div> {{!-- amount --}}
<div class="item-num-val" title="{{localize 'DS4.Quantity'}}">#</div> {{!-- amount --}}
</div>
<div class="item-name flex3">{{localize "DS4.ItemName"}}</div>
<div class="flex2">{{localize "DS4.StorageLocation"}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize "DS4.Description"}}</div>
<div class="item-name flex3">{{localize 'DS4.ItemName'}}</div>
<div class="flex2">{{localize 'DS4.StorageLocation'}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="trinket"{{!-- SPECIFIC --}}>
<a class="item-control item-create" title="Create item" data-type="trinket" {{!-- SPECIFIC --}}>
<i class="fas fa-plus"></i>
{{localize "DS4.UserInteractionAddItem"}}</a>
{{localize 'DS4.UserInteractionAddItem'}}</a>
</div>
</li>
{{#each itemsByType.trinket as |item id|}} {{!-- SPECIFIC --}}
@ -202,7 +215,7 @@
{{!-- name --}}
<h4 class="item-name flex3">{{item.name}}</h4>
{{!-- storage location --}}
<div class="flex2">{{{itemData.storageLocation}}}</div> {{!-- SPECIFIC --}}
<div class="flex2">{{{itemData.storageLocation}}}</div> {{!-- SPECIFIC --}}
{{!-- description --}}
<div class="flex4 item-description">{{{itemData.description}}}</div>
{{!-- edit & delete buttons --}}
@ -216,21 +229,21 @@
</ol>
{{!-- EQUIPMENT --}}
<h4 class="items-list-title">{{localize "DS4.ItemTypeEquipment"}}</h4> {{!-- SPECIFIC --}}
<h4 class="items-list-title">{{localize 'DS4.ItemTypeEquipment'}}</h4> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
<div class="item-image"></div>
<div class="item-num-val" title="{{localize "DS4.Quantity"}}">#</div> {{!-- amount --}}
<div class="item-num-val" title="{{localize 'DS4.Quantity'}}">#</div> {{!-- amount --}}
</div>
<div class="item-name flex3">{{localize "DS4.ItemName"}}</div>
<div class="flex2">{{localize "DS4.StorageLocation"}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize "DS4.Description"}}</div>
<div class="item-name flex3">{{localize 'DS4.ItemName'}}</div>
<div class="flex2">{{localize 'DS4.StorageLocation'}}</div> {{!-- SPECIFIC --}}
<div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="equipment" {{!-- SPECIFIC --}}>
<i class="fas fa-plus"></i>
{{localize "DS4.UserInteractionAddItem"}}</a>
{{localize 'DS4.UserInteractionAddItem'}}</a>
</div>
</li>
{{#each itemsByType.equipment as |item id|}} {{!-- SPECIFIC --}}
@ -247,7 +260,7 @@
{{!-- name --}}
<h4 class="item-name flex3">{{item.name}}</h4>
{{!-- storage location --}}
<div class="flex2">{{{itemData.storageLocation}}}</div> {{!-- SPECIFIC --}}
<div class="flex2">{{{itemData.storageLocation}}}</div> {{!-- SPECIFIC --}}
{{!-- description --}}
<div class="flex4 item-description">{{{itemData.description}}}</div>
{{!-- edit & delete buttons --}}