-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First iteration of an oject properties tab 🗝️.
- Loading branch information
Showing
8 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import ScriptCode from './ScriptCode'; | ||
|
||
const RoomObjectProperties = ({ object }) => { | ||
if (!object) { | ||
return ( | ||
<div className="text-xs">Click the inspect icon next to an object.</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="text-xs"> | ||
<h2 className="text-sm">Properties</h2> | ||
|
||
<div> | ||
<span>ID: </span> | ||
<span>{object.id}</span> | ||
</div> | ||
<div> | ||
<span>Position: </span> | ||
<span> | ||
{object.x}, {object.y} | ||
</span> | ||
</div> | ||
<div> | ||
<span>Dimension: </span> | ||
<span> | ||
{object.width} x {object.height} | ||
</span> | ||
</div> | ||
|
||
{object?.scripts?.length > 0 && <h2 className="pt-4 text-sm">Scripts</h2>} | ||
|
||
{object?.scripts?.map(([verb, code]) => ( | ||
<div key={verb}> | ||
<h3>{verb}</h3> | ||
<ScriptCode code={code} /> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default RoomObjectProperties; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters