Skip to content
Permalink
Browse files

Explore rework

  • Loading branch information...
Manuel-777 committed Mar 27, 2019
1 parent a738578 commit ab1067241c55cd712ddbf8b7d642359754e062f6
Showing with 723 additions and 559 deletions.
  1. +1 −0 shared/util.js
  2. +1 −9 window_background/background.js
  3. +24 −6 window_background/http-api.js
  4. +567 −525 window_main/explore.js
  5. +114 −13 window_main/index.css
  6. +16 −6 window_main/renderer.js
@@ -610,6 +610,7 @@ const enums = {
var setsList = cardsDb.get("sets");
var eventsList = cardsDb.get("events");
var eventsToFormat = cardsDb.get("events_format");
var rankedEvents = cardsDb.get("ranked_events");
var renderer = 0;
var rarities = ["common", "uncommon", "rare", "mythic"];

@@ -510,15 +510,7 @@ ipc.on("request_explore", function(event, arg) {
ipc_send("offline", 1);
} else {
let cards = store.get("cards.cards");
if (arg == "all" || arg == "All") {
httpApi.httpGetTopDecks("", cards);
} else if (arg == "Ranked Ladder") {
httpApi.httpGetTopLadderDecks();
} else if (arg == "Traditional Ranked Ladder") {
httpApi.httpGetTopLadderTraditionalDecks();
} else {
httpApi.httpGetTopDecks(arg, cards);
}
httpApi.httpGetExplore(arg, cards);
}
});

@@ -218,7 +218,10 @@ function httpBasic() {
try {
parsedResult = JSON.parse(results);
} catch (e) {
//
ipc_send("popup", {
text: `Error parsing response. (${_headers.method})`,
time: 2000
});
}

if (_headers.method == "get_status") {
@@ -235,6 +238,9 @@ function httpBasic() {
});
ipc_send("set_status", parsedResult);
}
if (_headers.method == "get_explore") {
ipc_send("set_explore_decks", parsedResult);
}
if (_headers.method == "get_ladder_decks") {
ipc_send("set_ladder_decks", parsedResult);
}
@@ -447,14 +453,25 @@ function httpSetPlayer() {
//httpAsync.push({'reqId': _id, 'method': 'set_player', 'name': name, 'rank': rank, 'tier': tier});
}

function httpGetTopDecks(query, collection) {
function httpGetExplore(query, collection) {
var _id = makeId(6);
collection = JSON.stringify(collection);
httpAsync.unshift({
reqId: _id,
method: "get_top_decks",
method_path: "/api/get_courses_list.php",
query: query,
method: "get_explore",
method_path: "/api/get_explore.php",
filter_wcc: query.filterWCC,
filter_wcu: query.filterWCU,
filter_wcr: query.filterWCR,
filter_wcm: query.filterWCM,
filter_owned: query.onlyOwned,
filter_type: query.filterType,
filter_event: query.filterEvent,
filter_sort: query.filterSort,
filter_sortdir: query.filterSortDir,
filter_mana: query.filteredMana,
filter_ranks: query.filteredranks,
filter_skip: query.filterSkip,
collection: collection
});
}
@@ -476,6 +493,7 @@ function httpGetTopLadderTraditionalDecks() {
method_path: "/top_ladder_traditional.json"
});
}

function httpGetCourse(courseId) {
var _id = makeId(6);
httpAsync.unshift({
@@ -657,7 +675,7 @@ module.exports = {
httpAuth,
httpSubmitCourse,
httpSetPlayer,
httpGetTopDecks,
httpGetExplore,
httpGetTopLadderDecks,
httpGetTopLadderTraditionalDecks,
httpGetCourse,
Oops, something went wrong.

0 comments on commit ab10672

Please sign in to comment.
You can’t perform that action at this time.