feat(webui): show available warframe slots #1027

Closed
Sainan wants to merge 3 commits from webui-slots into main
5 changed files with 12 additions and 4 deletions

View File

@ -29,7 +29,7 @@ export const inventorySlotsController: RequestHandler = async (req, res) => {
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
const currencyChanges = updateCurrency(inventory, 20, true); const currencyChanges = updateCurrency(inventory, 20, true);
updateSlots(inventory, body.Bin, 1, 1); updateSlots(inventory, body.Bin, 0, 1);
await inventory.save(); await inventory.save();
res.json({ InventoryChanges: currencyChanges }); res.json({ InventoryChanges: currencyChanges });

View File

@ -147,7 +147,7 @@
<div class="row g-3"> <div class="row g-3">
<div class="col-lg-6"> <div class="col-lg-6">
<div class="card mb-3" style="height: 400px;"> <div class="card mb-3" style="height: 400px;">
<h5 class="card-header" data-loc="inventory_suits"></h5> <h5 class="card-header"><span data-loc="inventory_suits"></span> <span id="SuitBin" class="badge text-bg-secondary"></span></h5>
<div class="card-body overflow-auto"> <div class="card-body overflow-auto">
<form class="input-group mb-3" onsubmit="doAcquireEquipment('Suits');return false;"> <form class="input-group mb-3" onsubmit="doAcquireEquipment('Suits');return false;">
<input class="form-control" id="acquire-type-Suits" list="datalist-Suits" /> <input class="form-control" id="acquire-type-Suits" list="datalist-Suits" />

View File

@ -356,6 +356,10 @@ function updateInventory() {
}); });
}); });
const SuitBin_totalSlots = (3 + data.SuitBin.Slots + data.SuitBin.Extra);
const SuitBin_usedSlots = data.Suits.length;
document.getElementById("SuitBin").textContent = loc("code_freeSlots").split("|SLOTS|").join(SuitBin_totalSlots - SuitBin_usedSlots);
// Populate mods route // Populate mods route
document.getElementById("riven-list").innerHTML = ""; document.getElementById("riven-list").innerHTML = "";
document.getElementById("mods-list").innerHTML = ""; document.getElementById("mods-list").innerHTML = "";

View File

@ -36,6 +36,7 @@ dict = {
code_focusUnlocked: `Unlocked |COUNT| new focus schools! An inventory update will be needed for the changes to be reflected in-game. Visiting the navigation should be the easiest way to trigger that.`, code_focusUnlocked: `Unlocked |COUNT| new focus schools! An inventory update will be needed for the changes to be reflected in-game. Visiting the navigation should be the easiest way to trigger that.`,
code_addModsConfirm: `Are you sure you want to add |COUNT| mods to your account?`, code_addModsConfirm: `Are you sure you want to add |COUNT| mods to your account?`,
code_succImport: `Successfully imported.`, code_succImport: `Successfully imported.`,
code_freeSlots: `|SLOTS| Slots`,
login_description: `Login using your OpenWF account credentials (same as in-game when connecting to this server).`, login_description: `Login using your OpenWF account credentials (same as in-game when connecting to this server).`,
login_emailLabel: `Email address`, login_emailLabel: `Email address`,
login_passwordLabel: `Password`, login_passwordLabel: `Password`,
@ -125,5 +126,6 @@ dict = {
cheats_quests_resetAll: `Reset All Quests`, cheats_quests_resetAll: `Reset All Quests`,
cheats_quests_giveAll: `Give All Quests`, cheats_quests_giveAll: `Give All Quests`,
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_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` import_submit: `Submit`,
prettier_sucks_ass: ``
}; };

View File

@ -37,6 +37,7 @@ dict = {
code_focusUnlocked: `Разблокировано |COUNT| новых школ фокуса! Для отображения изменений в игре потребуется обновление инвентаря. Посещение навигации — самый простой способ этого добиться.`, code_focusUnlocked: `Разблокировано |COUNT| новых школ фокуса! Для отображения изменений в игре потребуется обновление инвентаря. Посещение навигации — самый простой способ этого добиться.`,
code_addModsConfirm: `Вы уверены, что хотите добавить |COUNT| модов на ваш аккаунт?`, code_addModsConfirm: `Вы уверены, что хотите добавить |COUNT| модов на ваш аккаунт?`,
code_succImport: `Успешно импортировано.`, code_succImport: `Успешно импортировано.`,
code_freeSlots: `[UNTRANSLATED] |SLOTS| Slots`,
login_description: `Войдите, используя учетные данные OpenWF (те же, что и в игре при подключении к этому серверу).`, login_description: `Войдите, используя учетные данные OpenWF (те же, что и в игре при подключении к этому серверу).`,
login_emailLabel: `Адрес электронной почты`, login_emailLabel: `Адрес электронной почты`,
login_passwordLabel: `Пароль`, login_passwordLabel: `Пароль`,
@ -126,5 +127,6 @@ dict = {
cheats_quests_resetAll: `Сбросить прогресс всех квестов`, cheats_quests_resetAll: `Сбросить прогресс всех квестов`,
cheats_quests_giveAll: `Выдать все квесты`, cheats_quests_giveAll: `Выдать все квесты`,
import_importNote: `Вы можете загрузить полный или частичный ответ инвентаря (клиентское представление) здесь. Все поддерживаемые поля <b>будут перезаписаны</b> в вашем аккаунте.`, import_importNote: `Вы можете загрузить полный или частичный ответ инвентаря (клиентское представление) здесь. Все поддерживаемые поля <b>будут перезаписаны</b> в вашем аккаунте.`,
import_submit: `Отправить` import_submit: `Отправить`,
prettier_sucks_ass: ``
}; };