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

[3.x] Allow overriding _clips_input() for ScrollContainer and GraphEdit #53780

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 13, 2021

This is already done in Control, but the C++ method overrides didn't check for possible script overrides.

The master branch does not have clips_input(). I don't know if a different fix is needed there (or whether it's needed at all).

This closes #42889. Thanks @rgson for the implementation 🙂

@Calinou Calinou requested a review from a team as a code owner October 13, 2021 20:40
@Calinou Calinou added this to the 3.4 milestone Oct 13, 2021
@Calinou Calinou force-pushed the scrollcontainer-graphedit-allow-clips-input-script-override branch from f6eba67 to 04e857a Compare October 13, 2021 21:12
Comment on lines +241 to +243
if (get_script_instance()) {
return get_script_instance()->call(SceneStringNames::get_singleton()->_clips_input);
}
Copy link
Member

Choose a reason for hiding this comment

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

Won't this break if there is a script and it does not implement _clips_input?

Copy link

Choose a reason for hiding this comment

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

It's the same as what's in scene/gui/control.cpp already, so I'd presume that it's fine, but it ought to be tested to confirm.

Copy link
Member Author

@Calinou Calinou Jun 27, 2023

Choose a reason for hiding this comment

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

Rebased against latest 3.x and tested with the mentioned use case, it works as expected. No errors appear when using a GraphEdit with a script attached that has no _clips_input() method (or when no script is attached at all).

This is already done in Control, but the C++ method overrides didn't
check for possible script overrides.

Co-authored-by: Robin Gustafsson <[email protected]>
@Calinou Calinou force-pushed the scrollcontainer-graphedit-allow-clips-input-script-override branch from 04e857a to 9cf9ff8 Compare June 27, 2023 07:54
@akien-mga akien-mga changed the title Allow overriding _clips_input() for ScrollContainer and GraphEdit [3.x] Allow overriding _clips_input() for ScrollContainer and GraphEdit Jun 27, 2023
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.

3 participants