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

Show Block Code editor when BlockCode node is selected #41

Merged
merged 1 commit into from
Jun 17, 2024

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
1 check passed
@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.

3 participants