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,
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
hitDiceResetMultiplier: {
type: Number,

View File

@@ -39,6 +39,28 @@
:input-value="model.settings.hideUnusedStats"
@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
label="Hit Dice reset multiplier"
hint="What fraction of your hit dice are reset every long rest"

View File

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

View File

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