-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Pass current value to EditorInterface
node/property popups
#94323
Conversation
1dabc9c
to
998e212
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Even if these methods were introduced in an alpha/beta build of Godot 4.3? The practical reason behind this PR in the first place was to address the shortcomings of the original implementation so that when it gets into a stable build, these APIs are reasonably feature complete and to avoid needing compatibility methods. |
Oh my bad didn't know they were current, then it's unnecessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with the internals so a second eye on this would be good but the code looks good to me and the existing interface is just employed
The |
I wonder if that is a bug in the actual base dialog implementation because all this PR allows you to pass the same value the editor would pass when using this dialog in the engine or C++ modules. I'll take a look after work today and get back to you, @KoBeWi. |
Hi @KoBeWi so I checked the code in the Looking more closely at the uses of So I think for completeness, we should at the very least keep the ability to pass this value on the I'm of the opinion that give where we are with 4.3, we should likely take care of addressing the |
Well, you added a new argument and it didn't require any compatibility code, so looks like adding arguments in the future is not a problem. |
I'll take a look and see if I can reproduce it; however, I used |
Well my test code is this: @tool
extends EditorScript
func _run() -> void:
EditorInterface.popup_property_selector(get_scene().get_node("Icon"), Callable(), [], "z_index") (requires "Icon" node in the current scene) |
Thanks @KoBeWi, fixed. It appears I needed to delay the |
You've added your own compatibility file, this isn't correct, it should be added to the existing |
Well, as you can see that file doesn't exist based on the HEAD of this PR, and so I based those changes on what I saw in other PRs. I'll rebase and amend the existing file. Is this documented somewhere ? |
eeced9a
to
45ce5f1
Compare
Don't think it's documented but it's a general maintenance thing, good to rebase after a release to make sure things are up to date |
doc/classes/EditorInterface.xml
Outdated
<description> | ||
Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. | ||
Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. If [param current_value] is provided, the Node will be automatically selected in the tree, if it exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extraneous space
Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. If [param current_value] is provided, the Node will be automatically selected in the tree, if it exists. | |
Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. If [param current_value] is provided, the Node will be automatically selected in the tree, if it exists. |
Same below.
52de0e8
to
b6abb12
Compare
Thanks! |
Fixes #94322
As outlined in the issue, while these new methods are nice in Godot 4.3, they don't seem to hit the mark in terms of being fully user friendly without being able to specify a current value, should these be used in cases where the addon already has an existing value and would prefer to highlight that in the dialog when its shown.