Permalink
Browse files

Color coded missing cards

  • Loading branch information...
Manuel-777 committed Dec 16, 2018
1 parent fa16443 commit 7b312e0cda1cef756aea70586d851b82479727f8
Binary file not shown.
BIN -3.35 KB images/not_owned_2.png
Binary file not shown.
BIN -3.38 KB images/not_owned_3.png
Binary file not shown.
BIN -3.31 KB images/not_owned_4.png
Binary file not shown.
Binary file not shown.
@@ -547,17 +547,14 @@ span {
background: url(../images/not_owned.png) center no-repeat;
}

.not_owned_1 {
background: url(../images/not_owned_1.png) center no-repeat !important;
}
.not_owned_2 {
background: url(../images/not_owned_2.png) center no-repeat !important;
}
.not_owned_3 {
background: url(../images/not_owned_3.png) center no-repeat !important;
}
.not_owned_4 {
background: url(../images/not_owned_4.png) center no-repeat !important;
.not_owned_sprite {
margin-top: 2px;
min-width: 24px;
width: 24px;
height: 24px;
left: calc(0px - 100% + 42px);
position: relative;
background-image: url(../images/not_owned_sprite.png);
}

.decklist_not_owned {
@@ -17,6 +17,7 @@ const enums = {"CounterType":{"1":"+1\/+1","2":"-1\/-1","3":"Poison","4":"Wind",
var setsList = cardsDb.get("sets");
var eventsList = cardsDb.get("events");
var renderer = 0;
var rarities = ["common", "uncommon", "rare", "mythic"];

var draftRanks = [];
draftRanks[12] = "A+";
@@ -112,11 +113,15 @@ function addCardTile(grpId, indent, quantity, element) {
quantity = 4;
}

let xoff = (rarities.indexOf(card.rarity)) * -24;

if (cards[grpId] == undefined) {
cont.append('<div style="left: calc(0px - 100% + '+(ww-14)+'px);" class="not_owned_'+quantity+' card_tile_not_owned" title="'+quantity+' missing"></div>');
let yoff = 4 * -24;
cont.append(`<div style="background-position: ${xoff}px ${yoff}px; left: calc(0px - 100% + ${(ww-14)}px);" class="not_owned_sprite" title="${quantity} missing"></div>`);
}
else if (quantity > cards[grpId]) {
cont.append('<div style="left: calc(0px - 100% + '+(ww-14)+'px);" class="not_owned_'+quantity+' card_tile_not_owned" title="'+(quantity-cards[grpId])+' missing"></div>');
let yoff = (quantity - cards[grpId]) * -24;
cont.append(`<div style="background-position: ${xoff}px ${yoff}px; left: calc(0px - 100% + ${(ww-14)}px);" class="not_owned_sprite" title="${(quantity-cards[grpId])} missing"></div>`);
}
}
}

1 comment on commit 7b312e0

@Manuel-777

This comment has been minimized.

Copy link
Owner

Manuel-777 commented on 7b312e0 Dec 16, 2018

Fixes #127

Please sign in to comment.