feat: nemesis henchmen kills multiplier cheat #2806

Merged
Sainan merged 19 commits from AlexisinGit/SpaceNinjaServerAlexFork:cheat-nemesis-henchmen-kills-multiplier into main 2025-09-26 04:41:55 -07:00
Showing only changes of commit 0bbd05c8b8 - Show all commits

View File

@ -3218,10 +3218,9 @@ function doIntrinsicsUnlockAll() {
});
}
document.querySelectorAll("#account-cheats input[type=checkbox], #account-cheats input[type=number]").forEach(elm => {
document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => {
elm.onchange = function () {
revalidateAuthz().then(() => {
const value = elm.type === "checkbox" ? elm.checked : elm.value;
$.post({
url: "/custom/setAccountCheat?" + window.authz,
contentType: "application/json",
@ -3234,6 +3233,32 @@ document.querySelectorAll("#account-cheats input[type=checkbox], #account-cheats
};
AlexisinGit marked this conversation as resolved Outdated

Should parseInt(value) here otherwise the server gets a string

Should `parseInt(value)` here otherwise the server gets a string
});
document.querySelectorAll("#account-cheats .input-group").forEach(grp => {
const input = grp.querySelector("input");
const btn = grp.querySelector("button");
input.oninput = input.onchange = function () {
btn.classList.remove("btn-secondary");
btn.classList.add("btn-primary");
};
btn.onclick = function () {
btn.classList.remove("btn-primary");
btn.classList.add("btn-secondary");
const input = btn.closest(".input-group").querySelector('input[type="number"]');
if (!input) return;
revalidateAuthz().then(() => {
const value = input.value;
$.post({
url: "/custom/setAccountCheat?" + window.authz,
contentType: "application/json",
data: JSON.stringify({
key: input.id,
value: value
})
});
});
};
});
document.querySelectorAll("#guild-cheats input[type=checkbox]").forEach(elm => {
elm.onchange = function () {
revalidateAuthz().then(() => {