Buffs applied property can now be set in both library and character

This commit is contained in:
Stefan Zermatten
2021-08-10 17:02:27 +02:00
parent 44cc46ed22
commit 4c2155d8ff
2 changed files with 11 additions and 12 deletions

View File

@@ -31,7 +31,7 @@
:key="type" :key="type"
color="primary" color="primary"
:data-id="`insert-creature-property-type-${type}`" :data-id="`insert-creature-property-type-${type}`"
:label="type ? 'New ' + properties[type].name : 'New Property'" :label="getPropertyLabel(type)"
:icon="type ? properties[type].icon : 'mdi-plus'" :icon="type ? properties[type].icon : 'mdi-plus'"
:disabled="!editPermission" :disabled="!editPermission"
@click="addProperty(type)" @click="addProperty(type)"
@@ -125,7 +125,7 @@
return this.speedDialsByTab[tabs[this.tabNumber]]; return this.speedDialsByTab[tabs[this.tabNumber]];
}, },
speedDialsByTab() { return { speedDialsByTab() { return {
'stats': ['attribute', 'skill', 'action', 'attack'], 'stats': ['attribute', 'skill', 'action', 'attack', 'buff'],
'features': ['feature'], 'features': ['feature'],
'inventory': ['item', 'container'], 'inventory': ['item', 'container'],
'spells': ['spellList', 'spell'], 'spells': ['spellList', 'spell'],
@@ -137,6 +137,10 @@
}, },
}, },
methods: { methods: {
getPropertyLabel(type){
if (type === 'buff') return 'Buff or Condition';
return type ? PROPERTIES[type].name : 'Property'
},
addProperty(forcedType){ addProperty(forcedType){
let creatureId = this.creatureId; let creatureId = this.creatureId;
let fab = hideFab(); let fab = hideFab();

View File

@@ -8,23 +8,21 @@
@change="change('name', ...arguments)" @change="change('name', ...arguments)"
/> />
<smart-switch <smart-switch
v-if="context.isLibraryForm" label="Applied"
label="Add to character sheet already applied"
class="mt-0" class="mt-0"
:value="model.applied" :value="model.applied"
:error-messages="errors.applied" :error-messages="errors.applied"
@change="change('applied', ...arguments)" @change="change('applied', ...arguments)"
/> />
<v-expand-transition> <v-expand-transition>
<div v-if="context.isLibraryForm && model.applied"> <div v-if="model.applied">
<v-alert <v-alert
v-if="context.isLibraryForm && model.applied"
type="info" type="info"
outlined outlined
> >
Buffs that are applied are active on the character sheet. This When buffs are applied they become active on a creature.
should be turned off if a buff is going to be applied by an action or Turn this off if the buff needs to be applied to a target by an action
spell. or spell.
</v-alert> </v-alert>
</div> </div>
</v-expand-transition> </v-expand-transition>
@@ -78,9 +76,6 @@
CalculationErrorList, CalculationErrorList,
}, },
mixins: [propertyFormMixin], mixins: [propertyFormMixin],
inject: {
context: { default: {} }
},
props: { props: {
parentTarget: { parentTarget: {
type: String, type: String,