-
-
Notifications
You must be signed in to change notification settings - Fork 20.9k
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
base: 3.x
Are you sure you want to change the base?
[3.x] Allow overriding _clips_input()
for ScrollContainer and GraphEdit
#53780
Conversation
f6eba67
to
04e857a
Compare
if (get_script_instance()) { | ||
return get_script_instance()->call(SceneStringNames::get_singleton()->_clips_input); | ||
} |
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.
Won't this break if there is a script and it does not implement _clips_input
?
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.
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.
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.
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).
71cb8d3
to
c58391c
Compare
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]>
04e857a
to
9cf9ff8
Compare
_clips_input()
for ScrollContainer and GraphEdit_clips_input()
for ScrollContainer and GraphEdit
This is already done in Control, but the C++ method overrides didn't check for possible script overrides.
The
master
branch does not haveclips_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 🙂