Files
DiceCloud/app/imports/ui/properties/treeNodeViews/BranchTreeNode.vue
Stefan Zermatten 788cbb182d Action system improvements
- Actions/spells now display their summary, not their description
- All save branches and attack branches run when there are no targets
- Improved action logging
- Index branch lets you customise a choice of children to run
2022-03-09 01:31:09 +02:00

38 lines
977 B
Vue

<template lang="html">
<div class="layout align-center justify-start">
<property-icon
v-if="!hideIcon"
class="mr-2"
:model="model"
:color="model.color"
:class="selected && 'primary--text'"
/>
<div class="text-no-wrap text-truncate">
{{ name }}
</div>
</div>
</template>
<script lang="js">
import treeNodeViewMixin from '/imports/ui/properties/treeNodeViews/treeNodeViewMixin.js';
export default {
mixins: [treeNodeViewMixin],
computed: {
name(){
switch(this.model.branchType){
case 'if': return 'On condition';
case 'hit': return 'On hit';
case 'miss': return 'On miss';
case 'failedSave': return 'On failed save';
case 'successfulSave': return 'On save';
case 'eachTarget': return 'Each target';
case 'random': return 'Pick one at random';
case 'index': return 'Pick one by index';
default: return '';
}
}
}
}
</script>