From 8453bd9d86be3ea3e57f1c7c09264ce147d36dd9 Mon Sep 17 00:00:00 2001 From: ThaumRystra Date: Sat, 25 Jan 2025 21:53:50 +0200 Subject: [PATCH] Rudimentary customization in check dialog --- .../ui/creature/actions/input/CheckInput.vue | 101 ++++++++++++------ .../character/characterSheetTabs/StatsTab.vue | 6 +- 2 files changed, 73 insertions(+), 34 deletions(-) diff --git a/app/imports/client/ui/creature/actions/input/CheckInput.vue b/app/imports/client/ui/creature/actions/input/CheckInput.vue index 5377a3b9..f549b2fc 100644 --- a/app/imports/client/ui/creature/actions/input/CheckInput.vue +++ b/app/imports/client/ui/creature/actions/input/CheckInput.vue @@ -1,43 +1,65 @@ diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/StatsTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/StatsTab.vue index 2b8ba12a..d2082065 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/StatsTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/StatsTab.vue @@ -415,12 +415,12 @@ import doAction from '/imports/client/ui/creature/actions/doAction'; import getPropertyTitle from '/imports/client/ui/properties/shared/getPropertyTitle'; function walkDown(forest, callback){ - let stack = [...forest]; + let stack = [...forest].reverse(); while(stack.length){ let node = stack.pop(); const { skipChildren } = callback(node) ?? { skipChildren: false }; if (!skipChildren) { - stack.push(...node.children); + stack.push(...[...node.children].reverse()); } } } @@ -557,7 +557,7 @@ export default { if (creature.settings.hideUnusedStats) { filter.hide = { $ne: true }; } - const allProps = CreatureProperties.find(filter, { sort: { left: -1 } }).fetch(); + const allProps = CreatureProperties.find(filter, { sort: { left: 1 } }).fetch(); const forest = docsToForest(allProps); const properties = { folder: {}, attribute: {}, skill: {} }; walkDown(forest, node => {