From 0e75700658dcc4c9e05aee2773034fd69772dc72 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Wed, 5 Nov 2025 13:41:20 +0100 Subject: [PATCH] use checkbox --- static/webui/script.js | 33 ++++++++++++++++++++++----------- static/webui/translations/de.js | 21 +++++++-------------- static/webui/translations/en.js | 21 +++++++-------------- static/webui/translations/es.js | 21 +++++++-------------- static/webui/translations/fr.js | 21 +++++++-------------- static/webui/translations/ru.js | 21 +++++++-------------- static/webui/translations/uk.js | 21 +++++++-------------- static/webui/translations/zh.js | 21 +++++++-------------- 8 files changed, 71 insertions(+), 109 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 23233460..4783a2e7 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -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); } } diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index bd047fb9..20b0e9ad 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -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`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index 84be36e1..e1e390d7 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -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`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index fb1044ce..ba5d610a 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -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`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index dc0c68e9..13b46967 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -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`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 01e3d044..d9062c26 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -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: `Пароль`, diff --git a/static/webui/translations/uk.js b/static/webui/translations/uk.js index 231d52c7..a871341e 100644 --- a/static/webui/translations/uk.js +++ b/static/webui/translations/uk.js @@ -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: `Пароль`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 1c506a4d..fdd3e0c4 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -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: `密码`,