Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces the side debug bar with a live object view #781

Merged
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"socket.io": "^2.1.1",
"socket.io-client": "^2.3.0",
"svelte": "^3.24.0",
"svelte-json-tree-auto": "^0.1.0",
"ts-toolbelt": "^6.3.6",
"uuid": "3.2.1"
},
Expand Down
17 changes: 8 additions & 9 deletions src/client/debug/main/Main.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
export let client;

const JSONTree = require('svelte-json-tree-auto');
import Move from './Move.svelte';
import Controls from './Controls.svelte';
import PlayerInfo from './PlayerInfo.svelte';
Expand Down Expand Up @@ -31,9 +32,9 @@
</script>

<style>
.json {
font-family: monospace;
color: #888;
.tree {
--json-tree-font-family: monospace;
--json-tree-font-size: 14px;
}

label {
Expand Down Expand Up @@ -105,14 +106,12 @@
</div>
</section>

<section>
<section class="tree">
<label>G</label>
<pre class="json">{JSON.stringify(G, null, 2)}</pre>
<JSONTree value={G} />
</section>

<section>
<section class="tree">
<label>ctx</label>
<pre class="json">
{JSON.stringify(SanitizeCtx(ctx), null, 2)}
</pre>
<JSONTree value={SanitizeCtx(ctx)} />
</section>