Added setting to swap stats and modifiers

Although Schemas.Character was changed, a database migration should
not be required due to the way characterSettings handles it (since
undefined is a falsy value).
This commit is contained in:
Jacob
2017-07-18 21:58:00 +01:00
parent 2a332a2965
commit 6fc469f934
5 changed files with 28 additions and 1 deletions

View File

@@ -14,6 +14,9 @@
<paper-toggle-button id="variantEncumbrance" checked={{settings.useVariantEncumbrance}}>
Use variant encumbrance
</paper-toggle-button>
<paper-toggle-button id="swapStatAndModifier" checked={{settings.swapStatAndModifier}}>
Swap stats and modifiers on Stats page
</paper-toggle-button>
</div>
</app-header-layout>
<div class="buttons layout horizontal end-justified">

View File

@@ -23,6 +23,15 @@ Template.characterSettings.events({
);
}
},
"change #swapStatAndModifier": function(event, instance){
var value = instance.find("#swapStatAndModifier").checked;
if (this.settings.swapStatAndModifier !== value){
Characters.update(
this._id,
{$set: {"settings.swapStatAndModifier": value}}
);
}
},
"click .doneButton": function(event, instance){
popDialogStack();
},