Permalink
Browse files

Cards ratings in draft replay

  • Loading branch information...
Manuel-777 committed Nov 3, 2018
1 parent eadab4d commit 2c30fd7addda16a2750a3ee37b1fb98b34d5772e
Showing with 32 additions and 15 deletions.
  1. +15 −0 shared/util.js
  2. +15 −0 window_main/index.css
  3. +2 −0 window_main/renderer.js
  4. +0 −15 window_overlay/overlay.js
@@ -7,6 +7,21 @@ const enums = {"CounterType":{"1":"+1\/+1","2":"-1\/-1","3":"Poison","4":"Wind",
var setsList = cardsDb.get("sets");
var eventsList = cardsDb.get("events");
var draftRanks = [];
draftRanks[12] = "A+";
draftRanks[11] = "A";
draftRanks[10] = "A-";
draftRanks[9] = "B+";
draftRanks[8] = "B";
draftRanks[7] = "B-";
draftRanks[6] = "C+";
draftRanks[5] = "C";
draftRanks[4] = "C-";
draftRanks[3] = "D+";
draftRanks[2] = "D";
draftRanks[1] = "D-";
draftRanks[0] = "F";
//
function addCardTile(grpId, indent, quantity, element) {
if (quantity !== 0) {
@@ -1372,6 +1372,21 @@ a:hover {
-webkit-border-radius: 7% / 6%;
}
.draft_card_rating {
width: 32px;
font-size: 13px;
height: 24px;
line-height: 24px;
text-align: center;
color: #ffffff;
border-radius: 8px;
border: solid 1px rgba(250, 229, 210, 0.8);
background-color: rgba(145, 121, 97, 0.75);
position: relative;
top: -24px;
left: calc(50% - 16px);
}
.draft_card_img:hover {
border: 2px solid rgba(250, 229, 210, 0.66);
margin: -2px 0 -2px -2px;
@@ -2712,6 +2712,8 @@ function open_draft(id, tileGrpid, set) {
img.attr("src", "https://img.scryfall.com/cards"+card.images[cardQuality]);
img.appendTo(d);
var r = $('<div style="" class="draft_card_rating">'+draftRanks[card.rank]+'</div>');
r.appendTo(d);
addCardHover(img, card);
d.appendTo(pd);
});
@@ -368,21 +368,6 @@ ipc.on("set_turn", function (event, _we, _phase, _step, _number, _active, _prior
}
});
var draftRanks = [];
draftRanks[12] = "A+";
draftRanks[11] = "A";
draftRanks[10] = "A-";
draftRanks[9] = "B+";
draftRanks[8] = "B";
draftRanks[7] = "B-";
draftRanks[6] = "C+";
draftRanks[5] = "C";
draftRanks[4] = "C-";
draftRanks[3] = "D+";
draftRanks[2] = "D";
draftRanks[1] = "D-";
draftRanks[0] = "F";
function setDraft() {
$(".overlay_decklist").html('');
$(".overlay_deckcolors").html('');

0 comments on commit 2c30fd7

Please sign in to comment.