Merge branch 'feature-swap-stat-modifier' into misc-enhancements
This commit is contained in:
@@ -185,6 +185,7 @@ Schemas.Character = new SimpleSchema({
|
|||||||
defaultValue: "whitelist",
|
defaultValue: "whitelist",
|
||||||
allowedValues: ["whitelist", "public"],
|
allowedValues: ["whitelist", "public"],
|
||||||
},
|
},
|
||||||
|
"settings.swapStatAndModifier": {type: Boolean, defaultValue: false},
|
||||||
"settings.exportFeatures": {type: Boolean, defaultValue: true},
|
"settings.exportFeatures": {type: Boolean, defaultValue: true},
|
||||||
"settings.exportAttacks": {type: Boolean, defaultValue: true},
|
"settings.exportAttacks": {type: Boolean, defaultValue: true},
|
||||||
"settings.exportDescription": {type: Boolean, defaultValue: true},
|
"settings.exportDescription": {type: Boolean, defaultValue: true},
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
<paper-toggle-button id="variantEncumbrance" checked={{settings.useVariantEncumbrance}}>
|
<paper-toggle-button id="variantEncumbrance" checked={{settings.useVariantEncumbrance}}>
|
||||||
Use variant encumbrance
|
Use variant encumbrance
|
||||||
</paper-toggle-button>
|
</paper-toggle-button>
|
||||||
|
<paper-toggle-button id="swapStatAndModifier" checked={{settings.swapStatAndModifier}}>
|
||||||
|
Swap stats and modifiers on Stats page
|
||||||
|
</paper-toggle-button>
|
||||||
</div>
|
</div>
|
||||||
</app-header-layout>
|
</app-header-layout>
|
||||||
<div class="buttons layout horizontal end-justified">
|
<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){
|
"click .doneButton": function(event, instance){
|
||||||
popDialogStack();
|
popDialogStack();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,12 +2,21 @@
|
|||||||
<div>
|
<div>
|
||||||
<paper-material class="ability-mini-card layout horizontal">
|
<paper-material class="ability-mini-card layout horizontal">
|
||||||
<div class="numbers">
|
<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">
|
<div class="paper-font-display1 stat">
|
||||||
{{characterCalculate "attributeValue" ../_id ability}}
|
{{characterCalculate "attributeValue" ../_id ability}}
|
||||||
</div>
|
</div>
|
||||||
<div class="paper-font-subhead modifier">
|
<div class="paper-font-subhead modifier">
|
||||||
{{abilityMod}}
|
{{abilityMod}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="paper-font-subhead title flex layout horizontal center">
|
<div class="paper-font-subhead title flex layout horizontal center">
|
||||||
{{title}}
|
{{title}}
|
||||||
|
|||||||
@@ -5,5 +5,10 @@ Template.abilityMiniCard.helpers({
|
|||||||
Template.parentData()._id, this.ability
|
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