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 valid types in SceneTreeDialog #79593

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 17, 2023

When picking node for Node/NodePath property, allowed type is now displayed at the top:
image

Multiple types:
image

Closes #62483

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master e8aa8c1), it works as expected.

image

Code looks good to me at a glance.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Jul 25, 2023
@YuriSizov YuriSizov self-requested a review July 27, 2023 12:37
Comment on lines 1512 to 1532
TextureRect *trect = memnew(TextureRect);
hflow->add_child(trect);
trect->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE);
trect->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
trect->set_meta("type", type);
valid_type_icons.push_back(trect);

Label *label = memnew(Label);
hflow->add_child(label);
label->set_text(type);
label->set_auto_translate(false);
Copy link
Contributor

@YuriSizov YuriSizov Aug 3, 2023

Choose a reason for hiding this comment

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

We should group them in hbox, otherwise the label and the icon can end up on separate lines.

image

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

One thing needs addressing, otherwise should be good.

I'm a bit concerned about the usability if you have many different types listed, but I guess we can assume this to be a rare/edge case.

@YuriSizov
Copy link
Contributor

You have shadowing issues 🙃

@akien-mga akien-mga merged commit 516cb63 into godotengine:master Aug 4, 2023
14 checks passed
@KoBeWi KoBeWi deleted the duck_typing_dialog branch August 4, 2023 15:01
@akien-mga
Copy link
Member

Thanks!

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.

Can't tell expected node type without looking into the script
4 participants