From 100c93b5ae1d827d9592b6937584b6799e6c2c15 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 22 Jan 2021 12:20:33 +0200 Subject: [PATCH 1/3] Stopped dialog animation mocking transparent elements' background color --- app/imports/ui/dialogStack/DialogStack.vue | 2 -- app/imports/ui/dialogStack/mockElement.js | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/imports/ui/dialogStack/DialogStack.vue b/app/imports/ui/dialogStack/DialogStack.vue index fd8fb680..0a807e6b 100644 --- a/app/imports/ui/dialogStack/DialogStack.vue +++ b/app/imports/ui/dialogStack/DialogStack.vue @@ -42,8 +42,6 @@ diff --git a/app/imports/ui/properties/components/spells/CastSpellWithSlotDialog.vue b/app/imports/ui/properties/components/spells/CastSpellWithSlotDialog.vue index f280b36b..d21d678a 100644 --- a/app/imports/ui/properties/components/spells/CastSpellWithSlotDialog.vue +++ b/app/imports/ui/properties/components/spells/CastSpellWithSlotDialog.vue @@ -5,7 +5,66 @@ Cast a Spell - + + + + + + + + +
+ + Clear + + + + Done + +
+
+
@@ -119,6 +180,16 @@ export default { searchString: undefined, selectedSlotId: this.slotId, selectedSpellId: this.spellId, + searchValue: undefined, + searchError: undefined, + filterMenuOpen: false, + booleanFilters: { + verbal: {name: 'Verbal', enabled: false, value: false}, + somatic: {name: 'Somatic', enabled: false, value: false}, + material: {name: 'Material', enabled: false, value: false}, + concentration: {name: 'Concentration', enabled: false, value: false}, + ritual: {name: 'Ritual', enabled: false, value: false}, + }, }}, computed: { computedSpells(){ @@ -135,7 +206,15 @@ export default { } else { return slot.spellSlotLevelValue >= spell.level; } - } + }, + filtersApplied(){ + for (let key in this.booleanFilters){ + if (this.booleanFilters[key].enabled){ + return true; + } + } + return false; + }, }, watch: { selectedSpell(spell){ @@ -152,16 +231,53 @@ export default { } }, }, + methods: { + clearBooleanFilters(){ + for (let key in this.booleanFilters){ + this.booleanFilters[key].enabled = false; + } + }, + spellDialog(_id){ + this.$store.commit('pushDialogStack', { + component: 'creature-property-dialog', + elementId: `spell-info-btn-${_id}`, + data: {_id}, + }); + }, + searchChanged(val, ack){ + this.searchValue = val; + setTimeout(ack, 200); + }, + }, meteor: { spells(){ let slotLevel = this.selectedSlot && this.selectedSlot.spellSlotLevelValue || 0; - return CreatureProperties.find({ + let filter = { 'ancestors.id': this.creatureId, removed: {$ne: true}, inactive: {$ne: true}, prepared: true, level: {$lte: slotLevel}, - }, { + }; + // Apply the filters from the filter menu + for (let key in this.booleanFilters){ + if (this.booleanFilters[key].enabled){ + let value = this.booleanFilters[key].value; + if (key === 'material'){ + filter[key] = {$exists: this.booleanFilters[key].value}; + } else { + filter[key] = value ? true: {$ne: true}; + } + } + } + // Apply the search string to the name field + if (this.searchValue){ + filter.name = { + $regex: this.searchValue.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), + $options: 'i' + }; + } + return CreatureProperties.find(filter, { sort: {order: 1} }); }, @@ -186,7 +302,7 @@ export default { }, selectedSpell(){ return CreatureProperties.findOne(this.selectedSpellId); - } + }, }, } diff --git a/app/imports/ui/properties/components/spells/SpellListTile.vue b/app/imports/ui/properties/components/spells/SpellListTile.vue index 977b9f53..61c777d4 100644 --- a/app/imports/ui/properties/components/spells/SpellListTile.vue +++ b/app/imports/ui/properties/components/spells/SpellListTile.vue @@ -33,6 +33,16 @@ > drag_indicator + + info + @@ -46,6 +56,7 @@ export default { props: { preparingSpells: Boolean, hideHandle: Boolean, + showInfoButton: Boolean, }, computed: { hasClickListener(){ @@ -86,4 +97,7 @@ export default { .primary--text .v-icon, .primary--text .v-list__tile__sub-title { color: #b71c1c } +.theme--light.info-icon{ + color: rgba(0,0,0,.54) !important; +} diff --git a/app/imports/ui/utility/escapeRegex.js b/app/imports/ui/utility/escapeRegex.js new file mode 100644 index 00000000..8ed9c0b9 --- /dev/null +++ b/app/imports/ui/utility/escapeRegex.js @@ -0,0 +1,3 @@ +RegExp.escape = function(s) { + return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); +}; From 3cdeb73c308a69406e6937dac0a8195879453cb5 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 25 Jan 2021 12:38:46 +0200 Subject: [PATCH 3/3] Stopped removed items from showing up in inventory containers --- app/imports/ui/properties/components/inventory/ContainerCard.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/app/imports/ui/properties/components/inventory/ContainerCard.vue b/app/imports/ui/properties/components/inventory/ContainerCard.vue index 3ee931a4..7984fed5 100644 --- a/app/imports/ui/properties/components/inventory/ContainerCard.vue +++ b/app/imports/ui/properties/components/inventory/ContainerCard.vue @@ -56,6 +56,7 @@ export default { return CreatureProperties.find({ 'parent.id': this.model._id, type: {$in: ['item', 'container']}, + removed: {$ne: true}, equipped: {$ne: true}, deactivatedByAncestor: {$ne: true}, });