Merge branch 'dev'

This commit is contained in:
Daniël van Noord
2021-02-18 23:57:27 +01:00
2 changed files with 48 additions and 44 deletions

File diff suppressed because one or more lines are too long

View File

@@ -2752,49 +2752,53 @@ CM.Disp.CreateStatsPrestigeSection = function() {
* It is called by CM.Disp.AddMenuStats() when CM.Options.MissingUpgrades is set * It is called by CM.Disp.AddMenuStats() when CM.Options.MissingUpgrades is set
*/ */
CM.Disp.AddMissingUpgrades = function() { CM.Disp.AddMissingUpgrades = function() {
if (CM.Cache.MissingUpgradesPrestige) { for (let menuSection of (l('menu').children)) {
var prestigeUpgradesOwned = Game.PrestigeUpgrades.length - l('menu').children[5].children[3].children.length; if (menuSection.children[0]) {
let title = document.createElement('div'); if (menuSection.children[0].innerHTML === "Prestige" && CM.Cache.MissingUpgradesPrestige) {
title.id = "CMMissingUpgradesPrestigeTitle"; let prestigeUpgradesMissing = CM.Cache.MissingUpgradesPrestige.match(new RegExp("div", "g") || []).length / 2;
title.className = "listing"; let title = document.createElement('div');
let titlefrag = document.createElement('div'); title.id = "CMMissingUpgradesPrestigeTitle";
titlefrag.innerHTML = '<b>Missing Prestige upgrades:</b> '+ prestigeUpgradesOwned + '/' + Game.PrestigeUpgrades.length + ' (' + Math.floor((prestigeUpgradesOwned / Game.PrestigeUpgrades.length) * 100) + '%)'; title.className = "listing";
title.appendChild(titlefrag); let titlefrag = document.createElement('div');
l('menu').children[5].appendChild(title); titlefrag.innerHTML = '<b>Missing Prestige upgrades:</b> '+ prestigeUpgradesMissing + '/' + Game.PrestigeUpgrades.length + ' (' + Math.floor((prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100) + '%)';
let upgrades = document.createElement('div'); title.appendChild(titlefrag);
upgrades.className = "listing crateBox"; menuSection.appendChild(title);
upgrades.innerHTML = CM.Cache.MissingUpgradesPrestige; let upgrades = document.createElement('div');
l('menu').children[5].appendChild(upgrades); upgrades.className = "listing crateBox";
} upgrades.innerHTML = CM.Cache.MissingUpgradesPrestige;
if (CM.Cache.MissingUpgrades) { menuSection.appendChild(upgrades);
let normalUpgradesOwned = 0; }
if (Game.UpgradesOwned) normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool.tech.length - l('menu').children[6].childNodes[2].children.length; else if (menuSection.children[0].innerHTML === "Upgrades") {
let title = document.createElement('div'); if (CM.Cache.MissingUpgrades) {
title.id = "CMMissingUpgradesTitle"; let normalUpgradesMissing = CM.Cache.MissingUpgrades.match(new RegExp("div", "g") || []).length / 2;
title.className = "listing"; let title = document.createElement('div');
let titlefrag = document.createElement('div'); title.id = "CMMissingUpgradesTitle";
titlefrag.innerHTML = '<b>Missing normal upgrades:</b> '+ normalUpgradesOwned + '/' + (Game.UpgradesByPool[""].length + Game.UpgradesByPool.tech.length) + ' (' + Math.floor((normalUpgradesOwned / ( Game.UpgradesByPool[""].length + Game.UpgradesByPool.tech.length)) * 100) + '%)'; title.className = "listing";
title.appendChild(titlefrag); let titlefrag = document.createElement('div');
l('menu').children[6].insertBefore(title, l('menu').children[6].childNodes[3]); titlefrag.innerHTML = '<b>Missing normal upgrades:</b> '+ normalUpgradesMissing + '/' + (Game.UpgradesByPool[""].length + Game.UpgradesByPool.tech.length) + ' (' + Math.floor((normalUpgradesMissing / ( Game.UpgradesByPool[""].length + Game.UpgradesByPool.tech.length)) * 100) + '%)';
let upgrades = document.createElement('div'); title.appendChild(titlefrag);
upgrades.className = "listing crateBox"; menuSection.insertBefore(title, menuSection.childNodes[3]);
upgrades.innerHTML = CM.Cache.MissingUpgrades; let upgrades = document.createElement('div');
l('menu').children[6].insertBefore(upgrades, document.getElementById("CMMissingUpgradesTitle").nextSibling); upgrades.className = "listing crateBox";
} upgrades.innerHTML = CM.Cache.MissingUpgrades;
if (CM.Cache.MissingUpgradesCookies) { menuSection.insertBefore(upgrades, document.getElementById("CMMissingUpgradesTitle").nextSibling);
var cookieUpgradesOwned = Game.UpgradesByPool.cookie.length - l('menu').children[6].lastChild.children.length; }
let title = document.createElement('div'); if (CM.Cache.MissingUpgradesCookies) {
title.id = "CMMissingUpgradesCookiesTitle"; let cookieUpgradesMissing = CM.Cache.MissingUpgradesCookies.match(new RegExp("div", "g") || []).length / 2;
title.className = "listing"; let title = document.createElement('div');
let titlefrag = document.createElement('div'); title.id = "CMMissingUpgradesCookiesTitle";
titlefrag.innerHTML = '<b>Missing Cookie upgrades:</b> '+ cookieUpgradesOwned + '/' + Game.UpgradesByPool.cookie.length + ' (' + Math.floor((cookieUpgradesOwned / Game.UpgradesByPool.cookie.length) * 100) + '%)'; title.className = "listing";
title.appendChild(titlefrag); let titlefrag = document.createElement('div');
l('menu').children[6].appendChild(title); titlefrag.innerHTML = '<b>Missing Cookie upgrades:</b> '+ cookieUpgradesMissing + '/' + Game.UpgradesByPool.cookie.length + ' (' + Math.floor((cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100) + '%)';
let upgrades = document.createElement('div'); title.appendChild(titlefrag);
upgrades.className = "listing crateBox"; menuSection.appendChild(title);
upgrades.innerHTML = CM.Cache.MissingUpgradesCookies; let upgrades = document.createElement('div');
l('menu').children[6].appendChild(upgrades); upgrades.className = "listing crateBox";
upgrades.innerHTML = CM.Cache.MissingUpgradesCookies;
menuSection.appendChild(upgrades);
}
}
}
} }
}; };