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

@KoBeWi KoBeWi added this to the 4.x milestone Jul 17, 2023
@KoBeWi KoBeWi force-pushed the duck_typing_dialog branch from 1fb52f8 to b9b30ca Compare July 17, 2023 21:47
@KoBeWi KoBeWi requested a review from a team July 17, 2023 21:47
@KoBeWi KoBeWi force-pushed the duck_typing_dialog branch from b9b30ca to a5aad8a Compare July 18, 2023 11:21
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.

@KoBeWi KoBeWi force-pushed the duck_typing_dialog branch from a5aad8a to 44d2fab Compare August 3, 2023 20:40
@YuriSizov
Copy link
Contributor

You have shadowing issues 🙃

@KoBeWi KoBeWi force-pushed the duck_typing_dialog branch from 44d2fab to 05ab444 Compare August 4, 2023 11:50
@akien-mga akien-mga merged commit 516cb63 into godotengine:master Aug 4, 2023
@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