Skip to content

Conversation

@dylanmccall
Copy link
Contributor

By default, when a node is selected, Godot shows the 2D or 3D editor corresponding to the selected node type. Showing the Block Code editor when a BlockCode node is selected will make the flow of the editor easier to understand.

By default, when a node is selected, Godot shows the 2D or 3D editor
corresponding to the selected node type. Showing the Block Code editor
when a BlockCode node is selected will make the flow of the editor
easier to understand.
@dylanmccall dylanmccall requested review from manuq and wnbaum June 17, 2024 21:44
Copy link
Member

@dbnicholson dbnicholson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 My godot knowledge is not high enough to know if this is the correct way to do it, but it certainly looks reasonable.



func _on_editor_inspector_edited_object_changed():
var block_code: BlockCode = editor_inspector.get_edited_object() as BlockCode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not aware of Godot's behavior to set the casted value to null if doesn't match the casted type. That's both neat and frightening.

@dbnicholson dbnicholson merged commit b8260b8 into main Jun 17, 2024
@dbnicholson dbnicholson deleted the show-editor-automatically branch June 17, 2024 21:59
@manuq
Copy link
Contributor

manuq commented Jun 18, 2024

This is great @dylanmccall !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants