Skip to content

Commit

Permalink
add double click logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Sep 12, 2024
1 parent ca30647 commit 8d9c19f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 48 deletions.
8 changes: 8 additions & 0 deletions packages/backend/src/scene/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ export class Tree extends PixiHandler {
});
}

public logSelected() {
if (!window.$pixi) {
return;
}

console.log(window.$pixi);
}

private _getName(container: Container) {
let type = container.constructor.name as PixiNodeType;

Expand Down
6 changes: 1 addition & 5 deletions packages/frontend/src/pages/assets/AssetsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ export const AssetsPanel = () => {
fetchData();
}, [bridge]);

if (!version) {
return null;
}

if (Number(version) < 8) {
if (!version || Number(version) < 8) {
return (
<div className="flex flex-grow flex-col overflow-hidden">
<div className="flex flex-grow items-center justify-center text-2xl dark:text-white">
Expand Down
43 changes: 1 addition & 42 deletions packages/frontend/src/pages/rendering/RenderingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export const RenderingPanel = () => {
fetchData();
}, [bridge]);

if (!version) {
return null;
}

if (Number(version) < 8) {
if (!version || Number(version) < 8) {
return (
<div className="flex flex-grow flex-col overflow-hidden">
<div className="flex flex-grow items-center justify-center text-2xl dark:text-white">
Expand All @@ -35,43 +31,6 @@ export const RenderingPanel = () => {
<RenderingStats />
<CanvasPanel />
<InstructionsPanel />
{/* <CollapsibleSection title={'Inspector'}>
<div className="flex h-full w-full flex-col overflow-hidden">
<div className="flex flex-col">
<div className="border-border flex h-8 max-h-8 items-center gap-2 border-b">
<div className="flex h-8 max-h-8 items-center">
<Button
variant="ghost"
size="icon"
className="hover:border-primary h-full w-full rounded-none hover:border-b-2"
onClick={onCapture}
>
<div className="flex items-center space-x-2 px-2">
<CaptureIcon className="dark:fill-white" />
<div>Capture</div>
</div>
</Button>
</div>
<Separator orientation="vertical" className="h-4" />
<div className="flex items-center space-x-2">
<Checkbox
id="screenshot"
defaultChecked={captureWithScreenshot}
onCheckedChange={onCaptureWithScreenshot}
/>
<label className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
Capture Draw Call Screenshot
</label>
</div>
</div>
</div>
{loading ? (
<div className="flex flex-grow items-center justify-center text-2xl dark:text-white">Capturing...</div>
) : (
<Instructions />
)}
</div>
</CollapsibleSection> */}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,19 @@ export const NodeTrigger: React.FC<{
onToggle: () => void;
bridge: BridgeFn;
}> = ({ dragHandle, style, node, onToggle, bridge }) => {
const doubleClick = () => {
if (!node.isLeaf) {
onToggle();
} else {
bridge(`window.__PIXI_DEVTOOLS_WRAPPER__?.scene.tree.logSelected()`);
}
};
return (
<div
ref={dragHandle}
style={style}
className={cn('mb-1 flex h-full min-w-max items-center gap-2 leading-5', node.state)}
onDoubleClick={onToggle}
onDoubleClick={doubleClick}
onMouseEnter={() => {
bridge(`window.__PIXI_DEVTOOLS_WRAPPER__?.scene.overlay.highlight(${JSON.stringify(node.id)})`);
}}
Expand Down

0 comments on commit 8d9c19f

Please sign in to comment.