-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Color Pickers Respect Default Editor Settings #62581
Conversation
Looks good overall, but you shouldn't change ColorPicker nodes to ColorPickerButtons as they won't work correctly. Instead you can manually setup the picker, e.g. here godot/editor/plugins/script_text_editor.cpp Lines 1177 to 1179 in 03765b2
here godot/scene/gui/gradient_edit.cpp Lines 75 to 80 in 03765b2
etc. (you can also connect to the custom popups there) |
Made changes from the recommendations. Things to note that I forgot to mention initially, I looked into fire-forge's suggestion for making everything use the same color picker. It seems just a little out of the scope of what I can do but I might consider working on it in the future. I also had a different perspective in consolidating the script used to sync the color picker settings into a single method. It might be a bandage solution but it could be an easier way to achieve the same goal. I'd like some feedback on the idea. Also, I reverted the ColorPicker variables and adjusted the connections appropriately but kept them in the original locations to avoid calling it repeatedly. |
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.
Looks good now. You need to squash the commits.
828170b
to
1ba6e50
Compare
Ah now I noticed that GradientEdit isn't editor class, so it can't include editor-related code. You need to add a public method that returns the popup and then setup it in gradient editor plugin. Also style checks failed, so you need to run |
1ba6e50
to
028cc31
Compare
Needs a rebase/rework after #62075. |
@@ -85,6 +85,7 @@ void GradientEditor::reverse_gradient() { | |||
} | |||
|
|||
GradientEditor::GradientEditor() { | |||
GradientEdit::get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker), varray(GradientEdit::get_picker())); |
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.
GradientEdit::get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker), varray(GradientEdit::get_picker())); | |
get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker), varray(GradientEdit::get_picker())); |
Not necessary.
The rebase should be easy, just initialization code has changed from godot/editor/editor_properties.cpp Lines 3012 to 3020 in 31745a8
to godot/editor/editor_properties.cpp Lines 3012 to 3015 in ca18a02
|
Do I add back the _picker_created function with these suggested changes? |
You need to update your |
e6209fe
to
7a9faf3
Compare
Sorry that it got a little messy, but I cleaned everything up and I think all the changes appropriately accommodate the rebase. |
11444ad
to
4d72a78
Compare
Updated editor_node with function that sets up color pickers throughout Godot to respect editor's settings.
4d72a78
to
1b8652e
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
Updated editor_node with set_color_picker function called by color pickers throughout Godot to respect the editor's settings.
Another attempt to fix #57154.
Implemented changes noted in #57402 and rewrote certain color pickers to match the function call and keep everything consistent.