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

Make custom types more subtle and more useful #30697

Merged

Conversation

bojidar-bg
Copy link
Contributor

Implements #6067 (comment) (@aaronfranke's idea).
Fixes #26980.

Also, makes custom type icons show in the AnimationPlayer editor.

@akien-mga akien-mga added this to the 3.2 milestone Jul 19, 2019
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Very nice! I can confirm this works with existing projects and has the expected behavior, with no noticeable problems.

Note that it only works with types added via add_custom_type and not class_name, which I actually think is ideal because it prevents user-made classes from showing up with faded scripts. It makes sense to only fade scripts for types added via plugins and add_custom_type.

@@ -295,6 +304,9 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
Ref<Script> script = p_node->get_script();
if (!script.is_null()) {
item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path());
if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == script) {
item->set_button_color(0, item->get_button_count(0) - 1, Color(1, 1, 1, 0.5));
Copy link
Member

@aaronfranke aaronfranke Jul 19, 2019

Choose a reason for hiding this comment

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

I would personally make it more transparent than 50%, since it's useful to know if you look closely but it's not something you usually need to see at a quick glance or when looking through your hierarchy. But this is open to discussion of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially made it disabled (and unclickable), but then decided to only use the disabled style (which is 50% transparent) with a working button.

@akien-mga akien-mga merged commit 3aeca70 into godotengine:master Jul 20, 2019
@akien-mga
Copy link
Member

Thanks!

@toiletsnakes
Copy link

THERE WAS MUCH REJOICING!
👏 🎈

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

Successfully merging this pull request may close these issues.

Wrong type is shown in tooltip of custom not in scene tree
4 participants