diff --git a/src/ActorSheet.hbs b/src/ActorSheet.hbs index 0e9341a..f455c18 100644 --- a/src/ActorSheet.hbs +++ b/src/ActorSheet.hbs @@ -322,8 +322,8 @@
{{localize "DSA41.list_empty"}}
{{/unless}} - {{#each actor.itemTypes.Bewaffnung}} -
+ {{#each (sorted actor.itemTypes.Bewaffnung)}} +
@@ -356,8 +356,8 @@
{{localize "DSA41.list_empty"}}
{{/unless}} - {{#each actor.itemTypes.Ruestung}} -
+ {{#each (sorted actor.itemTypes.Ruestung)}} +
{{this.name}} @@ -382,8 +382,8 @@
{{localize "DSA41.list_empty"}}
{{/unless}} - {{#each actor.itemTypes.Gegenstand}} -
+ {{#each (sorted actor.itemTypes.Gegenstand)}} +
{{this.name}} diff --git a/src/main.mjs b/src/main.mjs index 0ad30df..8b958b0 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -92,6 +92,12 @@ Hooks.once("init", async function() { } }); + Handlebars.registerHelper({ + sorted: (array, options) => { + return array.toSorted((a, b) => a.sort - b.sort); + } + }); + await loadTemplates({ "editable-input": "systems/dsa-4th-edition/src/EditableInput.hbs",