You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #107965 from KoBeWi/deprecate_deprecation
Restore `graph_offset` property
This commit is contained in:
@@ -186,6 +186,11 @@
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" deprecated="This property does nothing and always equals to zero.">
|
||||
Deprecated.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="TYPE_VERTEX" value="0" enum="Type">
|
||||
A vertex shader, operating on vertices.
|
||||
|
||||
@@ -321,11 +321,3 @@ Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/add_image/a
|
||||
Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/update_image/arguments': size changed value in new API, from 11 to 12.
|
||||
|
||||
Optional argument added. Compatibility methods registered.
|
||||
|
||||
|
||||
GH-98566
|
||||
--------
|
||||
Validate extension JSON: API was removed: classes/VisualShader/methods/set_graph_offset
|
||||
Validate extension JSON: API was removed: classes/VisualShader/methods/get_graph_offset
|
||||
|
||||
The graph_offset property was removed from the resource. This information is now stored in `vs_editor_cache.cfg`.
|
||||
|
||||
@@ -1466,6 +1466,17 @@ bool VisualShader::is_text_shader() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
void VisualShader::set_graph_offset(const Vector2 &p_offset) {
|
||||
WARN_DEPRECATED_MSG("graph_offset property is deprecated. Setting it has no effect.");
|
||||
}
|
||||
|
||||
Vector2 VisualShader::get_graph_offset() const {
|
||||
WARN_DEPRECATED_MSG("graph_offset property is deprecated. Getting it always returns Vector2().");
|
||||
return Vector2();
|
||||
}
|
||||
#endif
|
||||
|
||||
String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port, Vector<DefaultTextureParam> &default_tex_params) const {
|
||||
Ref<VisualShaderNode> node = get_node(p_type, p_node);
|
||||
ERR_FAIL_COND_V(node.is_null(), String());
|
||||
@@ -3154,6 +3165,12 @@ void VisualShader::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_update_shader"), &VisualShader::_update_shader);
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
ClassDB::bind_method(D_METHOD("set_graph_offset", "offset"), &VisualShader::set_graph_offset);
|
||||
ClassDB::bind_method(D_METHOD("get_graph_offset"), &VisualShader::get_graph_offset);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "graph_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_graph_offset", "get_graph_offset");
|
||||
#endif
|
||||
|
||||
ADD_PROPERTY_DEFAULT("code", ""); // Inherited from Shader, prevents showing default code as override in docs.
|
||||
|
||||
BIND_ENUM_CONSTANT(TYPE_VERTEX);
|
||||
|
||||
@@ -242,6 +242,11 @@ public: // internal methods
|
||||
|
||||
virtual bool is_text_shader() const override;
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
void set_graph_offset(const Vector2 &p_offset);
|
||||
Vector2 get_graph_offset() const;
|
||||
#endif
|
||||
|
||||
String generate_preview_shader(Type p_type, int p_node, int p_port, Vector<DefaultTextureParam> &r_default_tex_params) const;
|
||||
|
||||
String validate_port_name(const String &p_port_name, VisualShaderNode *p_node, int p_port_id, bool p_output) const;
|
||||
|
||||
Reference in New Issue
Block a user