Skip to content

Commit 7c45c36

Browse files
github-actionsClaytonTDM
andcommitted
Format "debug menu"
Original commit: 1667c17 Co-authored-by: ClaytonTDM <[email protected]>
1 parent 1667c17 commit 7c45c36

File tree

4 files changed

+5283
-37
lines changed

4 files changed

+5283
-37
lines changed

game/images/Zombies/CX/v.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0ab5904be6a1811fd5e0464bdf72bf1518376b27
1+
1667c1754934d1ad24f15fb79985c5e24afa3c3f

game/js/Cheatcodes.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ let cheatCodes = {
4545
},
4646
debug: () => {
4747
import("./Debug.js");
48-
}
48+
},
4949
};
5050

5151
function getCheatAction(cheat) {
5252
return typeof cheat === "function" ? cheat : cheat.action;
5353
}
5454

5555
function shouldClearSequence(cheat) {
56-
if (typeof cheat === "function") {return true;}
56+
if (typeof cheat === "function") {
57+
return true;
58+
}
5759
return cheat.clearSequence !== false;
5860
}
5961

game/js/Debug.js

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,10 @@ const [levelTab, cheatsTab, variablesTab] = tab.pages;
1414

1515
const stringifyProxy = (obj) =>
1616
new Proxy(obj, {
17-
get: (t, k) =>
18-
typeof t[k] === "object" && t[k] !== null
19-
? JSON.stringify(t[k])
20-
: String(t[k]),
17+
get: (t, k) => (typeof t[k] === "object" && t[k] !== null ? JSON.stringify(t[k]) : String(t[k])),
2118
});
2219

23-
function syncKeys({
24-
keys,
25-
bindings,
26-
add,
27-
remove,
28-
}) {
20+
function syncKeys({ keys, bindings, add, remove }) {
2921
for (const k of bindings.keys()) {
3022
if (!keys.includes(k)) {
3123
remove(k);
@@ -50,8 +42,12 @@ function dynamicObjectFolder(container, source, title, { expanded = false, inclu
5042

5143
const validKeys = () =>
5244
Object.keys(obj).filter((k) => {
53-
if (exclude.includes(k)) {return false;}
54-
if (include && !include.includes(k)) {return false;}
45+
if (exclude.includes(k)) {
46+
return false;
47+
}
48+
if (include && !include.includes(k)) {
49+
return false;
50+
}
5551
return typeof obj[k] !== "function";
5652
});
5753

@@ -85,7 +81,9 @@ function dynamicObjectFolder(container, source, title, { expanded = false, inclu
8581
folder,
8682
observed,
8783
setSource(newObj) {
88-
for (const b of bindings.values()) {b.dispose();}
84+
for (const b of bindings.values()) {
85+
b.dispose();
86+
}
8987
bindings.clear();
9088
obj = newObj;
9189
proxy = stringifyProxy(obj);
@@ -104,19 +102,17 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
104102

105103
const syncItem = (i) => {
106104
const el = arr[i];
107-
if (!el || typeof el !== "object") {return;}
105+
if (!el || typeof el !== "object") {
106+
return;
107+
}
108108

109109
const entry = items.get(i);
110110
const keys = Object.keys(el).filter((k) => typeof el[k] !== "function");
111111

112112
syncKeys({
113113
keys,
114114
bindings: entry.bindings,
115-
add: (k) =>
116-
entry.bindings.set(
117-
k,
118-
entry.folder.addBinding(entry.proxy, k, { readonly: true })
119-
),
115+
add: (k) => entry.bindings.set(k, entry.folder.addBinding(entry.proxy, k, { readonly: true })),
120116
remove: (k) => {
121117
entry.bindings.get(k).dispose();
122118
entry.bindings.delete(k);
@@ -134,7 +130,9 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
134130

135131
for (let i = 0; i < arr.length; i++) {
136132
const el = arr[i];
137-
if (!el || typeof el !== "object") {continue;}
133+
if (!el || typeof el !== "object") {
134+
continue;
135+
}
138136

139137
if (!items.has(i)) {
140138
const entry = {
@@ -147,7 +145,9 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
147145
syncItem(i);
148146
} else if (items.get(i).source !== el) {
149147
const entry = items.get(i);
150-
for (const b of entry.bindings.values()) {b.dispose();}
148+
for (const b of entry.bindings.values()) {
149+
b.dispose();
150+
}
151151
entry.bindings.clear();
152152
entry.proxy = stringifyProxy(el);
153153
entry.source = el;
@@ -178,12 +178,7 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
178178

179179
const osFolder = dynamicObjectFolder(variablesTab, oS, "oS");
180180
const userFolder = dynamicObjectFolder(variablesTab, $User, "$User");
181-
const soundsFolder = dynamicArrayFolder(
182-
variablesTab,
183-
playingSounds,
184-
"playingSounds",
185-
{ itemExpanded: true }
186-
);
181+
const soundsFolder = dynamicArrayFolder(variablesTab, playingSounds, "playingSounds", { itemExpanded: true });
187182

188183
window.oS = osFolder.observed;
189184
window.$User = userFolder.observed;
@@ -246,12 +241,7 @@ const sun = cheatsTab.addBlade({
246241
});
247242

248243
cheatsTab.addButton({ title: "Gain Sun" }).on("click", () => {
249-
const id = AppearSun(
250-
$User.Mouse.x - 45,
251-
$User.Mouse.y + 45,
252-
Math.round(sun.value),
253-
false
254-
);
244+
const id = AppearSun($User.Mouse.x - 45, $User.Mouse.y + 45, Math.round(sun.value), false);
255245

256246
if (!oS.AutoSun) {
257247
oSym.addTask(Math.round(1000 / oSym.TimeStep), ClickSun, [id]);

game/js/tweakpane.min.js

Lines changed: 5255 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)