Permalink
Browse files

Explore wildcards needed

  • Loading branch information...
Manuel-777 committed Dec 22, 2018
1 parent bfa9b28 commit 6a4d8659f16cf57a1fcf5de63ac3e57682dd7986
Showing with 50 additions and 8 deletions.
  1. +6 −5 window_background/background.js
  2. +1 −1 window_main/history.js
  3. +26 −0 window_main/index.css
  4. +17 −2 window_main/renderer.js
@@ -476,12 +476,12 @@ ipc.on('request_explore', function (event, arg) {
ipc_send("offline", 1);
}
else {
let cards = store.get('cards.cards');
if (arg == "all" || arg == "All" ) {
httpGetTopDecks("");
httpGetTopDecks("", cards);
}
else {
//arg = arg.replace("_m_", "_m19_");// dirty hack :(
httpGetTopDecks(arg);
httpGetTopDecks(arg, cards);
}
}
});
@@ -1823,9 +1823,10 @@ function httpSetPlayer() {
//httpAsync.push({'reqId': _id, 'method': 'set_player', 'name': name, 'rank': rank, 'tier': tier});
}

function httpGetTopDecks(query) {
function httpGetTopDecks(query, collection) {
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'get_top_decks', 'method_path': '/get_courses_list.php', 'query': query});
collection = JSON.stringify(collection);
httpAsync.push({'reqId': _id, 'method': 'get_top_decks', 'method_path': '/get_courses_list.php', 'query': query, 'collection': collection});
}

function httpGetCourse(courseId) {
@@ -89,7 +89,7 @@ function open_history_tab(loadMore) {
let expected = getStepsUntilNextRank(0, lastWinrate/100);
t = document.createElement("div");
t.classList.add("ranks_history_title");
t.innerHTML = `Games until ${getNextRank(0)}: ${expected}`;
t.innerHTML = `Games until ${getNextRank(0)}: ~${expected}`;
div.appendChild(t);

var wrap_l = document.createElement("div");
@@ -697,6 +697,17 @@ a:hover {
opacity: 0.5;
}

.list_deck_right_it {
-webkit-user-select: none;
line-height: 32px;
margin-left: 8px;
text-align: right;
margin-right: 16px;
color: #FAE5D2;
font-family: Mplantin-italic;
opacity: 0.5;
}

.list_deck_winrate {
-webkit-user-select: none;
margin-left: auto;
@@ -927,6 +938,21 @@ a:hover {
background-repeat: no-repeat;
}

.wc_explore_cost {
font-family: Mplantin;
color: #FAE5D2;
width: 40px;
line-height: 80px;
height: 64px;
text-align: center;
background-position: center 4px;
background-repeat: no-repeat;
}

.wc_explore_cont {

}

.wc_common { background-image: url('../images/wc_common.png'); }
.wc_uncommon { background-image: url('../images/wc_uncommon.png'); }
.wc_rare { background-image: url('../images/wc_rare.png'); }
@@ -1280,14 +1280,29 @@ function setExplore(arg, loadMore) {
var flc = document.createElement("div");
flc.classList.add("flex_item");
flc.style.flexDirection = "column";
flc.style.flexGrow = 1;

var flcf = document.createElement("div");
flcf.classList.add("flex_item");
flcf.style.flexGrow = 2;
flcf.style.flexGrow = 1;
flcf.style.justifyContent = 'center';

let rarityShort = {c: 'common', u: 'uncommon', r: 'rare', m: 'mythic'};
let wc;
for (var key in rarityShort) {
if (_deck.wildcards.hasOwnProperty(key)) {
wc = document.createElement("div");
wc.classList.add("wc_explore_cost");
wc.classList.add("wc_"+rarityShort[key]);
wc.innerHTML = _deck.wildcards[key];
flcf.appendChild(wc);
}
}

var flr = document.createElement("div");
flr.classList.add("flex_item");
flr.style.flexDirection = "column";
flr.style.flexGrow = 1;

var flt = document.createElement("div");
flt.classList.add("flex_top");
@@ -1318,7 +1333,7 @@ function setExplore(arg, loadMore) {
flr.appendChild(d);

d = document.createElement("div");
d.classList.add("list_deck_name_it");
d.classList.add("list_deck_right_it");
let ee = _deck.event;
d.innerHTML = getReadableEvent(ee)+" - "+timeSince(new Date(_deck.date))+" ago";
flr.appendChild(d);

0 comments on commit 6a4d865

Please sign in to comment.