Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Engel Simulator 2020
Engel Simulator 2020
Commits
38d03eaa
Commit
38d03eaa
authored
Mar 08, 2021
by
Rahix
🦀
Browse files
cheats: No more manually adding new cheats in index.ts
Functional programming is simply superior.
parent
032d18b7
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
www/src/index.ts
View file @
38d03eaa
...
...
@@ -4,9 +4,9 @@ import "./styles.scss";
wasm
.
start
();
(
window
as
any
).
cheats
=
{
set_sanity
:
wasm
.
cheat_set_sanity
,
set_shifts
:
wasm
.
cheat_set_shifts
,
get_player
:
wasm
.
cheat_get_player
,
enable
:
wasm
.
cheat_enable
,
}
;
(
window
as
any
).
cheats
=
Object
.
assign
(
{}
,
...
Object
.
keys
(
wasm
)
.
filter
((
f
)
=>
f
.
startsWith
(
"
cheat_
"
))
.
map
((
f
)
=>
({[
f
.
substr
(
6
)]
:
(
wasm
as
any
)[
f
]}))
)
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment