feat(webui): add client cheats and new account cheat "Unlock All Focus Schools" #406

Merged
Sainan merged 3 commits from cheetos into main 2024-06-27 14:08:59 -07:00
Showing only changes of commit 16b588373e - Show all commits

View File

@ -729,13 +729,13 @@ fetch("http://localhost:61558/ping", { mode: "no-cors" }).then(() => {
function doUnlockAllFocusSchools() {
OrdisPrime commented 2024-06-26 07:31:49 -07:00 (Migrated from github.com)
Review

in general I noticed you like using the do prefix, however I think it doesn't add to the function name.
Just something I personally would change.

in general I noticed you like using the do prefix, however I think it doesn't add to the function name. Just something I personally would change.
Review

I use this prefix for functions that are invoked from the UI as opposed to internal functions. I think it somewhat clarifies expectations.

I use this prefix for functions that are invoked from the UI as opposed to internal functions. I think it somewhat clarifies expectations.
revalidateAuthz(() => {
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(async (data) => {
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(async data => {
const missingFocusUpgrades = {
"/Lotus/Upgrades/Focus/Attack/AttackFocusAbility": true,
"/Lotus/Upgrades/Focus/Tactic/TacticFocusAbility": true,
"/Lotus/Upgrades/Focus/Ward/WardFocusAbility": true,
"/Lotus/Upgrades/Focus/Defense/DefenseFocusAbility": true,
"/Lotus/Upgrades/Focus/Power/PowerFocusAbility": true,
"/Lotus/Upgrades/Focus/Power/PowerFocusAbility": true
};
if (data.FocusUpgrades) {
for (const focusUpgrade of data.FocusUpgrades) {
@ -750,7 +750,11 @@ function doUnlockAllFocusSchools() {
if (Object.keys(missingFocusUpgrades).length == 0) {
alert("All focus schools are already unlocked.");
} else {
alert("Unlocked " + Object.keys(missingFocusUpgrades).length + " 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.");
alert(
"Unlocked " +
Object.keys(missingFocusUpgrades).length +
" 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."
);
}
});
});
@ -771,7 +775,7 @@ function unlockFocusSchool(upgradeType) {
data: JSON.stringify({
FocusType: upgradeType
})
}).done(function() {
}).done(function () {
resolve();
});
});