abbr for armor type&material in item overview

Additions:
- further abbreviations included in localization

Changes:
- now not full armor type / material expression displayed in char sheet,
  but only an abbreviation with tooltip
- description now smaller for weapon and armor
This commit is contained in:
Gesina Schwalbe 2020-12-30 01:03:06 +01:00
parent 0b93f5ff9e
commit 9da168afa6
4 changed files with 57 additions and 12 deletions

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}
@ -68,12 +90,13 @@ export const DS4 = {
},
/**
* * Define the file paths to icon images
* * Define the abbreviations of armor materials
* @type {Object}
*/
attackTypesIcons: {
melee: "systems/ds4/assets/DS4-MAT.png",
meleeRanged: "systems/ds4/assets/DS4-MRA.png",
ranged: "systems/ds4/assets/DS4-RAT.png",
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 = [];