Skip to content

A solution that automatically switch to the script tab.#23

Merged
RedMser merged 1 commit intoRedMser:masterfrom
FloatVip:patch-1
Apr 1, 2026
Merged

A solution that automatically switch to the script tab.#23
RedMser merged 1 commit intoRedMser:masterfrom
FloatVip:patch-1

Conversation

@FloatVip
Copy link
Copy Markdown
Contributor

@FloatVip FloatVip commented Apr 1, 2026

Finally, it was simple ! 😅.

Copy link
Copy Markdown
Owner

@RedMser RedMser left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Overriding _handles in general seems fine to me. But I'm unsure if calling set_main_screen_editor here is the best approach, since _handles is meant to be a pure function to find out info, but it should not be changing anything.

E.g. _handles it is called in the FileSystem tooltip code, so does this mean that hovering a script file in the file system dock now opens the script editor?

I assume the call you're looking for comes from get_handling_sub_editors here. Maybe the code below this, in this same function, has some better extension points? Like maybe you can also override _edit or _make_visible of the plugin, and move the main screen switch to there.

@FloatVip
Copy link
Copy Markdown
Contributor Author

FloatVip commented Apr 1, 2026

Hi ! , what happened with me is that execution only occurs if the script file is opened.

@FloatVip FloatVip requested a review from RedMser April 1, 2026 16:18
@FloatVip
Copy link
Copy Markdown
Contributor Author

FloatVip commented Apr 1, 2026

bool _handles(object: Object) virtual const

Implement this function if your plugin edits a specific type of object (Resource or Node). If you return true, then you will get the functions _edit() and _make_visible() called when the editor requests them. If you have declared the methods _forward_canvas_gui_input() and _forward_3d_gui_input() these will be called too.

Note: Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors.

Comment thread project/addons/embed_external_editor/plugin.gd
@FloatVip FloatVip requested a review from RedMser April 1, 2026 16:41
Copy link
Copy Markdown
Owner

@RedMser RedMser left a comment

Choose a reason for hiding this comment

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

Alright... in that case I'll accept since it fixes the problem and doesn't seem to cause other problems.

Thanks again ^^

@RedMser RedMser merged commit 7cad325 into RedMser:master Apr 1, 2026
2 checks passed
@FloatVip
Copy link
Copy Markdown
Contributor Author

FloatVip commented Apr 1, 2026

Thank you, and best wishes .!

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.

2 participants