-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[Compatibility] Add stub for VisualShaderNodeComment #90797
Conversation
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.
Looks good otherwise!
9f3d702
to
2e8fd3b
Compare
ddcb1ed
to
5cab3f3
Compare
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.
Thank you for bearing with me
void VisualShaderNodeComment::_set_description_bind_compat_88014(const String &p_description) { | ||
} | ||
|
||
String VisualShaderNodeComment::_get_description_bind_compat_88014() const { | ||
return ""; | ||
} |
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.
Instead of empty compatibility stubs, WDYT about actually re-exposing the description
property, and make it save its value in Object.set_meta
?
This would allow users to salvage that information instead of losing it when moving to 4.3.
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.
Good idea, done.
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.
Not sure whether it's correct to put ADD_PROPERTY in _bind_compatibility_methods() though.
This line should be removed from the
|
d35e82a
to
0360a6e
Compare
0360a6e
to
913e2d8
Compare
void VisualShaderNodeComment::_set_description_bind_compat_88014(const String &p_description) { | ||
set_meta("description", p_description); | ||
} | ||
|
||
String VisualShaderNodeComment::_get_description_bind_compat_88014() const { | ||
return get_meta("description", ""); | ||
} | ||
|
||
void VisualShaderNodeComment::_bind_compatibility_methods() { | ||
ClassDB::bind_compatibility_method(D_METHOD("set_description", "description"), &VisualShaderNodeComment::_set_description_bind_compat_88014); | ||
ClassDB::bind_compatibility_method(D_METHOD("get_description"), &VisualShaderNodeComment::_get_description_bind_compat_88014); | ||
|
||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "description"), "set_description", "get_description"); | ||
} |
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.
Actually now that I think further about it:
- I think this can be "normal" method bindings in
_bind_methods
instead of compat bindings. The class itself is already deprecated/for compat so the methods themselves don't need to be too. - If so, we can also re-add the
description
property fully, and document that it doesn't do anything in this new setup, but is used to preserve data authored in earlier Godot versions.
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.
To be clear, this means also moving them to visual_shader.cpp
(enclosed in #ifndef DISABLE_DEPRECATED
) and the .compat.inc
file can be removed.
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.
Alright, done :)
<description> | ||
</description> |
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.
We should figure out something to write here too just to keep the completion ratio high in https://godotengine.github.io/doc-status/ :)
913e2d8
to
e685d92
Compare
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.
Perfect!
BTW, hello Geometror from the future 👋
Date: Wed, 17 Apr 2024 19:00:41 +0200
e685d92
to
37ab2bb
Compare
37ab2bb
to
bd096fb
Compare
Seems like these still get raised despite the API being present in the parent class:
Not sure how we handled this in the past, I think it might be fine to just ignore those in the Edit: Confirmed, that's what we did in the 4.1->4.2 transition for APIs moved from AnimationPlayer and AnimationTree to the AnimationMixer base class. |
Yes, to double confirm: if a method moves up to a base class, it's fine to ignore the message in the |
bd096fb
to
735c45d
Compare
Thanks! |
Fixes part of #90303.