|
11 | 11 |
|
12 | 12 | <!-- Deck manipulation & `Start game` | `Back to lobby` controls --> |
13 | 13 | <form> |
14 | | - <!-- TODO: {Phrancis} Lay this out in a nice Bootstrap form. --> |
15 | 14 | <label>Save deck as:</label> |
16 | 15 | <input v-model="deckName" type="text" /> |
17 | 16 | <input @click="saveDeck()" type="button" value="Save Deck" class="btn btn-xs btn-primary"/> |
|
21 | 20 | <input v-if="enteringGame" @click="goBack()" type="button" value="Go back to lobby" class="btn btn-sm btn-default"/> |
22 | 21 | </form> |
23 | 22 |
|
24 | | - <!-- List of saved decks, with `Delete` button --> |
| 23 | + <!-- List of saved decks, with a Delete button for each --> |
25 | 24 | <ul> |
26 | 25 | <li v-for="deck in savedDecks"> |
27 | 26 | <span class="load-deck" @click="switchDeck(deck)">{{deck.name}}</span> |
28 | | - <input @click="deleteDeck(deck.name)" type="button" value="Delete" class="btn btn-xs btn-danger"/> |
| 27 | + <input @click="deleteDeck(deck.name)" type="button" value="Delete" class="btn btn-sm btn-danger"/> |
29 | 28 | </li> |
30 | 29 | </ul> |
31 | 30 |
|
32 | 31 | <ul> |
33 | 32 | <CardModel :card="cardInfo" v-if="cardInfo"></CardModel> |
34 | 33 | </ul> |
35 | 34 |
|
36 | | - <!-- LIST OF ALL CARDS - Displays one full row below for every card --> |
37 | | - <!-- Available {{card.properties}} values |
38 | | - SERVER JSON name | AngularJS ref name | Note |
39 | | - ------------------------------------------------- |
40 | | - "SICKNESS" | SICKNESS | 1 or 0, or empty (for cards where n/a) |
41 | | - "MANA_COST" | MANA_COST | n, or empty (for cards n/a) |
42 | | - "MANA_UPKEEP" | MANA_UPKEEP | n, or empty (for card n/a) |
43 | | - "ATTACK" | ATTACK | n, or empty (for cards n/a) |
44 | | - "HEALTH" | HEALTH | n, or empty (for cards n/a) |
45 | | - "ATTACK_AVAILABLE" | ATTACK_AVAILABLE | 1, or empty (when explicit 0 n/a) |
46 | | - "flavor" | flavor | flavor, or empty |
47 | | - "name" | name | name (cannot be empty) |
48 | | - "description" | effect | effect, or empty |
49 | | - "type" | creatureType | type, or empty (for non-creatures) |
50 | | - "MAX_HEALTH" | MAX_HEALTH | n, or empty (for cards n/a) |
51 | | - "SCRAP" | SCRAP | n, or empty (for cards n/a) |
52 | | - "SCRAP_COST" | SCRAP_COST | n, or empty (for cards n/a) |
53 | | - --> |
54 | 35 | <table class="deckbuilder-card-table"> |
55 | 36 | <tr> |
56 | 37 | <th>Type</th> |
|
68 | 49 | <td>{{card.properties.creatureType}}</td> |
69 | 50 | <td><a href @click.prevent="showDetails(card)">{{card.properties.name}}</a></td> |
70 | 51 | <td style="text-align: center;"> |
71 | | - <!-- Controls to add or remove a card to deck, and counter to show "current / max" count --> |
| 52 | + <!-- Controls to add or remove a card to deck, and counter to show "current / max" count --> |
72 | 53 | <div class="btn-group"> |
73 | 54 | <!-- MINUS button --> |
74 | 55 | <button @click="decrement(card)" type="button" class="btn btn-xs btn-default fa fa-minus"></button> |
75 | | - <!-- How many cards you selected for this deck, and what the max allowed is --> |
76 | | - <button type="button" class="btn btn-xs btn-default"><b :data-count="currentDeck[card.properties.id]">{{currentDeck[card.properties.id] || 0}} / {{card.max}}</b></button> |
| 56 | + <!-- How many of each card you selected for this deck, and what the max allowed is --> |
| 57 | + <button type="button" class="btn btn-xs btn-default"> |
| 58 | + <span :data-count="currentDeck[card.properties.id]"> |
| 59 | + {{currentDeck[card.properties.id] || 0}} / {{card.max}} |
| 60 | + </span> |
| 61 | + </button> |
77 | 62 | <!-- PLUS button --> |
78 | 63 | <button @click="increment(card)" type="button" class="btn btn-xs btn-default fa fa-plus"></button> |
79 | 64 | </div> |
|
101 | 86 | <td style="text-align: center;"> |
102 | 87 | {{card.properties.effect}} |
103 | 88 | </td> |
104 | | - <td style="text-align: center;"><!-- flavor tooltip --> |
105 | | - <b-btn type="button" class="btn btn-xs btn-default" popover-placement="right" |
106 | | - v-b-popover.hover="card.properties.flavor" |
107 | | - v-if="card.properties.flavor">?</b-btn> |
| 89 | + <td style="text-align: center;"> |
| 90 | + <!-- flavor tooltip --> |
| 91 | + <b-btn v-if="card.properties.flavor" class="btn btn-dark fa fa-book" :id="`${card.id}-flavor`"></b-btn> |
| 92 | + <b-popover :target="`${card.id}-flavor`" |
| 93 | + :title="card.properties.name" |
| 94 | + triggers="hover focus" |
| 95 | + :content="card.properties.flavor" |
| 96 | + placement="right"> |
| 97 | + </b-popover> |
108 | 98 | </td> |
109 | 99 | </tr> |
110 | 100 | </table> |
@@ -264,6 +254,7 @@ export default { |
264 | 254 | switchDeck(deck) { |
265 | 255 | this.currentDeckName = deck.name; |
266 | 256 | this.currentDeck = deck.cards; |
| 257 | + this.deckName = deck.name; |
267 | 258 | }, |
268 | 259 |
|
269 | 260 | /** |
|
0 commit comments