返回提交历史
Modified
static/webui/script.js
+7
-4
XFEstudio/XFESpaceNinjaServer
chore(webui): adjust range in ability override & don't allow to apply on empty slot field (#3668)
Using ability slot-range 1-4 in WebUI instead, which should be more familiar to the user than odd 0-3. Also tells when the change (set or remove) was applied successfully. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3668 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: Animan8000 <187183497+Veniman8000@users.noreply.github.com> Co-committed-by: Animan8000 <187183497+Veniman8000@users.noreply.github.com>
7dd757fe
代码差异
1 个文件
+7
-4
@@ -2043,10 +2043,10 @@ function translateInventoryDataToDom() {
2043
2043
abilityOverrideSecondInput.id = `abilityOverride-ability-index-config-${i}`;
2044
2044
abilityOverrideSecondInput.classList = "form-control";
2045
2045
abilityOverrideSecondInput.setAttribute("type", "number");
2046
abilityOverrideSecondInput.setAttribute("min", "0");
2047
abilityOverrideSecondInput.setAttribute("max", "3");
2046
abilityOverrideSecondInput.setAttribute("min", "1");
2047
abilityOverrideSecondInput.setAttribute("max", "4");
2048
2048
if (config.AbilityOverride)
2049
abilityOverrideSecondInput.value = config.AbilityOverride.Index;
2049
abilityOverrideSecondInput.value = config.AbilityOverride.Index + 1;
2050
2050
abilityOverrideInputGroup.appendChild(abilityOverrideSecondInput);
2051
2051
2052
2052
const abilityOverrideSetButton = document.createElement("button");
@@ -4985,7 +4985,9 @@ function handleAbilityOverride(event, configIndex) {
4985
4985
$(`#abilityOverride-ability-config-${configIndex}`).addClass("is-invalid").focus();
4986
4986
return;
4987
4987
}
4988
const Index = document.getElementById(`abilityOverride-ability-index-config-${configIndex}`).value;
4988
const input = document.getElementById(`abilityOverride-ability-index-config-${configIndex}`);
4989
if (!input.value) return;
4990
const Index = input.value - 1;
4989
4991
revalidateAuthz().then(() => {
4990
4992
$.post({
4991
4993
url: "/custom/abilityOverride?" + window.authz,
@@ -5001,6 +5003,7 @@ function handleAbilityOverride(event, configIndex) {
5001
5003
}
5002
5004
})
5003
5005
}).done(function () {
5006
toast(loc("code_succChange"));
5004
5007
updateInventory();
5005
5008
});
5006
5009
});