Permalink
Browse files

Handle rank updates

  • Loading branch information...
Manuel-777 committed Feb 1, 2019
1 parent 6b60a37 commit 741699bc87cec5fdc1f841c078185807e8bb5f32
Showing with 23 additions and 0 deletions.
  1. +6 −0 window_background/background.js
  2. +17 −0 window_background/labels.js
@@ -822,6 +822,12 @@ function onLogEntryFound(entry) {
}
break;

case "Rank.Updated": {
json = entry.json();
onLabelRankUpdated(entry, json);
}
break;

case "Event.GetPlayerCourses":
if (entry.arrow == "<==") {
json = entry.json();
@@ -595,6 +595,23 @@ function onLabelInEventGetCombinedRankInfo(entry, json) {
updateRank();
}

function onLabelRankUpdated(entry, json) {
if (!json) return;

if (json.rankUpdateType == "Constructed") {
playerConstructedRank = json.newClass;
playerConstructedTier = json.newLevel;
playerConstructedStep = json.newStep;
}
else {
playerLimitedRank = json.newClass;
playerLimitedTier = json.newLevel;
playerLimitedStep = json.newStep;
}

updateRank();
}

function onLabelInDeckGetDeckLists(entry, json) {
if (!json) return;

0 comments on commit 741699b

Please sign in to comment.