feat(webui): change SupportedSyndicate
All checks were successful
Build / build (22) (pull_request) Successful in 35s
Build / build (18) (pull_request) Successful in 57s
Build / build (20) (pull_request) Successful in 1m19s

Closes #829
This commit is contained in:
AMelonInsideLemon 2025-02-07 18:20:33 +01:00
parent 079f9ebbdf
commit cf00a91b1e
5 changed files with 44 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {
ExportRecipes,
ExportResources,
ExportSentinels,
ExportSyndicates,
ExportUpgrades,
ExportWarframes,
ExportWeapons
@ -36,6 +37,7 @@ const getItemListsController: RequestHandler = (req, response) => {
res.SpaceSuits = [];
res.MechSuits = [];
res.miscitems = [];
res.Syndicates = [];
for (const [uniqueName, item] of Object.entries(ExportWarframes)) {
if (
item.productCategory == "Suits" ||
@ -160,6 +162,12 @@ const getItemListsController: RequestHandler = (req, response) => {
badItems[uniqueName] = true;
}
}
for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
res.Syndicates.push({
uniqueName,
name: getString(syndicate.name, lang)
});
}
response.json({
badItems,

View File

@ -465,6 +465,11 @@
<div class="card-body">
<p><button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button></p>
<button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
<form class="input-group mt-2" onsubmit="doChangeSupportedSyndicate();return false;">
<label class="form-label" for="changeSyndicate" data-loc="cheats_changeSupportedSyndicate"></label>
<input class="form-control w-50" id="changeSyndicate" list="datalist-Syndicates" />
<button class="btn btn-primary" type="submit" data-loc="cheats_changeButton"></button>
</form>
</div>
</div>
</div>
@ -489,6 +494,7 @@
<datalist id="datalist-ModularParts"></datalist>
<datalist id="datalist-MechSuits"></datalist>
<datalist id="datalist-miscitems"></datalist>
<datalist id="datalist-Syndicates"></datalist>
<datalist id="datalist-mods">
<option data-key="/Lotus/Upgrades/Mods/Fusers/LegendaryModFuser" value="Legendary Core"></option>
<option data-key="/Lotus/Upgrades/CosmeticEnhancers/Peculiars/CyoteMod" value="Traumatic Peculiar"></option>

View File

@ -191,6 +191,15 @@ function fetchItemList() {
});
} else if (type == "uniqueLevelCaps") {
uniqueLevelCaps = items;
} else if (type == "Syndicates") {
items.forEach(item => {
if (item.uniqueName.startsWith("RadioLegion")) item.name += " (" + item.uniqueName + ")";
const option = document.createElement("option");
option.setAttribute("data-key", item.uniqueName);
option.value = item.name;
document.getElementById("datalist-" + type).appendChild(option);
itemMap[item.uniqueName] = { ...item, type };
});
} else if (type != "badItems") {
items.forEach(item => {
if (item.uniqueName in data.badItems) {
@ -524,6 +533,10 @@ function updateInventory() {
single.loadRoute("/webui/inventory");
}
}
document.querySelector("label[for='changeSyndicate']").innerText = loc("cheats_changeSupportedSyndicate")
.split("|SYNDICATE|")
.join(itemMap[data.SupportedSyndicate]?.name || loc("cheats_none"));
});
});
}
@ -1096,3 +1109,13 @@ function doImport() {
});
});
}
function doChangeSupportedSyndicate() {
const uniqueName = getKey(document.getElementById("changeSyndicate")) ?? "";
revalidateAuthz(() => {
$.get("/api/setSupportedSyndicate.php?" + window.authz + "&syndicate=" + uniqueName).done(function () {
document.getElementById("changeSyndicate").value = "";
updateInventory();
});
});
}

View File

@ -106,6 +106,9 @@ dict = {
cheats_account: `Account`,
cheats_unlockAllFocusSchools: `Unlock All Focus Schools`,
cheats_helminthUnlockAll: `Fully Level Up Helminth`,
cheats_changeSupportedSyndicate: `Change supported syndicate. Current: |SYNDICATE|`,
cheats_changeButton: `Change`,
cheats_none: `None`,
import_importNote: `You can provide a full or partial inventory response (client respresentation) here. All fields that are supported by the importer <b>will be overwritten</b> in your account.`,
import_submit: `Submit`,
}

View File

@ -107,6 +107,9 @@ dict = {
cheats_account: `Аккаунт`,
cheats_unlockAllFocusSchools: `Разблокировать все школы фокуса`,
cheats_helminthUnlockAll: `Полностью улучшить Гельминта`,
cheats_changeSupportedSyndicate: `Изменить поддерживаемый синдикат. Текущий: |SYNDICATE|`,
cheats_changeButton: `Изменить`,
cheats_none: `Отсутствует`,
import_importNote: `Вы можете загрузить полный или частичный ответ инвентаря (клиентское представление) здесь. Все поддерживаемые поля <b>будут перезаписаны</b> в вашем аккаунте.`,
import_submit: `Отправить`,
}