Skip to content
Permalink
Browse files

auto add tags for formats

  • Loading branch information...
Manuel-777 committed Feb 16, 2019
1 parent d280349 commit 4abbc7afc6a60607140a2a25c7c214ecb414abe1
Showing with 19 additions and 0 deletions.
  1. +14 −0 window_background/background.js
  2. +5 −0 window_background/labels.js
@@ -213,6 +213,17 @@ var deck_changes = {};
var decks_tags = {};
var tags_colors = {};

let formats = {
Standard: 'Standard',
TraditionalStandard: 'Traditional Standard',
Pauper: 'Pauper',
Singleton: 'Singleton',
NoInstants: 'No Instants',
Ravnica: 'Ravnica Constructed',
XLN: 'Ixalan Constructed',
Pandemonium: 'Pandemonium'
}

// Begin of IPC messages recievers
function ipc_send(method, arg, to = windowRenderer) {
if (method == "ipc_log") {
@@ -1303,6 +1314,9 @@ function resetGameState() {
//
function checkForStartingLibrary() {
if (gameStage != "GameStage_Start") return;
if (!zones["ZoneType_Hand" + playerSeat].objectInstanceIds) return;
if (!zones["ZoneType_Library" + playerSeat].objectInstanceIds) return;

let hand = zones["ZoneType_Hand" + playerSeat].objectInstanceIds || [];
let library = zones["ZoneType_Library" + playerSeat].objectInstanceIds || [];
// Check that a post-mulligan scry hasn't been done
@@ -633,6 +633,11 @@ function onLabelInDeckGetDeckLists(entry, json) {
json.forEach((deck) => {
let deckId = deck.id;
deck.tags = decks_tags[deckId];
if (!deck.tags) deck.tags = [];
if (deck.tags.indexOf(formats[deck.format]) == -1) {
deck.tags.push(formats[deck.format]);
}

decks[deckId] = deck;
if (decks["index"].indexOf(deckId) == -1) {
decks["index"].push(deck.id);

0 comments on commit 4abbc7a

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