feat(webui): add client cheats and new account cheat "Unlock All Focus Schools" #406
@ -1 +1,2 @@
|
||||
static/webui/libs/
|
||||
*.html
|
||||
|
@ -19,15 +19,18 @@ webuiRouter.use("/webui", (req, res, next) => {
|
||||
});
|
||||
|
||||
// Serve virtual routes
|
||||
webuiRouter.get("/webui/settings", (_req, res) => {
|
||||
res.sendFile(path.join(rootDir, "static/webui/index.html"));
|
||||
});
|
||||
webuiRouter.get("/webui/inventory", (_req, res) => {
|
||||
res.sendFile(path.join(rootDir, "static/webui/index.html"));
|
||||
});
|
||||
webuiRouter.get("/webui/mods", (_req, res) => {
|
||||
res.sendFile(path.join(rootDir, "static/webui/index.html"));
|
||||
});
|
||||
webuiRouter.get("/webui/settings", (_req, res) => {
|
||||
res.sendFile(path.join(rootDir, "static/webui/index.html"));
|
||||
});
|
||||
webuiRouter.get("/webui/cheats", (_req, res) => {
|
||||
res.sendFile(path.join(rootDir, "static/webui/index.html"));
|
||||
});
|
||||
|
||||
// Serve static files
|
||||
webuiRouter.use("/webui", express.static(path.join(rootDir, "static/webui")));
|
||||
|
@ -9,23 +9,12 @@
|
||||
<body>
|
||||
<nav class="navbar sticky-top bg-body-tertiary">
|
||||
<div class="container">
|
||||
<button
|
||||
class="navbar-toggler d-lg-none"
|
||||
type="button"
|
||||
data-bs-toggle="offcanvas"
|
||||
data-bs-target="#sidebar"
|
||||
aria-controls="sidebar"
|
||||
aria-label="Toggle sidebar"
|
||||
>
|
||||
<button class="navbar-toggler d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar" aria-controls="sidebar" aria-label="Toggle sidebar">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand">OpenWF WebUI</a>
|
||||
<div class="nav-item dropdown">
|
||||
<button
|
||||
class="nav-link dropdown-toggle displayname"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
></button>
|
||||
<button class="nav-link dropdown-toggle displayname" data-bs-toggle="dropdown" aria-expanded="false"></button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="/webui/" onclick="logout();">Logout</a></li>
|
||||
</ul>
|
||||
@ -48,40 +37,19 @@
|
||||
<div class="navbar p-0">
|
||||
<ul class="navbar-nav justify-content-end">
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link"
|
||||
href="/webui/inventory"
|
||||
data-bs-dismiss="offcanvas"
|
||||
data-bs-target="#sidebar"
|
||||
>
|
||||
Inventory
|
||||
</a>
|
||||
<a class="nav-link" href="/webui/inventory" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Inventory</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link"
|
||||
href="/webui/mods"
|
||||
data-bs-dismiss="offcanvas"
|
||||
data-bs-target="#sidebar"
|
||||
>
|
||||
Mods
|
||||
</a>
|
||||
<a class="nav-link" href="/webui/mods" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Mods</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link"
|
||||
href="/webui/settings"
|
||||
data-bs-dismiss="offcanvas"
|
||||
data-bs-target="#sidebar"
|
||||
>
|
||||
Settings
|
||||
</a>
|
||||
<a class="nav-link" href="/webui/cheats" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Cheats</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="w-100">
|
||||
<div data-route="/webui/" data-title="Login | OpenWF WebUI">
|
||||
<p>Login using your OpenWF account credentials.</p>
|
||||
<form onsubmit="doLogin();return false;">
|
||||
@ -112,12 +80,8 @@
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Warframes</h5>
|
||||
<div class="card-body">
|
||||
<form class="input-group" onsubmit="doAcquireWarframe();return false;">
|
||||
<input
|
||||
class="form-control"
|
||||
id="warframe-to-acquire"
|
||||
list="datalist-warframes"
|
||||
/>
|
||||
<form class="input-group mb-3" onsubmit="doAcquireWarframe();return false;">
|
||||
<input class="form-control" id="warframe-to-acquire" list="datalist-warframes" />
|
||||
<button class="btn btn-primary" type="submit">Add</button>
|
||||
</form>
|
||||
<table class="table table-hover w-100">
|
||||
@ -130,7 +94,7 @@
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Weapons</h5>
|
||||
<div class="card-body">
|
||||
<form class="input-group" onsubmit="doAcquireWeapon();return false;">
|
||||
<form class="input-group mb-3" onsubmit="doAcquireWeapon();return false;">
|
||||
<input class="form-control" id="weapon-to-acquire" list="datalist-weapons" />
|
||||
<button class="btn btn-primary" type="submit">Add</button>
|
||||
</form>
|
||||
@ -154,26 +118,14 @@
|
||||
<form class="card-body" onsubmit="doAcquireRiven();return false;">
|
||||
<select class="form-control mb-3" id="addriven-type">
|
||||
<option value="LotusArchgunRandomModRare">LotusArchgunRandomModRare</option>
|
||||
<option value="LotusModularMeleeRandomModRare">
|
||||
LotusModularMeleeRandomModRare
|
||||
</option>
|
||||
<option value="LotusModularPistolRandomModRare">
|
||||
LotusModularPistolRandomModRare
|
||||
</option>
|
||||
<option value="LotusModularMeleeRandomModRare">LotusModularMeleeRandomModRare</option>
|
||||
<option value="LotusModularPistolRandomModRare">LotusModularPistolRandomModRare</option>
|
||||
<option value="LotusPistolRandomModRare">LotusPistolRandomModRare</option>
|
||||
<option value="LotusRifleRandomModRare" selected>
|
||||
LotusRifleRandomModRare
|
||||
</option>
|
||||
<option value="LotusRifleRandomModRare" selected>LotusRifleRandomModRare</option>
|
||||
<option value="LotusShotgunRandomModRare">LotusShotgunRandomModRare</option>
|
||||
<option value="PlayerMeleeWeaponRandomModRare">
|
||||
PlayerMeleeWeaponRandomModRare
|
||||
</option>
|
||||
<option value="PlayerMeleeWeaponRandomModRare">PlayerMeleeWeaponRandomModRare</option>
|
||||
</select>
|
||||
<textarea
|
||||
id="addriven-fingerprint"
|
||||
class="form-control mb-3"
|
||||
placeholder="Fingerprint"
|
||||
></textarea>
|
||||
<textarea id="addriven-fingerprint" class="form-control mb-3" placeholder="Fingerprint"></textarea>
|
||||
<button class="btn btn-primary" style="margin-right: 5px" type="submit">Add</button>
|
||||
<a href="riven-tool/" target="_blank">Need help with the fingerprint?</a>
|
||||
</form>
|
||||
@ -191,7 +143,7 @@
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Mods</h5>
|
||||
<div class="card-body">
|
||||
<form class="input-group" onsubmit="doAcquireMod();return false;">
|
||||
<form class="input-group mb-3" onsubmit="doAcquireMod();return false;">
|
||||
<input class="form-control" id="mod-to-acquire" list="datalist-mods" />
|
||||
<button class="btn btn-primary" type="submit">Add</button>
|
||||
</form>
|
||||
@ -203,8 +155,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-route="/webui/settings" data-title="Settings | OpenWF WebUI">
|
||||
<form onsubmit="doChangeSettings();return false;">
|
||||
<div data-route="/webui/cheats, /webui/settings" data-title="Cheats | OpenWF WebUI">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Server</h5>
|
||||
<form class="card-body" onsubmit="doChangeSettings();return false;">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="skipStoryModeChoice" />
|
||||
<label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice</label>
|
||||
@ -231,9 +187,7 @@
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="infiniteResources" />
|
||||
<label class="form-check-label" for="infiniteResources">
|
||||
Infinite Credits and Platinum
|
||||
</label>
|
||||
<label class="form-check-label" for="infiniteResources">Infinite Credits and Platinum</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
|
||||
@ -241,9 +195,7 @@
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="unlockAllShipDecorations" />
|
||||
<label class="form-check-label" for="unlockAllShipDecorations">
|
||||
Unlock All Ship Decorations
|
||||
</label>
|
||||
<label class="form-check-label" for="unlockAllShipDecorations">Unlock All Ship Decorations</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="unlockAllFlavourItems" />
|
||||
@ -261,7 +213,7 @@
|
||||
Universal Polarity Everywhere
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-2 mb-2">
|
||||
<div class="form-group mt-2">
|
||||
<label class="form-label" for="spoofMasteryRank">
|
||||
Spoofed Mastery Rank (-1 to disable)
|
||||
</label>
|
||||
@ -271,6 +223,37 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Account</h5>
|
||||
<div class="card-body">
|
||||
<button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Client</h5>
|
||||
<div id="client-cheats-nok" class="card-body">
|
||||
Client cheats are currently unavailable. This could be because your client is not running or using a DLL without an HTTP interface.
|
||||
</div>
|
||||
<div id="client-cheats-ok" class="card-body d-none">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="skip_mission_start_timer" />
|
||||
<label class="form-check-label" for="skip_mission_start_timer">
|
||||
Skip Mission Start Timer
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="form-label" for="fov_override">FOV Override (0 to disable)</label>
|
||||
<input id="fov_override" class="form-range" type="range" min="0" value="0" max="2260000" step="10000">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<datalist id="datalist-warframes"></datalist>
|
||||
<datalist id="datalist-weapons"></datalist>
|
||||
|
@ -701,3 +701,83 @@ function doChangeSettings() {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Cheats route
|
||||
|
||||
fetch("http://localhost:61558/ping", { mode: "no-cors" }).then(() => {
|
||||
$("#client-cheats-nok").addClass("d-none");
|
||||
$("#client-cheats-ok").removeClass("d-none");
|
||||
|
||||
fetch("http://localhost:61558/skip_mission_start_timer")
|
||||
.then(res => res.text())
|
||||
.then(res => {
|
||||
document.getElementById("skip_mission_start_timer").checked = res == "1";
|
||||
});
|
||||
document.getElementById("skip_mission_start_timer").onchange = function () {
|
||||
fetch("http://localhost:61558/skip_mission_start_timer?" + this.checked);
|
||||
};
|
||||
|
||||
fetch("http://localhost:61558/fov_override")
|
||||
.then(res => res.text())
|
||||
.then(res => {
|
||||
document.getElementById("fov_override").value = parseFloat(res) * 10000;
|
||||
});
|
||||
document.getElementById("fov_override").oninput = function () {
|
||||
fetch("http://localhost:61558/fov_override?" + this.value);
|
||||
};
|
||||
});
|
||||
|
||||
function doUnlockAllFocusSchools() {
|
||||
|
||||
revalidateAuthz(() => {
|
||||
$.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
|
||||
};
|
||||
if (data.FocusUpgrades) {
|
||||
for (const focusUpgrade of data.FocusUpgrades) {
|
||||
if (focusUpgrade.ItemType in missingFocusUpgrades) {
|
||||
delete missingFocusUpgrades[focusUpgrade.ItemType];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const upgradeType of Object.keys(missingFocusUpgrades)) {
|
||||
await unlockFocusSchool(upgradeType);
|
||||
}
|
||||
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."
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function unlockFocusSchool(upgradeType) {
|
||||
return new Promise(resolve => {
|
||||
// Deselect current FocusAbility so we will be able to unlock the way for free
|
||||
$.post({
|
||||
url: "/api/focus.php?" + window.authz + "&op=5",
|
||||
contentType: "text/plain",
|
||||
data: "{}"
|
||||
}).done(function () {
|
||||
// Unlock the way now
|
||||
$.post({
|
||||
url: "/api/focus.php?" + window.authz + "&op=2",
|
||||
contentType: "text/plain",
|
||||
data: JSON.stringify({
|
||||
FocusType: upgradeType
|
||||
})
|
||||
}).done(function () {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user
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.
I use this prefix for functions that are invoked from the UI as opposed to internal functions. I think it somewhat clarifies expectations.