diff --git a/src/scripts/mainWindow.js b/src/scripts/mainWindow.js index 63f1b30..457f700 100644 --- a/src/scripts/mainWindow.js +++ b/src/scripts/mainWindow.js @@ -33,6 +33,7 @@ eventEmitter.addEventListener("refresh-window", function (window) { }); function setLastPlayedCharacter(lastPlayed) { + return; let lastPlayedClass = document.querySelector("#lastPlayedClass"); let lastPlayedTotalTime = document.querySelector("#lastPlayedTotalTime"); @@ -80,6 +81,12 @@ async function loadSettings() { "d2-visible-items" ); + document.getElementById("trackSeasonRank").checked = JSON.parse( + ((await db.getItem("d2-track-seasonrank")) ?? "true").toString() + ) + ? "checked" + : ""; + document.getElementById("trackMilestones").checked = JSON.parse( ((await db.getItem("d2-track-milestones")) ?? "true").toString() ) @@ -198,6 +205,16 @@ function bindExitButtonEvent(window) { ); }); + document + .getElementById("trackSeasonRank") + .addEventListener("change", async function (event) { + let checked = event.target.checked; + + await db.setItem("d2-track-seasonrank", checked); + + eventEmitter.emit("tracked-items-changed"); + }); + document .getElementById("trackMilestones") .addEventListener("change", async function (event) { diff --git a/src/scripts/overlayWindow.js b/src/scripts/overlayWindow.js index ec56e92..8c17c9f 100644 --- a/src/scripts/overlayWindow.js +++ b/src/scripts/overlayWindow.js @@ -113,6 +113,9 @@ async function updateGoalList(goals) { case "characterRecord": addGoal = window.trackingItems.records; break; + case "seasonrank": + addGoal = window.trackingItems.seasonRank; + break; } if (addGoal) { @@ -142,6 +145,7 @@ async function loadSettings() { bounties: JSON.parse((await db.getItem("d2-track-bounties")) ?? true), quests: JSON.parse((await db.getItem("d2-track-quests")) ?? true), records: JSON.parse((await db.getItem("d2-track-records")) ?? true), + seasonRank: JSON.parse((await db.getItem("d2-track-seasonrank")) ?? true), }; }