返回提交历史
Modified
.prettierignore
+1
-0
Modified
src/routes/webui.ts
+6
-3
Modified
static/webui/index.html
+241
-258
Modified
static/webui/script.js
+80
-0
XFEstudio/SpaceNinjaServer
feat(webui): add client cheats and new account cheat "Unlock All Focus Schools" (#406)
Co-authored-by: Sainan <Sainan@users.noreply.github.com>
7cfef629
代码差异
4 个文件
+328
-261
@@ -1 +1,2 @@
1
1
static/webui/libs/
2
*.html
@@ -19,15 +19,18 @@ webuiRouter.use("/webui", (req, res, next) => {
19
19
});
20
20
21
21
// Serve virtual routes
22
webuiRouter.get("/webui/settings", (_req, res) => {
23
res.sendFile(path.join(rootDir, "static/webui/index.html"));
24
});
25
22
webuiRouter.get("/webui/inventory", (_req, res) => {
26
23
res.sendFile(path.join(rootDir, "static/webui/index.html"));
27
24
});
28
25
webuiRouter.get("/webui/mods", (_req, res) => {
29
26
res.sendFile(path.join(rootDir, "static/webui/index.html"));
30
27
});
28
webuiRouter.get("/webui/settings", (_req, res) => {
29
res.sendFile(path.join(rootDir, "static/webui/index.html"));
30
});
31
webuiRouter.get("/webui/cheats", (_req, res) => {
32
res.sendFile(path.join(rootDir, "static/webui/index.html"));
33
});
31
34
32
35
// Serve static files
33
36
webuiRouter.use("/webui", express.static(path.join(rootDir, "static/webui")));
@@ -1,286 +1,269 @@
1
1
<!doctype html>
2
2
<html lang="en" data-bs-theme="dark">
3
<head>
4
<title>OpenWF WebUI</title>
5
<meta name="viewport" content="width=device-width, initial-scale=1" />
6
<link rel="stylesheet" href="libs/bootstrap.min.css" />
7
<link rel="stylesheet" href="style.css" />
8
</head>
9
<body>
10
<nav class="navbar sticky-top bg-body-tertiary">
11
<div class="container">
3
<head>
4
<title>OpenWF WebUI</title>
5
<meta name="viewport" content="width=device-width, initial-scale=1" />
6
<link rel="stylesheet" href="libs/bootstrap.min.css" />
7
<link rel="stylesheet" href="style.css" />
8
</head>
9
<body>
10
<nav class="navbar sticky-top bg-body-tertiary">
11
<div class="container">
12
<button class="navbar-toggler d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar" aria-controls="sidebar" aria-label="Toggle sidebar">
13
<span class="navbar-toggler-icon"></span>
14
</button>
15
<a class="navbar-brand">OpenWF WebUI</a>
16
<div class="nav-item dropdown">
17
<button class="nav-link dropdown-toggle displayname" data-bs-toggle="dropdown" aria-expanded="false"></button>
18
<ul class="dropdown-menu dropdown-menu-end">
19
<li><a class="dropdown-item" href="/webui/" onclick="logout();">Logout</a></li>
20
</ul>
21
</div>
22
</div>
23
</nav>
24
<div class="container pt-3 pb-3" id="main-view">
25
<div class="offcanvas-lg offcanvas-start" tabindex="-1" id="sidebar" aria-labelledby="sidebarLabel">
26
<div class="offcanvas-header">
27
<h5 class="offcanvas-title" id="sidebarLabel">Sidebar</h5>
12
28
<button
13
class="navbar-toggler d-lg-none"
14
type="button"
15
data-bs-toggle="offcanvas"
16
data-bs-target="#sidebar"
17
aria-controls="sidebar"
18
aria-label="Toggle sidebar"
19
>
20
<span class="navbar-toggler-icon"></span>
21
</button>
22
<a class="navbar-brand">OpenWF WebUI</a>
23
<div class="nav-item dropdown">
24
<button
25
class="nav-link dropdown-toggle displayname"
26
data-bs-toggle="dropdown"
27
aria-expanded="false"
28
></button>
29
<ul class="dropdown-menu dropdown-menu-end">
30
<li><a class="dropdown-item" href="/webui/" onclick="logout();">Logout</a></li>
29
type="button"
30
class="btn-close"
31
data-bs-dismiss="offcanvas"
32
data-bs-target="#sidebar"
33
aria-label="Close"
34
></button>
35
</div>
36
<div class="offcanvas-body">
37
<div class="navbar p-0">
38
<ul class="navbar-nav justify-content-end">
39
<li class="nav-item">
40
<a class="nav-link" href="/webui/inventory" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Inventory</a>
41
</li>
42
<li class="nav-item">
43
<a class="nav-link" href="/webui/mods" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Mods</a>
44
</li>
45
<li class="nav-item">
46
<a class="nav-link" href="/webui/cheats" data-bs-dismiss="offcanvas" data-bs-target="#sidebar">Cheats</a>
47
</li>
31
48
</ul>
32
49
</div>
33
50
</div>
34
</nav>
35
<div class="container pt-3 pb-3" id="main-view">
36
<div class="offcanvas-lg offcanvas-start" tabindex="-1" id="sidebar" aria-labelledby="sidebarLabel">
37
<div class="offcanvas-header">
38
<h5 class="offcanvas-title" id="sidebarLabel">Sidebar</h5>
39
<button
40
type="button"
41
class="btn-close"
42
data-bs-dismiss="offcanvas"
43
data-bs-target="#sidebar"
44
aria-label="Close"
45
></button>
46
</div>
47
<div class="offcanvas-body">
48
<div class="navbar p-0">
49
<ul class="navbar-nav justify-content-end">
50
<li class="nav-item">
51
<a
52
class="nav-link"
53
href="/webui/inventory"
54
data-bs-dismiss="offcanvas"
55
data-bs-target="#sidebar"
56
>
57
Inventory
58
</a>
59
</li>
60
<li class="nav-item">
61
<a
62
class="nav-link"
63
href="/webui/mods"
64
data-bs-dismiss="offcanvas"
65
data-bs-target="#sidebar"
66
>
67
Mods
68
</a>
69
</li>
70
<li class="nav-item">
71
<a
72
class="nav-link"
73
href="/webui/settings"
74
data-bs-dismiss="offcanvas"
75
data-bs-target="#sidebar"
76
>
77
Settings
78
</a>
79
</li>
80
</ul>
81
</div>
82
</div>
51
</div>
52
<div class="w-100">
53
<div data-route="/webui/" data-title="Login | OpenWF WebUI">
54
<p>Login using your OpenWF account credentials.</p>
55
<form onsubmit="doLogin();return false;">
56
<label for="email">Email address</label>
57
<input class="form-control" type="email" id="email" required />
58
<br />
59
<label for="password">Password</label>
60
<input class="form-control" type="password" id="password" required />
61
<br />
62
<button class="btn btn-primary" type="submit">Login</button>
63
</form>
83
64
</div>
84
<div>
85
<div data-route="/webui/" data-title="Login | OpenWF WebUI">
86
<p>Login using your OpenWF account credentials.</p>
87
<form onsubmit="doLogin();return false;">
88
<label for="email">Email address</label>
89
<input class="form-control" type="email" id="email" required />
90
<br />
91
<label for="password">Password</label>
92
<input class="form-control" type="password" id="password" required />
93
<br />
94
<button class="btn btn-primary" type="submit">Login</button>
65
<div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
66
<p id="refresh-note" class="mb-4">
67
Note: Changes made here will only be reflected in-game when the game re-downloads your
68
inventory. Visiting the navigation should be the easiest way to trigger that.
69
</p>
70
<div class="card mb-4">
71
<h5 class="card-header">Add Items</h5>
72
<form class="card-body input-group" onsubmit="doAcquireMiscItems();return false;">
73
<input class="form-control" id="miscitem-count" type="number" min="1" value="1" />
74
<input class="form-control" id="miscitem-type" list="datalist-miscitems" />
75
<button class="btn btn-primary" type="submit">Add</button>
95
76
</form>
96
77
</div>
97
<div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
98
<p id="refresh-note" class="mb-4">
99
Note: Changes made here will only be reflected in-game when the game re-downloads your
100
inventory. Visiting the navigation should be the easiest way to trigger that.
101
</p>
102
<div class="card mb-4">
103
<h5 class="card-header">Add Items</h5>
104
<form class="card-body input-group" onsubmit="doAcquireMiscItems();return false;">
105
<input class="form-control" id="miscitem-count" type="number" min="1" value="1" />
106
<input class="form-control" id="miscitem-type" list="datalist-miscitems" />
107
<button class="btn btn-primary" type="submit">Add</button>
108
</form>
109
</div>
110
<div class="row">
111
<div class="col-lg-6">
112
<div class="card mb-4">
113
<h5 class="card-header">Warframes</h5>
114
<div class="card-body">
115
<form class="input-group" onsubmit="doAcquireWarframe();return false;">
116
<input
117
class="form-control"
118
id="warframe-to-acquire"
119
list="datalist-warframes"
120
/>
121
<button class="btn btn-primary" type="submit">Add</button>
122
</form>
123
<table class="table table-hover w-100">
124
<tbody id="warframe-list"></tbody>
125
</table>
126
</div>
78
<div class="row">
79
<div class="col-lg-6">
80
<div class="card mb-4">
81
<h5 class="card-header">Warframes</h5>
82
<div class="card-body">
83
<form class="input-group mb-3" onsubmit="doAcquireWarframe();return false;">
84
<input class="form-control" id="warframe-to-acquire" list="datalist-warframes" />
85
<button class="btn btn-primary" type="submit">Add</button>
86
</form>
87
<table class="table table-hover w-100">
88
<tbody id="warframe-list"></tbody>
89
</table>
127
90
</div>
128
91
</div>
129
<div class="col-lg-6">
130
<div class="card mb-4">
131
<h5 class="card-header">Weapons</h5>
132
<div class="card-body">
133
<form class="input-group" onsubmit="doAcquireWeapon();return false;">
134
<input class="form-control" id="weapon-to-acquire" list="datalist-weapons" />
135
<button class="btn btn-primary" type="submit">Add</button>
136
</form>
137
<table class="table table-hover w-100">
138
<tbody id="weapon-list"></tbody>
139
</table>
140
</div>
92
</div>
93
<div class="col-lg-6">
94
<div class="card mb-4">
95
<h5 class="card-header">Weapons</h5>
96
<div class="card-body">
97
<form class="input-group mb-3" onsubmit="doAcquireWeapon();return false;">
98
<input class="form-control" id="weapon-to-acquire" list="datalist-weapons" />
99
<button class="btn btn-primary" type="submit">Add</button>
100
</form>
101
<table class="table table-hover w-100">
102
<tbody id="weapon-list"></tbody>
103
</table>
141
104
</div>
142
105
</div>
143
106
</div>
144
107
</div>
145
<div data-route="/webui/mods" data-title="Mods | OpenWF WebUI">
146
<p id="refresh-note" class="mb-4">
147
Note: Changes made here will only be reflected in-game when the game re-downloads your
148
inventory. Visiting the navigation should be the easiest way to trigger that.
149
</p>
150
<div class="row">
151
<div class="col-xxl-6">
152
<div class="card mb-4">
153
<h5 class="card-header">Add Riven</h5>
154
<form class="card-body" onsubmit="doAcquireRiven();return false;">
155
<select class="form-control mb-3" id="addriven-type">
156
<option value="LotusArchgunRandomModRare">LotusArchgunRandomModRare</option>
157
<option value="LotusModularMeleeRandomModRare">
158
LotusModularMeleeRandomModRare
159
</option>
160
<option value="LotusModularPistolRandomModRare">
161
LotusModularPistolRandomModRare
162
</option>
163
<option value="LotusPistolRandomModRare">LotusPistolRandomModRare</option>
164
<option value="LotusRifleRandomModRare" selected>
165
LotusRifleRandomModRare
166
</option>
167
<option value="LotusShotgunRandomModRare">LotusShotgunRandomModRare</option>
168
<option value="PlayerMeleeWeaponRandomModRare">
169
PlayerMeleeWeaponRandomModRare
170
</option>
171
</select>
172
<textarea
173
id="addriven-fingerprint"
174
class="form-control mb-3"
175
placeholder="Fingerprint"
176
></textarea>
177
<button class="btn btn-primary" style="margin-right: 5px" type="submit">Add</button>
178
<a href="riven-tool/" target="_blank">Need help with the fingerprint?</a>
179
</form>
180
</div>
181
<div class="card mb-4">
182
<h5 class="card-header">Rivens</h5>
183
<div class="card-body">
184
<table class="table table-hover w-100">
185
<tbody id="riven-list"></tbody>
186
</table>
187
</div>
108
</div>
109
<div data-route="/webui/mods" data-title="Mods | OpenWF WebUI">
110
<p id="refresh-note" class="mb-4">
111
Note: Changes made here will only be reflected in-game when the game re-downloads your
112
inventory. Visiting the navigation should be the easiest way to trigger that.
113
</p>
114
<div class="row">
115
<div class="col-xxl-6">
116
<div class="card mb-4">
117
<h5 class="card-header">Add Riven</h5>
118
<form class="card-body" onsubmit="doAcquireRiven();return false;">
119
<select class="form-control mb-3" id="addriven-type">
120
<option value="LotusArchgunRandomModRare">LotusArchgunRandomModRare</option>
121
<option value="LotusModularMeleeRandomModRare">LotusModularMeleeRandomModRare</option>
122
<option value="LotusModularPistolRandomModRare">LotusModularPistolRandomModRare</option>
123
<option value="LotusPistolRandomModRare">LotusPistolRandomModRare</option>
124
<option value="LotusRifleRandomModRare" selected>LotusRifleRandomModRare</option>
125
<option value="LotusShotgunRandomModRare">LotusShotgunRandomModRare</option>
126
<option value="PlayerMeleeWeaponRandomModRare">PlayerMeleeWeaponRandomModRare</option>
127
</select>
128
<textarea id="addriven-fingerprint" class="form-control mb-3" placeholder="Fingerprint"></textarea>
129
<button class="btn btn-primary" style="margin-right: 5px" type="submit">Add</button>
130
<a href="riven-tool/" target="_blank">Need help with the fingerprint?</a>
131
</form>
132
</div>
133
<div class="card mb-4">
134
<h5 class="card-header">Rivens</h5>
135
<div class="card-body">
136
<table class="table table-hover w-100">
137
<tbody id="riven-list"></tbody>
138
</table>
188
139
</div>
189
140
</div>
190
<div class="col-xxl-6">
191
<div class="card mb-4">
192
<h5 class="card-header">Mods</h5>
193
<div class="card-body">
194
<form class="input-group" onsubmit="doAcquireMod();return false;">
195
<input class="form-control" id="mod-to-acquire" list="datalist-mods" />
196
<button class="btn btn-primary" type="submit">Add</button>
197
</form>
198
<table class="table table-hover w-100">
199
<tbody id="mods-list"></tbody>
200
</table>
201
</div>
141
</div>
142
<div class="col-xxl-6">
143
<div class="card mb-4">
144
<h5 class="card-header">Mods</h5>
145
<div class="card-body">
146
<form class="input-group mb-3" onsubmit="doAcquireMod();return false;">
147
<input class="form-control" id="mod-to-acquire" list="datalist-mods" />
148
<button class="btn btn-primary" type="submit">Add</button>
149
</form>
150
<table class="table table-hover w-100">
151
<tbody id="mods-list"></tbody>
152
</table>
202
153
</div>
203
154
</div>
204
155
</div>
205
156
</div>
206
<div data-route="/webui/settings" data-title="Settings | OpenWF WebUI">
207
<form onsubmit="doChangeSettings();return false;">
208
<div class="form-check">
209
<input class="form-check-input" type="checkbox" id="skipStoryModeChoice" />
210
<label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice</label>
211
</div>
212
<div class="form-check">
213
<input class="form-check-input" type="checkbox" id="skipTutorial" />
214
<label class="form-check-label" for="skipTutorial">Skip Tutorial</label>
215
</div>
216
<div class="form-check">
217
<input class="form-check-input" type="checkbox" id="unlockAllScans" />
218
<label class="form-check-label" for="unlockAllScans">Unlock All Scans</label>
219
</div>
220
<div class="form-check">
221
<input class="form-check-input" type="checkbox" id="unlockAllMissions" />
222
<label class="form-check-label" for="unlockAllMissions">Unlock All Missions</label>
223
</div>
224
<div class="form-check">
225
<input class="form-check-input" type="checkbox" id="unlockAllQuests" />
226
<label class="form-check-label" for="unlockAllQuests">Unlock All Quests</label>
227
</div>
228
<div class="form-check">
229
<input class="form-check-input" type="checkbox" id="completeAllQuests" />
230
<label class="form-check-label" for="completeAllQuests">Complete All Quests</label>
231
</div>
232
<div class="form-check">
233
<input class="form-check-input" type="checkbox" id="infiniteResources" />
234
<label class="form-check-label" for="infiniteResources">
235
Infinite Credits and Platinum
236
</label>
237
</div>
238
<div class="form-check">
239
<input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
240
<label class="form-check-label" for="unlockAllShipFeatures">Unlock All Ship Features</label>
241
</div>
242
<div class="form-check">
243
<input class="form-check-input" type="checkbox" id="unlockAllShipDecorations" />
244
<label class="form-check-label" for="unlockAllShipDecorations">
245
Unlock All Ship Decorations
246
</label>
247
</div>
248
<div class="form-check">
249
<input class="form-check-input" type="checkbox" id="unlockAllFlavourItems" />
250
<label class="form-check-label" for="unlockAllFlavourItems">
251
Unlock All <abbr title="Animation Sets, Glyphs, Plattes, etc.">Flavor Items</abbr>
252
</label>
253
</div>
254
<div class="form-check">
255
<input class="form-check-input" type="checkbox" id="unlockAllSkins" />
256
<label class="form-check-label" for="unlockAllSkins">Unlock All Skins</label>
157
</div>
158
<div data-route="/webui/cheats, /webui/settings" data-title="Cheats | OpenWF WebUI">
159
<div class="row">
160
<div class="col-lg-4">
161
<div class="card mb-4">
162
<h5 class="card-header">Server</h5>
163
<form class="card-body" onsubmit="doChangeSettings();return false;">
164
<div class="form-check">
165
<input class="form-check-input" type="checkbox" id="skipStoryModeChoice" />
166
<label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice</label>
167
</div>
168
<div class="form-check">
169
<input class="form-check-input" type="checkbox" id="skipTutorial" />
170
<label class="form-check-label" for="skipTutorial">Skip Tutorial</label>
171
</div>
172
<div class="form-check">
173
<input class="form-check-input" type="checkbox" id="unlockAllScans" />
174
<label class="form-check-label" for="unlockAllScans">Unlock All Scans</label>
175
</div>
176
<div class="form-check">
177
<input class="form-check-input" type="checkbox" id="unlockAllMissions" />
178
<label class="form-check-label" for="unlockAllMissions">Unlock All Missions</label>
179
</div>
180
<div class="form-check">
181
<input class="form-check-input" type="checkbox" id="unlockAllQuests" />
182
<label class="form-check-label" for="unlockAllQuests">Unlock All Quests</label>
183
</div>
184
<div class="form-check">
185
<input class="form-check-input" type="checkbox" id="completeAllQuests" />
186
<label class="form-check-label" for="completeAllQuests">Complete All Quests</label>
187
</div>
188
<div class="form-check">
189
<input class="form-check-input" type="checkbox" id="infiniteResources" />
190
<label class="form-check-label" for="infiniteResources">Infinite Credits and Platinum</label>
191
</div>
192
<div class="form-check">
193
<input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
194
<label class="form-check-label" for="unlockAllShipFeatures">Unlock All Ship Features</label>
195
</div>
196
<div class="form-check">
197
<input class="form-check-input" type="checkbox" id="unlockAllShipDecorations" />
198
<label class="form-check-label" for="unlockAllShipDecorations">Unlock All Ship Decorations</label>
199
</div>
200
<div class="form-check">
201
<input class="form-check-input" type="checkbox" id="unlockAllFlavourItems" />
202
<label class="form-check-label" for="unlockAllFlavourItems">
203
Unlock All <abbr title="Animation Sets, Glyphs, Plattes, etc.">Flavor Items</abbr>
204
</label>
205
</div>
206
<div class="form-check">
207
<input class="form-check-input" type="checkbox" id="unlockAllSkins" />
208
<label class="form-check-label" for="unlockAllSkins">Unlock All Skins</label>
209
</div>
210
<div class="form-check">
211
<input class="form-check-input" type="checkbox" id="universalPolarityEverywhere" />
212
<label class="form-check-label" for="universalPolarityEverywhere">
213
Universal Polarity Everywhere
214
</label>
215
</div>
216
<div class="form-group mt-2">
217
<label class="form-label" for="spoofMasteryRank">
218
Spoofed Mastery Rank (-1 to disable)
219
</label>
220
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" />
221
</div>
222
<button class="btn btn-primary mt-3" type="submit">Save Settings</button>
223
</form>
257
224
</div>
258
<div class="form-check">
259
<input class="form-check-input" type="checkbox" id="universalPolarityEverywhere" />
260
<label class="form-check-label" for="universalPolarityEverywhere">
261
Universal Polarity Everywhere
262
</label>
225
</div>
226
<div class="col-lg-4">
227
<div class="card mb-4">
228
<h5 class="card-header">Account</h5>
229
<div class="card-body">
230
<button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button>
231
</div>
263
232
</div>
264
<div class="form-group mt-2 mb-2">
265
<label class="form-label" for="spoofMasteryRank">
266
Spoofed Mastery Rank (-1 to disable)
267
</label>
268
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" />
233
</div>
234
<div class="col-lg-4">
235
<div class="card mb-4">
236
<h5 class="card-header">Client</h5>
237
<div id="client-cheats-nok" class="card-body">
238
Client cheats are currently unavailable. This could be because your client is not running or using a DLL without an HTTP interface.
239
</div>
240
<div id="client-cheats-ok" class="card-body d-none">
241
<div class="form-check">
242
<input class="form-check-input" type="checkbox" id="skip_mission_start_timer" />
243
<label class="form-check-label" for="skip_mission_start_timer">
244
Skip Mission Start Timer
245
</label>
246
</div>
247
<div class="form-group mt-3">
248
<label class="form-label" for="fov_override">FOV Override (0 to disable)</label>
249
<input id="fov_override" class="form-range" type="range" min="0" value="0" max="2260000" step="10000">
250
</div>
251
</div>
269
252
</div>
270
<button class="btn btn-primary mt-3" type="submit">Save Settings</button>
271
</form>
253
</div>
272
254
</div>
273
255
</div>
274
256
</div>
275
<datalist id="datalist-warframes"></datalist>
276
<datalist id="datalist-weapons"></datalist>
277
<datalist id="datalist-miscitems"></datalist>
278
<datalist id="datalist-mods"></datalist>
279
<script src="libs/jquery-3.6.0.min.js"></script>
280
<script src="libs/whirlpool-js.min.js"></script>
281
<script src="libs/single.js"></script>
282
<script src="riven-tool/RivenParser.js"></script>
283
<script src="script.js"></script>
284
<script src="libs/bootstrap.bundle.min.js"></script>
285
</body>
257
</div>
258
<datalist id="datalist-warframes"></datalist>
259
<datalist id="datalist-weapons"></datalist>
260
<datalist id="datalist-miscitems"></datalist>
261
<datalist id="datalist-mods"></datalist>
262
<script src="libs/jquery-3.6.0.min.js"></script>
263
<script src="libs/whirlpool-js.min.js"></script>
264
<script src="libs/single.js"></script>
265
<script src="riven-tool/RivenParser.js"></script>
266
<script src="script.js"></script>
267
<script src="libs/bootstrap.bundle.min.js"></script>
268
</body>
286
269
</html>
@@ -701,3 +701,83 @@ function doChangeSettings() {
701
701
});
702
702
});
703
703
}
704
705
// Cheats route
706
707
fetch("http://localhost:61558/ping", { mode: "no-cors" }).then(() => {
708
$("#client-cheats-nok").addClass("d-none");
709
$("#client-cheats-ok").removeClass("d-none");
710
711
fetch("http://localhost:61558/skip_mission_start_timer")
712
.then(res => res.text())
713
.then(res => {
714
document.getElementById("skip_mission_start_timer").checked = res == "1";
715
});
716
document.getElementById("skip_mission_start_timer").onchange = function () {
717
fetch("http://localhost:61558/skip_mission_start_timer?" + this.checked);
718
};
719
720
fetch("http://localhost:61558/fov_override")
721
.then(res => res.text())
722
.then(res => {
723
document.getElementById("fov_override").value = parseFloat(res) * 10000;
724
});
725
document.getElementById("fov_override").oninput = function () {
726
fetch("http://localhost:61558/fov_override?" + this.value);
727
};
728
});
729
730
function doUnlockAllFocusSchools() {
731
revalidateAuthz(() => {
732
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(async data => {
733
const missingFocusUpgrades = {
734
"/Lotus/Upgrades/Focus/Attack/AttackFocusAbility": true,
735
"/Lotus/Upgrades/Focus/Tactic/TacticFocusAbility": true,
736
"/Lotus/Upgrades/Focus/Ward/WardFocusAbility": true,
737
"/Lotus/Upgrades/Focus/Defense/DefenseFocusAbility": true,
738
"/Lotus/Upgrades/Focus/Power/PowerFocusAbility": true
739
};
740
if (data.FocusUpgrades) {
741
for (const focusUpgrade of data.FocusUpgrades) {
742
if (focusUpgrade.ItemType in missingFocusUpgrades) {
743
delete missingFocusUpgrades[focusUpgrade.ItemType];
744
}
745
}
746
}
747
for (const upgradeType of Object.keys(missingFocusUpgrades)) {
748
await unlockFocusSchool(upgradeType);
749
}
750
if (Object.keys(missingFocusUpgrades).length == 0) {
751
alert("All focus schools are already unlocked.");
752
} else {
753
alert(
754
"Unlocked " +
755
Object.keys(missingFocusUpgrades).length +
756
" 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."
757
);
758
}
759
});
760
});
761
}
762
763
function unlockFocusSchool(upgradeType) {
764
return new Promise(resolve => {
765
// Deselect current FocusAbility so we will be able to unlock the way for free
766
$.post({
767
url: "/api/focus.php?" + window.authz + "&op=5",
768
contentType: "text/plain",
769
data: "{}"
770
}).done(function () {
771
// Unlock the way now
772
$.post({
773
url: "/api/focus.php?" + window.authz + "&op=2",
774
contentType: "text/plain",
775
data: JSON.stringify({
776
FocusType: upgradeType
777
})
778
}).done(function () {
779
resolve();
780
});
781
});
782
});
783
}