From 1f26fbf00e7b89307a145d6b3035a219ec175a70 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 25 Nov 2022 13:25:38 +0200 Subject: [PATCH] Iterated on stat grouping cards adde slots, spell lists, children of slot fillers hid properties in most places spell slots in correct order --- .../ui/creature/buildTree/BuildTreeNode.vue | 2 +- .../characterSheetTabs/ActionsTab.vue | 13 ++- .../character/characterSheetTabs/BuildTab.vue | 2 +- .../characterSheetTabs/FeaturesTab.vue | 13 ++- .../characterSheetTabs/InventoryTab.vue | 18 +++- .../characterSheetTabs/JournalTab.vue | 13 ++- .../characterSheetTabs/SpellsTab.vue | 38 +++++++-- .../client/ui/creature/slots/SlotCard.vue | 50 ++++++++++- .../ui/creature/slots/SlotCardsToFill.vue | 48 ++++------- .../components/folders/FolderGroupCard.vue | 1 + .../FolderGroupChildren.vue | 65 +++++++++++++++ .../folderGroupComponents/SlotBuildTree.vue | 82 +++++++++++++++++++ .../folders/propertyComponentIndex.js | 17 ++-- .../client/ui/properties/forms/FolderForm.vue | 2 +- 14 files changed, 310 insertions(+), 54 deletions(-) create mode 100644 app/imports/client/ui/properties/components/folders/folderGroupComponents/FolderGroupChildren.vue create mode 100644 app/imports/client/ui/properties/components/folders/folderGroupComponents/SlotBuildTree.vue diff --git a/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue b/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue index 853d79cf..a61b0c3b 100644 --- a/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue +++ b/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue @@ -4,7 +4,7 @@ :class="{ 'empty': !hasChildren, }" - :data-id="`build-tree-node-${node._id}`" + :data-id="`tree-node-${node._id}`" >
folder._id); + + return CreatureProperties.find({ + 'ancestors.id': { + $eq: this.creatureId, + $nin: folderIds, + }, type: 'action', actionType: { $ne: 'event' }, removed: { $ne: true }, diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/BuildTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/BuildTab.vue index 1f4cd4bb..02846e91 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/BuildTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/BuildTab.vue @@ -86,7 +86,7 @@ diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/FeaturesTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/FeaturesTab.vue index 11144684..5e4bda72 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/FeaturesTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/FeaturesTab.vue @@ -56,8 +56,19 @@ export default { }, meteor: { features() { - return CreatureProperties.find({ + const folderIds = CreatureProperties.find({ 'ancestors.id': this.creatureId, + type: 'folder', + hideStatsGroup: true, + removed: { $ne: true }, + inactive: { $ne: true }, + }, { fields: { _id: 1 } }).map(folder => folder._id); + + return CreatureProperties.find({ + 'ancestors.id': { + $eq: this.creatureId, + $nin: folderIds, + }, type: 'feature', removed: { $ne: true }, inactive: { $ne: true }, diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/InventoryTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/InventoryTab.vue index 89c4d59b..64eddd1b 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/InventoryTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/InventoryTab.vue @@ -141,9 +141,21 @@ export default { }; }, meteor: { - containers() { + folderIds() { return CreatureProperties.find({ 'ancestors.id': this.creatureId, + type: 'folder', + hideStatsGroup: true, + removed: { $ne: true }, + inactive: { $ne: true }, + }, { fields: { _id: 1 } }).map(folder => folder._id); + }, + containers() { + return CreatureProperties.find({ + 'ancestors.id': { + $eq: this.creatureId, + $nin: this.folderIds, + }, type: 'container', removed: { $ne: true }, inactive: { $ne: true }, @@ -166,7 +178,7 @@ export default { return CreatureProperties.find({ 'ancestors.id': { $eq: this.creatureId, - $nin: this.containerIds + $nin: [...this.containerIds, ...this.folderIds], }, type: 'container', removed: { $ne: true }, @@ -179,7 +191,7 @@ export default { return CreatureProperties.find({ 'ancestors.id': { $eq: this.creatureId, - $nin: this.containerIds + $nin: [...this.containerIds, ...this.folderIds], }, type: 'item', equipped: { $ne: true }, diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/JournalTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/JournalTab.vue index 2679265a..d4834bb5 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/JournalTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/JournalTab.vue @@ -60,8 +60,19 @@ export default { }, meteor: { notes(){ - return CreatureProperties.find({ + const folderIds = CreatureProperties.find({ 'ancestors.id': this.creatureId, + type: 'folder', + hideStatsGroup: true, + removed: { $ne: true }, + inactive: { $ne: true }, + }, { fields: { _id: 1 } }).map(folder => folder._id); + + return CreatureProperties.find({ + 'ancestors.id': { + $eq: this.creatureId, + $nin: folderIds, + }, type: 'note', removed: {$ne: true}, inactive: {$ne: true}, diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/SpellsTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/SpellsTab.vue index f34da451..db5d3af3 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/SpellsTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/SpellsTab.vue @@ -10,7 +10,7 @@ @remove="softRemove" />
folder._id); + }, + hasSpellSlots() { + return !!CreatureProperties.findOne({ + 'ancestors.id': this.creatureId, + inactive: { $ne: true }, + removed: { $ne: true }, + overridden: { $ne: true }, + level: { $ne: 0 }, + type: 'attribute', + attributeType: 'spellSlot', + }); + }, + spellSlots() { + return CreatureProperties.find({ + 'ancestors.id': { + $eq: this.creatureId, + $nin: this.folderIds, + }, inactive: { $ne: true }, removed: { $ne: true }, overridden: { $ne: true }, @@ -89,11 +112,16 @@ export default { { hideWhenTotalZero: true, total: 0 }, { hideWhenValueZero: true, value: 0 }, ], + }, { + sort: { order: 1 } }); }, spellLists() { return CreatureProperties.find({ - 'ancestors.id': this.creatureId, + 'ancestors.id': { + $eq: this.creatureId, + $nin: this.folderIds, + }, type: 'spellList', removed: { $ne: true }, inactive: { $ne: true }, @@ -113,7 +141,7 @@ export default { return CreatureProperties.find({ 'ancestors.id': { $eq: this.creatureId, - $nin: this.spellListIds, + $nin: [...this.spellListIds, ...this.folderIds], }, type: 'spell', removed: { $ne: true }, @@ -130,7 +158,7 @@ export default { return CreatureProperties.find({ 'ancestors.id': { $eq: this.creatureId, - $nin: this.spellListIds, + $nin: [...this.spellListIds, ...this.folderIds], }, type: 'spellList', removed: { $ne: true }, diff --git a/app/imports/client/ui/creature/slots/SlotCard.vue b/app/imports/client/ui/creature/slots/SlotCard.vue index 41140419..6721866f 100644 --- a/app/imports/client/ui/creature/slots/SlotCard.vue +++ b/app/imports/client/ui/creature/slots/SlotCard.vue @@ -8,7 +8,7 @@ class="slot-card d-flex flex-column" @mouseover="hover = true" @mouseleave="hover = false" - @click="$emit('click')" + @click="fillSlot" > mdi-close @@ -39,6 +39,9 @@ diff --git a/app/imports/client/ui/creature/slots/SlotCardsToFill.vue b/app/imports/client/ui/creature/slots/SlotCardsToFill.vue index f188306b..cddbc800 100644 --- a/app/imports/client/ui/creature/slots/SlotCardsToFill.vue +++ b/app/imports/client/ui/creature/slots/SlotCardsToFill.vue @@ -1,5 +1,8 @@