Merge branch 'feature-swap-stat-modifier' into misc-enhancements
This commit is contained in:
@@ -185,6 +185,7 @@ Schemas.Character = new SimpleSchema({
|
||||
defaultValue: "whitelist",
|
||||
allowedValues: ["whitelist", "public"],
|
||||
},
|
||||
"settings.swapStatAndModifier": {type: Boolean, defaultValue: false},
|
||||
"settings.exportFeatures": {type: Boolean, defaultValue: true},
|
||||
"settings.exportAttacks": {type: Boolean, defaultValue: true},
|
||||
"settings.exportDescription": {type: Boolean, defaultValue: true},
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
@@ -2,12 +2,21 @@
|
||||
<div>
|
||||
<paper-material class="ability-mini-card layout horizontal">
|
||||
<div class="numbers">
|
||||
{{#if swap}}
|
||||
<div class="paper-font-display1 stat">
|
||||
{{abilityMod}}
|
||||
</div>
|
||||
<div class="paper-font-subhead modifier">
|
||||
{{characterCalculate "attributeValue" ../_id ability}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="paper-font-display1 stat">
|
||||
{{characterCalculate "attributeValue" ../_id ability}}
|
||||
</div>
|
||||
<div class="paper-font-subhead modifier">
|
||||
{{abilityMod}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="paper-font-subhead title flex layout horizontal center">
|
||||
{{title}}
|
||||
|
||||
@@ -5,5 +5,10 @@ Template.abilityMiniCard.helpers({
|
||||
Template.parentData()._id, this.ability
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
swap: function() {
|
||||
var character = Characters.findOne({"_id": Template.parentData()._id})
|
||||
if (character) {return character.settings.swapStatAndModifier;}
|
||||
else {return false;}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user