feat(webui): equipment features in detailed view #2987

Merged
Sainan merged 4 commits from AMelonInsideLemon/SpaceNinjaServer:webui-equipment-features into main 2025-11-06 00:16:59 -08:00
8 changed files with 71 additions and 109 deletions
Showing only changes of commit 0e75700658 - Show all commits

View File

@@ -1560,7 +1560,8 @@ function updateInventory() {
const buttonsCard = document.getElementById("equipmentFeaturesButtons-card");
buttonsCard.innerHTML = "";
item.Features ??= 0;
const bits = [1];
const bits = [];
if (category != "OperatorAmps") bits.push(1);
if (["Suits", "LongGuns", "Pistols", "Melee"].includes(category)) bits.push(2);
if (modularWeapons.includes(item.ItemType)) bits.push(8);
if (["LongGuns", "Pistols", "Melee", "SpaceGuns", "OperatorAmps"].includes(category))
@@ -1572,14 +1573,22 @@ function updateInventory() {
)
bits.push(1024);
for (const bit of bits.sort((a, b) => a - b)) {
const isRemove = item.Features & bit;
const button = document.createElement("button");
button.classList = isRemove ? "btn btn-danger" : "btn btn-primary";
button.href = "#";
const locale = isRemove ? `code_removeFeature_${bit}` : `code_addFeature_${bit}`;
button.setAttribute("data-loc", locale);
button.innerHTML = loc(locale);
button.onclick = function (event) {
const wrapper = document.createElement("div");
wrapper.classList = "form-check";
const input = document.createElement("input");
input.classList = "form-check-input";
input.type = "checkbox";
input.id = `detailedView-feature-${bit}`;
input.checked = item.Features & bit;
const label = document.createElement("label");
label.classList = "form-check-label";
label.htmlFor = input.id;
label.innerHTML = loc(`code_feature_${bit}`);
label.setAttribute("data-loc", `code_feature_${bit}`);
input.onchange = function (event) {
event.preventDefault();
equipmentFeatures(category, oid, bit);
};
@@ -1588,10 +1597,12 @@ function updateInventory() {
(data.unlockExilusEverywhere && bit === 2) ||
(data.unlockArcanesEverywhere && (bit === 32 || bit === 64))
) {
button.disabled = true;
input.disabled = true;
}
buttonsCard.appendChild(button);
wrapper.appendChild(input);
wrapper.appendChild(label);
buttonsCard.appendChild(wrapper);
}
}

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `Operator-Gesicht: |INDEX|`,
code_succChange: `Erfolgreich geändert.`,
code_requiredInvigorationUpgrade: `Du musst sowohl ein Offensiv- als auch ein Support-Upgrade auswählen.`,
code_addFeature_1: `[UNTRANSLATED] Install Orokin Reactor`,
code_addFeature_2: `[UNTRANSLATED] Unlock Exilus slot`,
code_addFeature_4: `[UNTRANSLATED] Install Gravimag`,
code_addFeature_8: `[UNTRANSLATED] Gild Weapon`,
code_addFeature_32: `[UNTRANSLATED] Unlock Arcane slot`,
code_addFeature_64: `[UNTRANSLATED] Unlock Second Arcane slot`,
code_addFeature_1024: `[UNTRANSLATED] Unlock Valence Override`,
code_removeFeature_1: `[UNTRANSLATED] Remove Orokin Reactor`,
code_removeFeature_2: `[UNTRANSLATED] Lock Exilus slot`,
code_removeFeature_4: `[UNTRANSLATED] Remove Gravimag`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `[UNTRANSLATED] Lock Arcane slot`,
code_removeFeature_64: `[UNTRANSLATED] Lock Second Arcane slot`,
code_removeFeature_1024: `[UNTRANSLATED] Lock Valence Override`,
code_feature_1: `[UNTRANSLATED] Orokin Reactor`,
code_feature_2: `[UNTRANSLATED] Exilus Adapter`,
code_feature_4: `[UNTRANSLATED] Gravimag`,
code_feature_8: `[UNTRANSLATED] Gild`,
code_feature_32: `[UNTRANSLATED] Arcane slot`,
code_feature_64: `[UNTRANSLATED] Second Arcane slot`,
code_feature_1024: `[UNTRANSLATED] Valence Override`,
login_description: `Melde dich mit deinem OpenWF-Account an (denselben Angaben wie im Spiel, wenn du dich mit diesem Server verbindest).`,
login_emailLabel: `E-Mail-Adresse`,
login_passwordLabel: `Passwort`,

View File

@@ -80,20 +80,13 @@ dict = {
code_operatorFaceName: `Operator Visage |INDEX|`,
code_succChange: `Successfully changed.`,
code_requiredInvigorationUpgrade: `You must select both an offensive & utility upgrade.`,
code_addFeature_1: `Install Orokin Reactor`,
code_addFeature_2: `Unlock Exilus slot`,
code_addFeature_4: `Install Gravimag`,
code_addFeature_8: `Gild Weapon`,
code_addFeature_32: `Unlock Arcane slot`,
code_addFeature_64: `Unlock Second Arcane slot`,
code_addFeature_1024: `Unlock Valence Override`,
code_removeFeature_1: `Remove Orokin Reactor`,
code_removeFeature_2: `Lock Exilus slot`,
code_removeFeature_4: `Remove Gravimag`,
code_removeFeature_8: `Ungild Weapon`,
code_removeFeature_32: `Lock Arcane slot`,
code_removeFeature_64: `Lock Second Arcane slot`,
code_removeFeature_1024: `Lock Valence Override`,
code_feature_1: `Orokin Reactor`,
code_feature_2: `Exilus Adapter`,
code_feature_4: `Gravimag`,
code_feature_8: `Gild`,
code_feature_32: `Arcane slot`,
code_feature_64: `Second Arcane slot`,
code_feature_1024: `Valence Override`,
login_description: `Login using your OpenWF account credentials (same as in-game when connecting to this server).`,
login_emailLabel: `Email address`,
login_passwordLabel: `Password`,

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `Rostro del operador |INDEX|`,
code_succChange: `Cambiado correctamente`,
code_requiredInvigorationUpgrade: `Debes seleccionar una mejora ofensiva y una mejora de utilidad.`,
code_addFeature_1: `[UNTRANSLATED] Install Orokin Reactor`,
code_addFeature_2: `[UNTRANSLATED] Unlock Exilus slot`,
code_addFeature_4: `[UNTRANSLATED] Install Gravimag`,
code_addFeature_8: `[UNTRANSLATED] Gild Weapon`,
code_addFeature_32: `[UNTRANSLATED] Unlock Arcane slot`,
code_addFeature_64: `[UNTRANSLATED] Unlock Second Arcane slot`,
code_addFeature_1024: `[UNTRANSLATED] Unlock Valence Override`,
code_removeFeature_1: `[UNTRANSLATED] Remove Orokin Reactor`,
code_removeFeature_2: `[UNTRANSLATED] Lock Exilus slot`,
code_removeFeature_4: `[UNTRANSLATED] Remove Gravimag`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `[UNTRANSLATED] Lock Arcane slot`,
code_removeFeature_64: `[UNTRANSLATED] Lock Second Arcane slot`,
code_removeFeature_1024: `[UNTRANSLATED] Lock Valence Override`,
code_feature_1: `[UNTRANSLATED] Orokin Reactor`,
code_feature_2: `[UNTRANSLATED] Exilus Adapter`,
code_feature_4: `[UNTRANSLATED] Gravimag`,
code_feature_8: `[UNTRANSLATED] Gild`,
code_feature_32: `[UNTRANSLATED] Arcane slot`,
code_feature_64: `[UNTRANSLATED] Second Arcane slot`,
code_feature_1024: `[UNTRANSLATED] Valence Override`,
login_description: `Inicia sesión con las credenciales de tu cuenta OpenWF (las mismas que usas en el juego al conectarte a este servidor).`,
login_emailLabel: `Dirección de correo electrónico`,
login_passwordLabel: `Contraseña`,

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `Visage de l'Opérateur |INDEX|`,
code_succChange: `Changement effectué.`,
code_requiredInvigorationUpgrade: `Invigoration offensive et défensive requises.`,
code_addFeature_1: `[UNTRANSLATED] Install Orokin Reactor`,
code_addFeature_2: `[UNTRANSLATED] Unlock Exilus slot`,
code_addFeature_4: `[UNTRANSLATED] Install Gravimag`,
code_addFeature_8: `[UNTRANSLATED] Gild Weapon`,
code_addFeature_32: `[UNTRANSLATED] Unlock Arcane slot`,
code_addFeature_64: `[UNTRANSLATED] Unlock Second Arcane slot`,
code_addFeature_1024: `[UNTRANSLATED] Unlock Valence Override`,
code_removeFeature_1: `[UNTRANSLATED] Remove Orokin Reactor`,
code_removeFeature_2: `[UNTRANSLATED] Lock Exilus slot`,
code_removeFeature_4: `[UNTRANSLATED] Remove Gravimag`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `[UNTRANSLATED] Lock Arcane slot`,
code_removeFeature_64: `[UNTRANSLATED] Lock Second Arcane slot`,
code_removeFeature_1024: `[UNTRANSLATED] Lock Valence Override`,
code_feature_1: `[UNTRANSLATED] Orokin Reactor`,
code_feature_2: `[UNTRANSLATED] Exilus Adapter`,
code_feature_4: `[UNTRANSLATED] Gravimag`,
code_feature_8: `[UNTRANSLATED] Gild`,
code_feature_32: `[UNTRANSLATED] Arcane slot`,
code_feature_64: `[UNTRANSLATED] Second Arcane slot`,
code_feature_1024: `[UNTRANSLATED] Valence Override`,
login_description: `Connexion avec les informations de connexion OpenWF.`,
login_emailLabel: `Email`,
login_passwordLabel: `Mot de passe`,

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `Внешность оператора: |INDEX|`,
code_succChange: `Успешно изменено.`,
code_requiredInvigorationUpgrade: `Вы должны выбрать как атакующее, так и вспомогательное улучшение.`,
code_addFeature_1: `Установить Реактор Орокин`,
code_addFeature_2: `Разблокировать Эксилус слот`,
code_addFeature_4: `Установить Гравимаг`,
code_addFeature_8: `Улучшить Оружие`,
code_addFeature_32: `Разблокировать слот Мистификатора`,
code_addFeature_64: `Разблокировать Второй слот Мистификатора`,
code_addFeature_1024: `Разблокировать Переопределение валентности`,
code_removeFeature_1: `Удалить Реактор Орокин`,
code_removeFeature_2: `Заблокировать Эксилус слот`,
code_removeFeature_4: `Удалить Гравимаг`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `Заблокировать слот Мистификатора`,
code_removeFeature_64: `Заблокировать Второй слот Мистификатора`,
code_removeFeature_1024: `Заблокировать Переопределение валентности`,
code_feature_1: `Реактор Орокин`,
code_feature_2: `Адаптер Эксилус`,
code_feature_4: `Гравимаг`,
code_feature_8: `Улучшение`,
code_feature_32: `Слот Мистификатора`,
code_feature_64: `Второй слот Мистификатора`,
code_feature_1024: `Переопределение валентности`,
login_description: `Войдите, используя учетные данные OpenWF (те же, что и в игре при подключении к этому серверу).`,
login_emailLabel: `Адрес электронной почты`,
login_passwordLabel: `Пароль`,

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `Зовнішність оператора: |INDEX|`,
code_succChange: `Успішно змінено.`,
code_requiredInvigorationUpgrade: `Ви повинні вибрати як атакуюче, так і допоміжне вдосконалення.`,
code_addFeature_1: `[UNTRANSLATED] Install Orokin Reactor`,
code_addFeature_2: `[UNTRANSLATED] Unlock Exilus slot`,
code_addFeature_4: `[UNTRANSLATED] Install Gravimag`,
code_addFeature_8: `[UNTRANSLATED] Gild Weapon`,
code_addFeature_32: `[UNTRANSLATED] Unlock Arcane slot`,
code_addFeature_64: `[UNTRANSLATED] Unlock Second Arcane slot`,
code_addFeature_1024: `[UNTRANSLATED] Unlock Valence Override`,
code_removeFeature_1: `[UNTRANSLATED] Remove Orokin Reactor`,
code_removeFeature_2: `[UNTRANSLATED] Lock Exilus slot`,
code_removeFeature_4: `[UNTRANSLATED] Remove Gravimag`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `[UNTRANSLATED] Lock Arcane slot`,
code_removeFeature_64: `[UNTRANSLATED] Lock Second Arcane slot`,
code_removeFeature_1024: `[UNTRANSLATED] Lock Valence Override`,
code_feature_1: `[UNTRANSLATED] Orokin Reactor`,
code_feature_2: `[UNTRANSLATED] Exilus Adapter`,
code_feature_4: `[UNTRANSLATED] Gravimag`,
code_feature_8: `[UNTRANSLATED] Gild`,
code_feature_32: `[UNTRANSLATED] Arcane slot`,
code_feature_64: `[UNTRANSLATED] Second Arcane slot`,
code_feature_1024: `[UNTRANSLATED] Valence Override`,
login_description: `Увійдіть, використовуючи облікові дані OpenWF (ті ж, що й у грі при підключенні до цього серверу).`,
login_emailLabel: `Адреса електронної пошти`,
login_passwordLabel: `Пароль`,

View File

@@ -81,20 +81,13 @@ dict = {
code_operatorFaceName: `指挥官面部 |INDEX|`,
code_succChange: `更改成功`,
code_requiredInvigorationUpgrade: `[UNTRANSLATED] You must select both an offensive & utility upgrade.`,
code_addFeature_1: `[UNTRANSLATED] Install Orokin Reactor`,
code_addFeature_2: `[UNTRANSLATED] Unlock Exilus slot`,
code_addFeature_4: `[UNTRANSLATED] Install Gravimag`,
code_addFeature_8: `[UNTRANSLATED] Gild Weapon`,
code_addFeature_32: `[UNTRANSLATED] Unlock Arcane slot`,
code_addFeature_64: `[UNTRANSLATED] Unlock Second Arcane slot`,
code_addFeature_1024: `[UNTRANSLATED] Unlock Valence Override`,
code_removeFeature_1: `[UNTRANSLATED] Remove Orokin Reactor`,
code_removeFeature_2: `[UNTRANSLATED] Lock Exilus slot`,
code_removeFeature_4: `[UNTRANSLATED] Remove Gravimag`,
code_removeFeature_8: `[UNTRANSLATED] Ungild Weapon`,
code_removeFeature_32: `[UNTRANSLATED] Lock Arcane slot`,
code_removeFeature_64: `[UNTRANSLATED] Lock Second Arcane slot`,
code_removeFeature_1024: `[UNTRANSLATED] Lock Valence Override`,
code_feature_1: `[UNTRANSLATED] Orokin Reactor`,
code_feature_2: `[UNTRANSLATED] Exilus Adapter`,
code_feature_4: `[UNTRANSLATED] Gravimag`,
code_feature_8: `[UNTRANSLATED] Gild`,
code_feature_32: `[UNTRANSLATED] Arcane slot`,
code_feature_64: `[UNTRANSLATED] Second Arcane slot`,
code_feature_1024: `[UNTRANSLATED] Valence Override`,
login_description: `使用您的 OpenWF 账户凭证登录(与游戏内连接本服务器时使用的昵称相同)`,
login_emailLabel: `电子邮箱`,
login_passwordLabel: `密码`,