Added the ability to hide spells and tree tab. Tree tab hidden by default

This commit is contained in:
Stefan Zermatten
2021-04-11 10:43:33 +02:00
parent d89cb77040
commit 9814e20091
4 changed files with 37 additions and 5 deletions

View File

@@ -35,6 +35,16 @@ let CreatureSettingsSchema = new SimpleSchema({
type: Boolean, type: Boolean,
optional: true, optional: true,
}, },
// Show the tree tab
showTreeTab: {
type: Boolean,
optional: true,
},
// Hide the spells tab
hideSpellsTab: {
type: Boolean,
optional: true,
},
// How much each hitDice resets on a long rest // How much each hitDice resets on a long rest
hitDiceResetMultiplier: { hitDiceResetMultiplier: {
type: Number, type: Number,

View File

@@ -39,6 +39,28 @@
:input-value="model.settings.hideUnusedStats" :input-value="model.settings.hideUnusedStats"
@change="value => $emit('change', {path: ['settings','hideUnusedStats'], value: !!value})" @change="value => $emit('change', {path: ['settings','hideUnusedStats'], value: !!value})"
/> />
<v-switch
label="Show spells tab"
:input-value="!model.settings.hideSpellsTab"
@change="value => {
$emit('change', {path: ['settings','hideSpellsTab'], value: !value});
$store.commit(
'setTabForCharacterSheet',
{id: model._id, tab: 0}
);
}"
/>
<v-switch
label="Show tree tab"
:input-value="model.settings.showTreeTab"
@change="value => {
$emit('change', {path: ['settings','showTreeTab'], value: !!value});
$store.commit(
'setTabForCharacterSheet',
{id: model._id, tab: 0}
);
}"
/>
<text-field <text-field
label="Hit Dice reset multiplier" label="Hit Dice reset multiplier"
hint="What fraction of your hit dice are reset every long rest" hint="What fraction of your hit dice are reset every long rest"

View File

@@ -51,13 +51,13 @@
<v-tab-item> <v-tab-item>
<inventory-tab :creature-id="creatureId" /> <inventory-tab :creature-id="creatureId" />
</v-tab-item> </v-tab-item>
<v-tab-item> <v-tab-item v-if="!creature.settings.hideSpellsTab">
<spells-tab :creature-id="creatureId" /> <spells-tab :creature-id="creatureId" />
</v-tab-item> </v-tab-item>
<v-tab-item> <v-tab-item>
<character-tab :creature-id="creatureId" /> <character-tab :creature-id="creatureId" />
</v-tab-item> </v-tab-item>
<v-tab-item> <v-tab-item v-if="creature.settings.showTreeTab">
<tree-tab :creature-id="creatureId" /> <tree-tab :creature-id="creatureId" />
</v-tab-item> </v-tab-item>
</v-tabs-items> </v-tabs-items>

View File

@@ -78,7 +78,7 @@
class="layout" class="layout"
> >
<v-tabs <v-tabs
v-if="creature" v-if="creature && creature.settings"
class="flex" class="flex"
style="min-width: 0" style="min-width: 0"
centered centered
@@ -101,13 +101,13 @@
<v-tab> <v-tab>
Inventory Inventory
</v-tab> </v-tab>
<v-tab> <v-tab v-if="!creature.settings.hideSpellsTab">
Spells Spells
</v-tab> </v-tab>
<v-tab> <v-tab>
Character Character
</v-tab> </v-tab>
<v-tab> <v-tab v-if="creature.settings.showTreeTab">
Tree Tree
</v-tab> </v-tab>
</v-tabs> </v-tabs>