Added the ability to hide slots when full
This commit is contained in:
@@ -129,10 +129,6 @@ export default {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
numToFill: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data(){return {
|
||||
selectedNode: undefined,
|
||||
@@ -194,8 +190,8 @@ export default {
|
||||
}
|
||||
if (
|
||||
node.type === 'slotFiller' &&
|
||||
this.numToFill > 0 &&
|
||||
node.slotQuantityFilled > this.numToFill
|
||||
this.model.spaceLeft > 0 &&
|
||||
node.slotQuantityFilled > this.model.spaceLeft
|
||||
){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
<v-btn
|
||||
v-if="!slot.quantityExpected || slot.quantityExpected > slot.totalFilled"
|
||||
v-if="!slot.quantityExpected || slot.spaceLeft"
|
||||
icon
|
||||
:data-id="`slot-add-button-${slot._id}`"
|
||||
style="background-color: inherit;"
|
||||
@@ -73,6 +73,9 @@ export default {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
showHiddenSlots: {
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clickSlotChild({_id}){
|
||||
@@ -85,15 +88,12 @@ export default {
|
||||
fillSlot(slot){
|
||||
let slotId = slot._id;
|
||||
let creatureId = this.creatureId;
|
||||
let numToFill = slot.quantityExpected === 0 ?
|
||||
0 : slot.quantityExpected - slot.totalFilled;
|
||||
this.$store.commit('pushDialogStack', {
|
||||
component: 'slot-fill-dialog',
|
||||
elementId: `slot-add-button-${slotId}`,
|
||||
data: {
|
||||
slotId,
|
||||
creatureId,
|
||||
numToFill,
|
||||
},
|
||||
callback(node){
|
||||
if(!node) return;
|
||||
@@ -136,7 +136,13 @@ export default {
|
||||
removed: {$ne: true},
|
||||
}).fetch();
|
||||
return slot;
|
||||
});
|
||||
}).filter(slot => !( // Hide full and ignored slots
|
||||
!this.showHiddenSlots &&
|
||||
slot.hideWhenFull &&
|
||||
slot.quantityExpected > 0 &&
|
||||
slot.totalFilled >= slot.quantityExpected ||
|
||||
slot.ignored
|
||||
));
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -54,15 +54,15 @@
|
||||
name="Advanced"
|
||||
standalone
|
||||
>
|
||||
<smart-combobox
|
||||
label="Tags"
|
||||
multiple
|
||||
chips
|
||||
deletable-chips
|
||||
:value="model.tags"
|
||||
@change="change('tags', ...arguments)"
|
||||
/>
|
||||
<div class="layout row wrap justify-space-between">
|
||||
<smart-switch
|
||||
label="Hide when full"
|
||||
style="width: 200px; flex-grow: 0;"
|
||||
class="mx-2"
|
||||
:value="model.hideWhenFull"
|
||||
:error-messages="errors.hideWhenFull"
|
||||
@change="change('hideWhenFull', ...arguments)"
|
||||
/>
|
||||
<smart-switch
|
||||
label="Ignored"
|
||||
style="width: 200px; flex-grow: 0;"
|
||||
@@ -72,6 +72,14 @@
|
||||
@change="change('ignored', ...arguments)"
|
||||
/>
|
||||
</div>
|
||||
<smart-combobox
|
||||
label="Tags"
|
||||
multiple
|
||||
chips
|
||||
deletable-chips
|
||||
:value="model.tags"
|
||||
@change="change('tags', ...arguments)"
|
||||
/>
|
||||
</form-section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user