Skip to content

Commit 7e6ac94

Browse files
committed
show MANA_UPKEEP on card when applicable, #150
1 parent 286cef2 commit 7e6ac94

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/CardModel.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@
2828
</div>
2929
<!-- card statistics -->
3030
<div>
31-
<!-- mana cost -->
31+
<!-- mana cost/upkeep -->
3232
<div style="float: left; padding-left: 5px;">
33-
<Value :value="card.properties.MANA_COST" type="mana-cost" orElse="0" alwaysShow></Value>
33+
<Value v-if="card.properties.MANA_UPKEEP"
34+
:value="`${card.properties.MANA_COST}/${card.properties.MANA_UPKEEP}`"
35+
type="mana_cost_upkeep" orElse="0"></Value>
36+
<Value v-else :value="card.properties.MANA_COST" type="mana_cost" orElse="0"></Value>
3437
</div>
3538
<div style="float: right; padding-right: 5px;" class="btn-group">
3639
<Value :value="card.properties.ATTACK" type="attack" alwaysShow></Value>

src/components/Value.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export default {
2929
data() {
3030
let type = this.type;
3131
let style = { buttonStyle: "info", fa: "tint", title: "" };
32+
if (type === "mana_cost") {
33+
style = { buttonStyle: "info", fa: "tint", title: "Mana Cost" };
34+
}
35+
if (type === "mana_cost_upkeep") {
36+
style = { buttonStyle: "info", fa: "tint", title: "Mana Cost/Upkeep" };
37+
}
3238
if (type === "attack") {
3339
style = { buttonStyle: "danger", fa: "crosshairs", title: "Attack" };
3440
}

0 commit comments

Comments
 (0)