fix(webui): ignore BuildLabel #3005
@@ -271,7 +271,11 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
||||
await inventory.save();
|
||||
|
||||
response.json(
|
||||
await getInventoryResponse(inventory, "xpBasedLevelCapDisabled" in request.query, account.BuildLabel)
|
||||
await getInventoryResponse(
|
||||
inventory,
|
||||
"xpBasedLevelCapDisabled" in request.query,
|
||||
"ignoreBuildLabel" in request.query ? undefined : account.BuildLabel
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -734,7 +734,7 @@ const accountCheats = document.querySelectorAll("#account-cheats input[id]");
|
||||
|
||||
// Assumes that caller revalidates authz
|
||||
function updateInventory() {
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1");
|
||||
req.done(data => {
|
||||
window.itemListPromise.then(itemMap => {
|
||||
window.didInitialInventoryUpdate = true;
|
||||
@@ -2673,7 +2673,7 @@ function addMissingEvolutionProgress() {
|
||||
|
||||
function maxRankAllEvolutions() {
|
||||
revalidateAuthz().then(() => {
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1");
|
||||
req.done(data => {
|
||||
const requests = [];
|
||||
|
||||
@@ -2697,7 +2697,7 @@ function maxRankAllEvolutions() {
|
||||
|
||||
function maxRankAllEquipment(categories) {
|
||||
revalidateAuthz().then(() => {
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1");
|
||||
req.done(data => {
|
||||
window.itemListPromise.then(itemMap => {
|
||||
const batchData = {};
|
||||
@@ -3035,7 +3035,7 @@ function doAcquireRiven() {
|
||||
])
|
||||
}).done(function () {
|
||||
// Get riven's assigned id
|
||||
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(data => {
|
||||
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1").done(data => {
|
||||
for (const rawUpgrade of data.RawUpgrades) {
|
||||
if (rawUpgrade.ItemType === uniqueName) {
|
||||
// Add fingerprint to riven
|
||||
@@ -3259,33 +3259,35 @@ single.getRoute("/webui/cheats").on("beforeload", function () {
|
||||
|
||||
function doUnlockAllFocusSchools() {
|
||||
revalidateAuthz().then(() => {
|
||||
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(async data => {
|
||||
const missingFocusUpgrades = {
|
||||
"/Lotus/Upgrades/Focus/Attack/AttackFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Tactic/TacticFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Ward/WardFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Defense/DefenseFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Power/PowerFocusAbility": true
|
||||
};
|
||||
if (data.FocusUpgrades) {
|
||||
for (const focusUpgrade of data.FocusUpgrades) {
|
||||
if (focusUpgrade.ItemType in missingFocusUpgrades) {
|
||||
delete missingFocusUpgrades[focusUpgrade.ItemType];
|
||||
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1").done(
|
||||
async data => {
|
||||
const missingFocusUpgrades = {
|
||||
"/Lotus/Upgrades/Focus/Attack/AttackFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Tactic/TacticFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Ward/WardFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Defense/DefenseFocusAbility": true,
|
||||
"/Lotus/Upgrades/Focus/Power/PowerFocusAbility": true
|
||||
};
|
||||
if (data.FocusUpgrades) {
|
||||
for (const focusUpgrade of data.FocusUpgrades) {
|
||||
if (focusUpgrade.ItemType in missingFocusUpgrades) {
|
||||
delete missingFocusUpgrades[focusUpgrade.ItemType];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const upgradeType of Object.keys(missingFocusUpgrades)) {
|
||||
await unlockFocusSchool(upgradeType);
|
||||
}
|
||||
if (Object.keys(missingFocusUpgrades).length == 0) {
|
||||
toast(loc("code_focusAllUnlocked"));
|
||||
} else {
|
||||
toast(loc("code_focusUnlocked").split("|COUNT|").join(Object.keys(missingFocusUpgrades).length));
|
||||
if (ws_is_open) {
|
||||
window.ws.send(JSON.stringify({ sync_inventory: true }));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const upgradeType of Object.keys(missingFocusUpgrades)) {
|
||||
await unlockFocusSchool(upgradeType);
|
||||
}
|
||||
if (Object.keys(missingFocusUpgrades).length == 0) {
|
||||
toast(loc("code_focusAllUnlocked"));
|
||||
} else {
|
||||
toast(loc("code_focusUnlocked").split("|COUNT|").join(Object.keys(missingFocusUpgrades).length));
|
||||
if (ws_is_open) {
|
||||
window.ws.send(JSON.stringify({ sync_inventory: true }));
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3403,7 +3405,7 @@ function doAddAllMods() {
|
||||
modsAll.delete("/Lotus/Upgrades/Mods/Fusers/LegendaryModFuser");
|
||||
|
||||
revalidateAuthz().then(() => {
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1");
|
||||
req.done(data => {
|
||||
for (const modOwned of data.RawUpgrades) {
|
||||
if ((modOwned.ItemCount ?? 1) > 0) {
|
||||
@@ -3435,7 +3437,7 @@ function doAddAllMods() {
|
||||
|
||||
function doRemoveUnrankedMods() {
|
||||
revalidateAuthz().then(() => {
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1&ignoreBuildLabel=1");
|
||||
req.done(inventory => {
|
||||
window.itemListPromise.then(itemMap => {
|
||||
$.post({
|
||||
|
||||
Reference in New Issue
Block a user