diff options
387 files changed, 2805 insertions, 2351 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index 5b96babe44..c43fd64561 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -353,8 +353,9 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = { { "ui_text_scroll_down", TTRC("Scroll Down") }, { "ui_text_scroll_down.OSX", TTRC("Scroll Down") }, { "ui_text_select_all", TTRC("Select All") }, - { "ui_text_select_word_under_caret", TTRC("Select Word Under Caret") }, + { "ui_text_select_word_under_caret", TTRC("Select Word Under Caret") }, { "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") }, + { "ui_text_submit", TTRC("Text Submitted") }, { "ui_graph_duplicate", TTRC("Duplicate Nodes") }, { "ui_graph_delete", TTRC("Delete Nodes") }, { "ui_filedialog_up_one_level", TTRC("Go Up One Level") }, @@ -668,6 +669,11 @@ const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() { inputs.push_back(InputEventKey::create_reference(KEY_MENU)); default_builtin_cache.insert("ui_menu", inputs); + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_ENTER)); + inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER)); + default_builtin_cache.insert("ui_text_submit", inputs); + // ///// UI Graph Shortcuts ///// inputs = List<Ref<InputEvent>>(); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 0cf870e7e7..449ebaa6ee 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -825,7 +825,7 @@ void HTTPClient::_bind_methods() { ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "blocking_mode_enabled"), "set_blocking_mode", "is_blocking_mode_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "connection", PROPERTY_HINT_RESOURCE_TYPE, "StreamPeer", 0), "set_connection", "get_connection"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "connection", PROPERTY_HINT_RESOURCE_TYPE, "StreamPeer", PROPERTY_USAGE_NONE), "set_connection", "get_connection"); ADD_PROPERTY(PropertyInfo(Variant::INT, "read_chunk_size", PROPERTY_HINT_RANGE, "256,16777216"), "set_read_chunk_size", "get_read_chunk_size"); BIND_ENUM_CONSTANT(METHOD_GET); diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 78ec7ea21a..51ba8800e4 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -1123,8 +1123,8 @@ void MultiplayerAPI::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_object_decoding"), "set_allow_object_decoding", "is_object_decoding_allowed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "refuse_new_network_connections"), "set_refuse_new_network_connections", "is_refusing_new_network_connections"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", 0), "set_network_peer", "get_network_peer"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root_node", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_root_node", "get_root_node"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", PROPERTY_USAGE_NONE), "set_network_peer", "get_network_peer"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root_node", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_root_node", "get_root_node"); ADD_PROPERTY_DEFAULT("refuse_new_network_connections", false); ADD_SIGNAL(MethodInfo("network_peer_connected", PropertyInfo(Variant::INT, "id"))); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 318fd10243..8da44fd290 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -161,7 +161,7 @@ void PacketPeerStream::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "input_buffer_max_size"), "set_input_buffer_max_size", "get_input_buffer_max_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "output_buffer_max_size"), "set_output_buffer_max_size", "get_output_buffer_max_size"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream_peer", PROPERTY_HINT_RESOURCE_TYPE, "StreamPeer", 0), "set_stream_peer", "get_stream_peer"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream_peer", PROPERTY_HINT_RESOURCE_TYPE, "StreamPeer", PROPERTY_USAGE_NONE), "set_stream_peer", "get_stream_peer"); } Error PacketPeerStream::_poll_buffer() const { diff --git a/core/math/basis.h b/core/math/basis.h index 3736047dd3..2889a4aa5e 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -158,8 +158,8 @@ public: _FORCE_INLINE_ Basis operator+(const Basis &p_matrix) const; _FORCE_INLINE_ void operator-=(const Basis &p_matrix); _FORCE_INLINE_ Basis operator-(const Basis &p_matrix) const; - _FORCE_INLINE_ void operator*=(real_t p_val); - _FORCE_INLINE_ Basis operator*(real_t p_val) const; + _FORCE_INLINE_ void operator*=(const real_t p_val); + _FORCE_INLINE_ Basis operator*(const real_t p_val) const; int get_orthogonal_index() const; void set_orthogonal_index(int p_index); @@ -298,13 +298,13 @@ _FORCE_INLINE_ Basis Basis::operator-(const Basis &p_matrix) const { return ret; } -_FORCE_INLINE_ void Basis::operator*=(real_t p_val) { +_FORCE_INLINE_ void Basis::operator*=(const real_t p_val) { elements[0] *= p_val; elements[1] *= p_val; elements[2] *= p_val; } -_FORCE_INLINE_ Basis Basis::operator*(real_t p_val) const { +_FORCE_INLINE_ Basis Basis::operator*(const real_t p_val) const { Basis ret(*this); ret *= p_val; return ret; diff --git a/core/math/quaternion.cpp b/core/math/quaternion.cpp index 7037db7112..3f1d2c58e5 100644 --- a/core/math/quaternion.cpp +++ b/core/math/quaternion.cpp @@ -33,6 +33,11 @@ #include "core/math/basis.h" #include "core/string/print_string.h" +real_t Quaternion::angle_to(const Quaternion &p_to) const { + real_t d = dot(p_to); + return Math::acos(CLAMP(d * d * 2 - 1, -1, 1)); +} + // get_euler_xyz returns a vector containing the Euler angles in the format // (ax,ay,az), where ax is the angle of rotation around x axis, // and similar for other axes. diff --git a/core/math/quaternion.h b/core/math/quaternion.h index 796214b79e..35324323b3 100644 --- a/core/math/quaternion.h +++ b/core/math/quaternion.h @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef QUAT_H -#define QUAT_H +#ifndef QUATERNION_H +#define QUATERNION_H #include "core/math/math_defs.h" #include "core/math/math_funcs.h" @@ -62,6 +62,7 @@ public: bool is_normalized() const; Quaternion inverse() const; _FORCE_INLINE_ real_t dot(const Quaternion &p_q) const; + real_t angle_to(const Quaternion &p_to) const; Vector3 get_euler_xyz() const; Vector3 get_euler_yxz() const; @@ -235,4 +236,4 @@ _FORCE_INLINE_ Quaternion operator*(const real_t &p_real, const Quaternion &p_qu return p_quaternion * p_real; } -#endif // QUAT_H +#endif // QUATERNION_H diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp index 0140f31b8a..16934d67df 100644 --- a/core/math/transform_2d.cpp +++ b/core/math/transform_2d.cpp @@ -276,6 +276,18 @@ Transform2D Transform2D::interpolate_with(const Transform2D &p_transform, real_t return res; } +void Transform2D::operator*=(const real_t p_val) { + elements[0] *= p_val; + elements[1] *= p_val; + elements[2] *= p_val; +} + +Transform2D Transform2D::operator*(const real_t p_val) const { + Transform2D ret(*this); + ret *= p_val; + return ret; +} + Transform2D::operator String() const { return "[X: " + elements[0].operator String() + ", Y: " + elements[1].operator String() + diff --git a/core/math/transform_2d.h b/core/math/transform_2d.h index 715f013701..34cfd0c1a9 100644 --- a/core/math/transform_2d.h +++ b/core/math/transform_2d.h @@ -107,6 +107,8 @@ struct Transform2D { void operator*=(const Transform2D &p_transform); Transform2D operator*(const Transform2D &p_transform) const; + void operator*=(const real_t p_val); + Transform2D operator*(const real_t p_val) const; Transform2D interpolate_with(const Transform2D &p_transform, real_t p_c) const; diff --git a/core/math/transform_3d.cpp b/core/math/transform_3d.cpp index a34d998dde..51766b39f4 100644 --- a/core/math/transform_3d.cpp +++ b/core/math/transform_3d.cpp @@ -190,6 +190,17 @@ Transform3D Transform3D::operator*(const Transform3D &p_transform) const { return t; } +void Transform3D::operator*=(const real_t p_val) { + origin *= p_val; + basis *= p_val; +} + +Transform3D Transform3D::operator*(const real_t p_val) const { + Transform3D ret(*this); + ret *= p_val; + return ret; +} + Transform3D::operator String() const { return "[X: " + basis.get_axis(0).operator String() + ", Y: " + basis.get_axis(1).operator String() + diff --git a/core/math/transform_3d.h b/core/math/transform_3d.h index 078a2ca11a..3d8e70cec7 100644 --- a/core/math/transform_3d.h +++ b/core/math/transform_3d.h @@ -88,6 +88,8 @@ public: void operator*=(const Transform3D &p_transform); Transform3D operator*(const Transform3D &p_transform) const; + void operator*=(const real_t p_val); + Transform3D operator*(const real_t p_val) const; Transform3D interpolate_with(const Transform3D &p_transform, real_t p_c) const; diff --git a/core/object/object.h b/core/object/object.h index 37b2e61dfe..65621a47ca 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -101,6 +101,7 @@ enum PropertyHint { }; enum PropertyUsageFlags { + PROPERTY_USAGE_NONE = 0, PROPERTY_USAGE_STORAGE = 1, PROPERTY_USAGE_EDITOR = 2, PROPERTY_USAGE_NETWORK = 4, diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 196f7a1876..dd6bc09abb 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -120,7 +120,7 @@ void Script::_bind_methods() { ClassDB::bind_method(D_METHOD("is_tool"), &Script::is_tool); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "source_code", PROPERTY_HINT_NONE, "", 0), "set_source_code", "get_source_code"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "source_code", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_source_code", "get_source_code"); } void ScriptServer::set_scripting_enabled(bool p_enabled) { diff --git a/core/templates/thread_work_pool.h b/core/templates/thread_work_pool.h index 9f7a692cc5..b242648bc8 100644 --- a/core/templates/thread_work_pool.h +++ b/core/templates/thread_work_pool.h @@ -105,7 +105,7 @@ public: } bool is_done_dispatching() const { - ERR_FAIL_COND_V(current_work == nullptr, false); + ERR_FAIL_COND_V(current_work == nullptr, true); return index.load(std::memory_order_acquire) >= current_work->max_elements; } diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 4447cf657a..9c7cd23d72 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1552,6 +1552,7 @@ static void _register_variant_builtin_methods() { bind_method(Quaternion, is_normalized, sarray(), varray()); bind_method(Quaternion, is_equal_approx, sarray("to"), varray()); bind_method(Quaternion, inverse, sarray(), varray()); + bind_method(Quaternion, angle_to, sarray("to"), varray()); bind_method(Quaternion, dot, sarray("with"), varray()); bind_method(Quaternion, slerp, sarray("to", "weight"), varray()); bind_method(Quaternion, slerpni, sarray("to", "weight"), varray()); diff --git a/core/variant/variant_op.cpp b/core/variant/variant_op.cpp index 10d0a83014..e7badd22b8 100644 --- a/core/variant/variant_op.cpp +++ b/core/variant/variant_op.cpp @@ -1458,6 +1458,8 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorMul<Color, Color, double>>(Variant::OP_MULTIPLY, Variant::COLOR, Variant::FLOAT); register_op<OperatorEvaluatorMul<Transform2D, Transform2D, Transform2D>>(Variant::OP_MULTIPLY, Variant::TRANSFORM2D, Variant::TRANSFORM2D); + register_op<OperatorEvaluatorMul<Transform2D, Transform2D, int64_t>>(Variant::OP_MULTIPLY, Variant::TRANSFORM2D, Variant::INT); + register_op<OperatorEvaluatorMul<Transform2D, Transform2D, double>>(Variant::OP_MULTIPLY, Variant::TRANSFORM2D, Variant::FLOAT); register_op<OperatorEvaluatorXForm<Vector2, Transform2D, Vector2>>(Variant::OP_MULTIPLY, Variant::TRANSFORM2D, Variant::VECTOR2); register_op<OperatorEvaluatorXFormInv<Vector2, Vector2, Transform2D>>(Variant::OP_MULTIPLY, Variant::VECTOR2, Variant::TRANSFORM2D); register_op<OperatorEvaluatorXForm<Rect2, Transform2D, Rect2>>(Variant::OP_MULTIPLY, Variant::TRANSFORM2D, Variant::RECT2); @@ -1466,6 +1468,8 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorXFormInv<Vector<Vector2>, Vector<Vector2>, Transform2D>>(Variant::OP_MULTIPLY, Variant::PACKED_VECTOR2_ARRAY, Variant::TRANSFORM2D); register_op<OperatorEvaluatorMul<Transform3D, Transform3D, Transform3D>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::TRANSFORM3D); + register_op<OperatorEvaluatorMul<Transform3D, Transform3D, int64_t>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::INT); + register_op<OperatorEvaluatorMul<Transform3D, Transform3D, double>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::FLOAT); register_op<OperatorEvaluatorXForm<Vector3, Transform3D, Vector3>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::VECTOR3); register_op<OperatorEvaluatorXFormInv<Vector3, Vector3, Transform3D>>(Variant::OP_MULTIPLY, Variant::VECTOR3, Variant::TRANSFORM3D); register_op<OperatorEvaluatorXForm<::AABB, Transform3D, ::AABB>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::AABB); @@ -1474,6 +1478,8 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorXFormInv<Vector<Vector3>, Vector<Vector3>, Transform3D>>(Variant::OP_MULTIPLY, Variant::PACKED_VECTOR3_ARRAY, Variant::TRANSFORM3D); register_op<OperatorEvaluatorMul<Basis, Basis, Basis>>(Variant::OP_MULTIPLY, Variant::BASIS, Variant::BASIS); + register_op<OperatorEvaluatorMul<Basis, Basis, int64_t>>(Variant::OP_MULTIPLY, Variant::BASIS, Variant::INT); + register_op<OperatorEvaluatorMul<Basis, Basis, double>>(Variant::OP_MULTIPLY, Variant::BASIS, Variant::FLOAT); register_op<OperatorEvaluatorXForm<Vector3, Basis, Vector3>>(Variant::OP_MULTIPLY, Variant::BASIS, Variant::VECTOR3); register_op<OperatorEvaluatorXFormInv<Vector3, Vector3, Basis>>(Variant::OP_MULTIPLY, Variant::VECTOR3, Variant::BASIS); diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index 751cb64c62..28930a19e2 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -1423,47 +1423,47 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str } break; case Variant::VECTOR2: { Vector2 v = p_variant; - p_store_string_func(p_store_string_ud, "Vector2( " + rtosfix(v.x) + ", " + rtosfix(v.y) + " )"); + p_store_string_func(p_store_string_ud, "Vector2(" + rtosfix(v.x) + ", " + rtosfix(v.y) + ")"); } break; case Variant::VECTOR2I: { Vector2i v = p_variant; - p_store_string_func(p_store_string_ud, "Vector2i( " + itos(v.x) + ", " + itos(v.y) + " )"); + p_store_string_func(p_store_string_ud, "Vector2i(" + itos(v.x) + ", " + itos(v.y) + ")"); } break; case Variant::RECT2: { Rect2 aabb = p_variant; - p_store_string_func(p_store_string_ud, "Rect2( " + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + " )"); + p_store_string_func(p_store_string_ud, "Rect2(" + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + ")"); } break; case Variant::RECT2I: { Rect2i aabb = p_variant; - p_store_string_func(p_store_string_ud, "Rect2i( " + itos(aabb.position.x) + ", " + itos(aabb.position.y) + ", " + itos(aabb.size.x) + ", " + itos(aabb.size.y) + " )"); + p_store_string_func(p_store_string_ud, "Rect2i(" + itos(aabb.position.x) + ", " + itos(aabb.position.y) + ", " + itos(aabb.size.x) + ", " + itos(aabb.size.y) + ")"); } break; case Variant::VECTOR3: { Vector3 v = p_variant; - p_store_string_func(p_store_string_ud, "Vector3( " + rtosfix(v.x) + ", " + rtosfix(v.y) + ", " + rtosfix(v.z) + " )"); + p_store_string_func(p_store_string_ud, "Vector3(" + rtosfix(v.x) + ", " + rtosfix(v.y) + ", " + rtosfix(v.z) + ")"); } break; case Variant::VECTOR3I: { Vector3i v = p_variant; - p_store_string_func(p_store_string_ud, "Vector3i( " + itos(v.x) + ", " + itos(v.y) + ", " + itos(v.z) + " )"); + p_store_string_func(p_store_string_ud, "Vector3i(" + itos(v.x) + ", " + itos(v.y) + ", " + itos(v.z) + ")"); } break; case Variant::PLANE: { Plane p = p_variant; - p_store_string_func(p_store_string_ud, "Plane( " + rtosfix(p.normal.x) + ", " + rtosfix(p.normal.y) + ", " + rtosfix(p.normal.z) + ", " + rtosfix(p.d) + " )"); + p_store_string_func(p_store_string_ud, "Plane(" + rtosfix(p.normal.x) + ", " + rtosfix(p.normal.y) + ", " + rtosfix(p.normal.z) + ", " + rtosfix(p.d) + ")"); } break; case Variant::AABB: { AABB aabb = p_variant; - p_store_string_func(p_store_string_ud, "AABB( " + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.position.z) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + ", " + rtosfix(aabb.size.z) + " )"); + p_store_string_func(p_store_string_ud, "AABB(" + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.position.z) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + ", " + rtosfix(aabb.size.z) + ")"); } break; case Variant::QUATERNION: { Quaternion quaternion = p_variant; - p_store_string_func(p_store_string_ud, "Quaternion( " + rtosfix(quaternion.x) + ", " + rtosfix(quaternion.y) + ", " + rtosfix(quaternion.z) + ", " + rtosfix(quaternion.w) + " )"); + p_store_string_func(p_store_string_ud, "Quaternion(" + rtosfix(quaternion.x) + ", " + rtosfix(quaternion.y) + ", " + rtosfix(quaternion.z) + ", " + rtosfix(quaternion.w) + ")"); } break; case Variant::TRANSFORM2D: { - String s = "Transform2D( "; + String s = "Transform2D("; Transform2D m3 = p_variant; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { @@ -1474,11 +1474,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str } } - p_store_string_func(p_store_string_ud, s + " )"); + p_store_string_func(p_store_string_ud, s + ")"); } break; case Variant::BASIS: { - String s = "Basis( "; + String s = "Basis("; Basis m3 = p_variant; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { @@ -1489,11 +1489,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str } } - p_store_string_func(p_store_string_ud, s + " )"); + p_store_string_func(p_store_string_ud, s + ")"); } break; case Variant::TRANSFORM3D: { - String s = "Transform3D( "; + String s = "Transform3D("; Transform3D t = p_variant; Basis &m3 = t.basis; for (int i = 0; i < 3; i++) { @@ -1507,13 +1507,13 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str s = s + ", " + rtosfix(t.origin.x) + ", " + rtosfix(t.origin.y) + ", " + rtosfix(t.origin.z); - p_store_string_func(p_store_string_ud, s + " )"); + p_store_string_func(p_store_string_ud, s + ")"); } break; // misc types case Variant::COLOR: { Color c = p_variant; - p_store_string_func(p_store_string_ud, "Color( " + rtosfix(c.r) + ", " + rtosfix(c.g) + ", " + rtosfix(c.b) + ", " + rtosfix(c.a) + " )"); + p_store_string_func(p_store_string_ud, "Color(" + rtosfix(c.r) + ", " + rtosfix(c.g) + ", " + rtosfix(c.b) + ", " + rtosfix(c.a) + ")"); } break; case Variant::STRING_NAME: { @@ -1553,7 +1553,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str if (res_text == String() && res->get_path().is_resource_file()) { //external resource String path = res->get_path(); - res_text = "Resource( \"" + path + "\")"; + res_text = "Resource(\"" + path + "\")"; } //could come up with some sort of text @@ -1616,7 +1616,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str } break; case Variant::ARRAY: { - p_store_string_func(p_store_string_ud, "[ "); + p_store_string_func(p_store_string_ud, "["); Array array = p_variant; int len = array.size(); for (int i = 0; i < len; i++) { @@ -1625,12 +1625,12 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str } write(array[i], p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud); } - p_store_string_func(p_store_string_ud, " ]"); + p_store_string_func(p_store_string_ud, "]"); } break; case Variant::PACKED_BYTE_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedByteArray( "); + p_store_string_func(p_store_string_ud, "PackedByteArray("); String s; Vector<uint8_t> data = p_variant; int len = data.size(); @@ -1644,11 +1644,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, itos(ptr[i])); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_INT32_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedInt32Array( "); + p_store_string_func(p_store_string_ud, "PackedInt32Array("); Vector<int32_t> data = p_variant; int32_t len = data.size(); const int32_t *ptr = data.ptr(); @@ -1661,11 +1661,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, itos(ptr[i])); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_INT64_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedInt64Array( "); + p_store_string_func(p_store_string_ud, "PackedInt64Array("); Vector<int64_t> data = p_variant; int64_t len = data.size(); const int64_t *ptr = data.ptr(); @@ -1678,11 +1678,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, itos(ptr[i])); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_FLOAT32_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedFloat32Array( "); + p_store_string_func(p_store_string_ud, "PackedFloat32Array("); Vector<float> data = p_variant; int len = data.size(); const float *ptr = data.ptr(); @@ -1694,11 +1694,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, rtosfix(ptr[i])); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_FLOAT64_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedFloat64Array( "); + p_store_string_func(p_store_string_ud, "PackedFloat64Array("); Vector<double> data = p_variant; int len = data.size(); const double *ptr = data.ptr(); @@ -1710,11 +1710,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, rtosfix(ptr[i])); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_STRING_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedStringArray( "); + p_store_string_func(p_store_string_ud, "PackedStringArray("); Vector<String> data = p_variant; int len = data.size(); const String *ptr = data.ptr(); @@ -1730,11 +1730,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, "\"" + str.c_escape() + "\""); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_VECTOR2_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedVector2Array( "); + p_store_string_func(p_store_string_ud, "PackedVector2Array("); Vector<Vector2> data = p_variant; int len = data.size(); const Vector2 *ptr = data.ptr(); @@ -1746,11 +1746,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, rtosfix(ptr[i].x) + ", " + rtosfix(ptr[i].y)); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_VECTOR3_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedVector3Array( "); + p_store_string_func(p_store_string_ud, "PackedVector3Array("); Vector<Vector3> data = p_variant; int len = data.size(); const Vector3 *ptr = data.ptr(); @@ -1762,12 +1762,11 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, rtosfix(ptr[i].x) + ", " + rtosfix(ptr[i].y) + ", " + rtosfix(ptr[i].z)); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; case Variant::PACKED_COLOR_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedColorArray( "); - + p_store_string_func(p_store_string_ud, "PackedColorArray("); Vector<Color> data = p_variant; int len = data.size(); const Color *ptr = data.ptr(); @@ -1779,7 +1778,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, rtosfix(ptr[i].r) + ", " + rtosfix(ptr[i].g) + ", " + rtosfix(ptr[i].b) + ", " + rtosfix(ptr[i].a)); } - p_store_string_func(p_store_string_ud, " )"); + p_store_string_func(p_store_string_ud, ")"); } break; default: { diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index af34a948f5..03607661df 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -257,13 +257,13 @@ </method> </methods> <members> - <member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> + <member name="end" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size. </member> - <member name="position" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> + <member name="position" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> Beginning corner. Typically has values lower than [member end]. </member> - <member name="size" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> + <member name="size" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> Size from [member position] to [member end]. Typically, all components are positive. If the size is negative, you can use [method abs] to fix it. </member> diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml index 9dde25028e..e179c97677 100644 --- a/doc/classes/AESContext.xml +++ b/doc/classes/AESContext.xml @@ -101,7 +101,7 @@ </argument> <argument index="1" name="key" type="PackedByteArray"> </argument> - <argument index="2" name="iv" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="2" name="iv" type="PackedByteArray" default="PackedByteArray()"> </argument> <description> Start the AES context in the given [code]mode[/code]. A [code]key[/code] of either 16 or 32 bytes must always be provided, while an [code]iv[/code] (initialization vector) of exactly 16 bytes, is only needed when [code]mode[/code] is either [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT]. diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index d18419f163..7662e8368b 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -57,7 +57,7 @@ <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 02203a3725..894e784397 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -213,9 +213,9 @@ </argument> <argument index="2" name="value" type="float"> </argument> - <argument index="3" name="in_handle" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="3" name="in_handle" type="Vector2" default="Vector2(0, 0)"> </argument> - <argument index="4" name="out_handle" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="4" name="out_handle" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Inserts a Bezier Track key at the given [code]time[/code] in seconds. The [code]track_idx[/code] must be the index of a Bezier Track. diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index abbc8cb2e6..1a6d2bd755 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -132,13 +132,13 @@ <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0"> Controls the interpolation between animations. See [enum BlendMode] constants. </member> - <member name="max_space" type="Vector2" setter="set_max_space" getter="get_max_space" default="Vector2( 1, 1 )"> + <member name="max_space" type="Vector2" setter="set_max_space" getter="get_max_space" default="Vector2(1, 1)"> The blend space's X and Y axes' upper limit for the points' position. See [method add_blend_point]. </member> - <member name="min_space" type="Vector2" setter="set_min_space" getter="get_min_space" default="Vector2( -1, -1 )"> + <member name="min_space" type="Vector2" setter="set_min_space" getter="get_min_space" default="Vector2(-1, -1)"> The blend space's X and Y axes' lower limit for the points' position. See [method add_blend_point]. </member> - <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2( 0.1, 0.1 )"> + <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2(0.1, 0.1)"> Position increment to snap to when moving a point. </member> <member name="x_label" type="String" setter="set_x_label" getter="get_x_label" default=""x""> diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 8f87ce453f..a90e8647bb 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -17,7 +17,7 @@ </argument> <argument index="1" name="node" type="AnimationNode"> </argument> - <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds an [AnimationNode] at the given [code]position[/code]. The [code]name[/code] is used to identify the created sub-node later. @@ -107,7 +107,7 @@ </method> </methods> <members> - <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2( 0, 0 )"> + <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2(0, 0)"> The global offset of all sub-nodes. </member> </members> diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index e08e288c59..8e070142c4 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -28,7 +28,7 @@ </argument> <argument index="1" name="node" type="AnimationNode"> </argument> - <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds a new node to the graph. The [code]position[/code] is used for display in the editor. diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 96333988f8..f52c810ad2 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -69,7 +69,7 @@ <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" default="false"> If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]. </member> - <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector2( 0, 1 )"> + <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector2(0, 1)"> The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1"> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index a2724f3f23..cc31b6c203 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -67,7 +67,7 @@ <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" default="false"> If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]. </member> - <member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector3( 0, -1, 0 )"> + <member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector3(0, -1, 0)"> The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1"> diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index f8cbc942e6..1bbf9bcd93 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -66,7 +66,7 @@ </argument> <argument index="1" name="arrays" type="Array"> </argument> - <argument index="2" name="blend_shapes" type="Array" default="[ ]"> + <argument index="2" name="blend_shapes" type="Array" default="[]"> </argument> <argument index="3" name="lods" type="Dictionary" default="{ }"> @@ -221,7 +221,7 @@ <member name="blend_shape_mode" type="int" setter="set_blend_shape_mode" getter="get_blend_shape_mode" enum="Mesh.BlendShapeMode" default="1"> Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]. </member> - <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )"> + <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. </member> <member name="shadow_mesh" type="ArrayMesh" setter="set_shadow_mesh" getter="get_shadow_mesh"> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 9865319419..b49c0e4278 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -18,10 +18,10 @@ <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip" default="false"> If [code]true[/code], clips the area outside of the region to avoid bleeding of the surrounding texture pixels. </member> - <member name="margin" type="Rect2" setter="set_margin" getter="get_margin" default="Rect2( 0, 0, 0, 0 )"> + <member name="margin" type="Rect2" setter="set_margin" getter="get_margin" default="Rect2(0, 0, 0, 0)"> The margin around the region. The [Rect2]'s [member Rect2.size] parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. </member> - <member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2( 0, 0, 0, 0 )"> + <member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2(0, 0, 0, 0)"> The AtlasTexture's used region. </member> </members> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index d07b1ac66d..5a0e71a0f8 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -22,7 +22,7 @@ </method> </methods> <members> - <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray( )"> + <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contains the audio data in bytes. [b]Note:[/b] This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. </member> diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml index 9a70b8f20c..55ee573811 100644 --- a/doc/classes/BackBufferCopy.xml +++ b/doc/classes/BackBufferCopy.xml @@ -15,7 +15,7 @@ <member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" enum="BackBufferCopy.CopyMode" default="1"> Buffer mode. See [enum CopyMode] constants. </member> - <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2( -100, -100, 200, 200 )"> + <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2(-100, -100, 200, 200)"> The area covered by the BackBufferCopy. Only used if [member copy_mode] is [constant COPY_MODE_RECT]. </member> </members> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 49edb4c691..abe06bc7e1 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -72,7 +72,7 @@ </method> </methods> <members> - <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color( 1, 1, 1, 1 )"> + <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color(1, 1, 1, 1)"> The material's base color. </member> <member name="albedo_tex_force_srgb" type="bool" setter="set_flag" getter="get_flag" default="false"> @@ -117,7 +117,7 @@ <member name="ao_texture_channel" type="int" setter="set_ao_texture_channel" getter="get_ao_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0"> Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. </member> - <member name="backlight" type="Color" setter="set_backlight" getter="get_backlight" default="Color( 0, 0, 0, 1 )"> + <member name="backlight" type="Color" setter="set_backlight" getter="get_backlight" default="Color(0, 0, 0, 1)"> The color used by the backlight effect. Represents the light passing through an object. </member> <member name="backlight_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -195,7 +195,7 @@ <member name="distance_fade_mode" type="int" setter="set_distance_fade" getter="get_distance_fade" enum="BaseMaterial3D.DistanceFadeMode" default="0"> Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s. </member> - <member name="emission" type="Color" setter="set_emission" getter="get_emission" default="Color( 0, 0, 0, 1 )"> + <member name="emission" type="Color" setter="set_emission" getter="get_emission" default="Color(0, 0, 0, 1)"> The emitted light's color. See [member emission_enabled]. </member> <member name="emission_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -345,7 +345,7 @@ </member> <member name="subsurf_scatter_transmittance_boost" type="float" setter="set_transmittance_boost" getter="get_transmittance_boost" default="0.0"> </member> - <member name="subsurf_scatter_transmittance_color" type="Color" setter="set_transmittance_color" getter="get_transmittance_color" default="Color( 1, 1, 1, 1 )"> + <member name="subsurf_scatter_transmittance_color" type="Color" setter="set_transmittance_color" getter="get_transmittance_color" default="Color(1, 1, 1, 1)"> </member> <member name="subsurf_scatter_transmittance_curve" type="float" setter="set_transmittance_curve" getter="get_transmittance_curve" default="1.0"> </member> @@ -370,10 +370,10 @@ If [code]true[/code], render point size can be changed. [b]Note:[/b] this is only effective for objects whose geometry is point-based rather than triangle-based. See also [member point_size]. </member> - <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" default="Vector3( 0, 0, 0 )"> + <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" default="Vector3(0, 0, 0)"> How much to offset the [code]UV[/code] coordinates. This amount will be added to [code]UV[/code] in the vertex function. This can be used to offset a texture. </member> - <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" default="Vector3( 1, 1, 1 )"> + <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" default="Vector3(1, 1, 1)"> How much to scale the [code]UV[/code] coordinates. This is multiplied by [code]UV[/code] in the vertex function. </member> <member name="uv1_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> @@ -385,10 +385,10 @@ <member name="uv1_world_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], triplanar mapping for [code]UV[/code] is calculated in world space rather than object local space. See also [member uv1_triplanar]. </member> - <member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" default="Vector3( 0, 0, 0 )"> + <member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" default="Vector3(0, 0, 0)"> How much to offset the [code]UV2[/code] coordinates. This amount will be added to [code]UV2[/code] in the vertex function. This can be used to offset a texture. </member> - <member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" default="Vector3( 1, 1, 1 )"> + <member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" default="Vector3(1, 1, 1)"> How much to scale the [code]UV2[/code] coordinates. This is multiplied by [code]UV2[/code] in the vertex function. </member> <member name="uv2_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 14fca04672..bd1abe914d 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -155,6 +155,24 @@ <description> </description> </method> + <method name="operator *" qualifiers="operator"> + <return type="Basis"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + This operator multiplies all components of the [Basis], which scales it uniformly. + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Basis"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + This operator multiplies all components of the [Basis], which scales it uniformly. + </description> + </method> <method name="operator ==" qualifiers="operator"> <return type="bool"> </return> @@ -245,28 +263,28 @@ </method> </methods> <members> - <member name="x" type="Vector3" setter="" getter="" default="Vector3( 1, 0, 0 )"> + <member name="x" type="Vector3" setter="" getter="" default="Vector3(1, 0, 0)"> The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code]. </member> - <member name="y" type="Vector3" setter="" getter="" default="Vector3( 0, 1, 0 )"> + <member name="y" type="Vector3" setter="" getter="" default="Vector3(0, 1, 0)"> The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code]. </member> - <member name="z" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 1 )"> + <member name="z" type="Vector3" setter="" getter="" default="Vector3(0, 0, 1)"> The basis matrix's Z vector (column 2). Equivalent to array index [code]2[/code]. </member> </members> <constants> - <constant name="IDENTITY" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )"> + <constant name="IDENTITY" value="Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)"> The identity basis, with no rotation or scaling applied. This is identical to calling [code]Basis()[/code] without any parameters. This constant can be used to make your code clearer, and for consistency with C#. </constant> - <constant name="FLIP_X" value="Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )"> + <constant name="FLIP_X" value="Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1)"> The basis that will flip something along the X axis when used in a transformation. </constant> - <constant name="FLIP_Y" value="Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )"> + <constant name="FLIP_Y" value="Basis(1, 0, 0, 0, -1, 0, 0, 0, 1)"> The basis that will flip something along the Y axis when used in a transformation. </constant> - <constant name="FLIP_Z" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )"> + <constant name="FLIP_Z" value="Basis(1, 0, 0, 0, 1, 0, 0, 0, -1)"> The basis that will flip something along the Z axis when used in a transformation. </constant> </constants> diff --git a/doc/classes/Bone2D.xml b/doc/classes/Bone2D.xml index 93744ddad7..b8d5544d59 100644 --- a/doc/classes/Bone2D.xml +++ b/doc/classes/Bone2D.xml @@ -101,7 +101,7 @@ </method> </methods> <members> - <member name="rest" type="Transform2D" setter="set_rest" getter="get_rest" default="Transform2D( 0, 0, 0, 0, 0, 0 )"> + <member name="rest" type="Transform2D" setter="set_rest" getter="get_rest" default="Transform2D(0, 0, 0, 0, 0, 0)"> Rest transform of the bone. You can reset the node's transforms to this value using [method apply_rest]. </member> </members> diff --git a/doc/classes/BoxMesh.xml b/doc/classes/BoxMesh.xml index 1404477b46..dda5e2f1e5 100644 --- a/doc/classes/BoxMesh.xml +++ b/doc/classes/BoxMesh.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3( 2, 2, 2 )"> + <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(2, 2, 2)"> The box's width, height and depth. </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0"> diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml index f5051413ce..5704de905b 100644 --- a/doc/classes/BoxShape3D.xml +++ b/doc/classes/BoxShape3D.xml @@ -14,7 +14,7 @@ <methods> </methods> <members> - <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3( 2, 2, 2 )"> + <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(2, 2, 2)"> The box's width, height and depth. </member> </members> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 51c35b15ce..c9078a4de5 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -116,22 +116,22 @@ <theme_item name="font" type="Font"> [Font] of the [Button]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [Button]. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Text [Color] used when the [Button] is disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] used when the [Button] is being hovered. </theme_item> - <theme_item name="font_hover_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_hover_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [Button] is being hovered and pressed. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [Button]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [Button] is being pressed. </theme_item> <theme_item name="font_size" type="int"> @@ -143,19 +143,19 @@ <theme_item name="hseparation" type="int" default="2"> The horizontal space between [Button]'s icon and text. </theme_item> - <theme_item name="icon_disabled_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="icon_disabled_color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is disabled. </theme_item> - <theme_item name="icon_hover_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="icon_hover_color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being hovered. </theme_item> - <theme_item name="icon_hover_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="icon_hover_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being hovered and pressed. </theme_item> - <theme_item name="icon_normal_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="icon_normal_color" type="Color" default="Color(1, 1, 1, 1)"> Default icon modulate [Color] of the [Button]. </theme_item> - <theme_item name="icon_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="icon_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being pressed. </theme_item> <theme_item name="normal" type="StyleBox"> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 9e70978db8..9620e9abd1 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -148,7 +148,7 @@ <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Animation speed randomness ratio. </member> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. </member> <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> @@ -163,7 +163,7 @@ <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Damping randomness ratio. </member> - <member name="direction" type="Vector2" setter="set_direction" getter="get_direction" default="Vector2( 1, 0 )"> + <member name="direction" type="Vector2" setter="set_direction" getter="get_direction" default="Vector2(1, 0)"> Unit vector specifying the particles' emission direction. </member> <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="CPUParticles2D.DrawOrder" default="0"> @@ -199,7 +199,7 @@ <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. </member> - <member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2( 0, 980 )"> + <member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2(0, 980)"> Gravity applied to every particle. </member> <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index 0512efa8c2..7509775d20 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -147,7 +147,7 @@ <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Animation speed randomness ratio. </member> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Unused for 3D particles. </member> <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> @@ -162,7 +162,7 @@ <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Damping randomness ratio. </member> - <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3( 1, 0, 0 )"> + <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3(1, 0, 0)"> Unit vector specifying the particles' emission direction. </member> <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="CPUParticles3D.DrawOrder" default="0"> @@ -171,13 +171,13 @@ <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents"> The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. </member> - <member name="emission_colors" type="PackedColorArray" setter="set_emission_colors" getter="get_emission_colors" default="PackedColorArray( )"> + <member name="emission_colors" type="PackedColorArray" setter="set_emission_colors" getter="get_emission_colors" default="PackedColorArray()"> Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. </member> <member name="emission_normals" type="PackedVector3Array" setter="set_emission_normals" getter="get_emission_normals"> Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]. </member> - <member name="emission_points" type="PackedVector3Array" setter="set_emission_points" getter="get_emission_points" default="PackedVector3Array( )"> + <member name="emission_points" type="PackedVector3Array" setter="set_emission_points" getter="get_emission_points" default="PackedVector3Array()"> Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. </member> <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="CPUParticles3D.EmissionShape" default="0"> @@ -201,7 +201,7 @@ <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. </member> - <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3( 0, -9.8, 0 )"> + <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -9.8, 0)"> Gravity applied to every particle. </member> <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index d40567bdcb..bf1a9cc929 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -165,7 +165,7 @@ <member name="limit_top" type="int" setter="set_limit" getter="get_limit" default="-10000000"> Top scroll limit in pixels. The camera stops moving when reaching this value. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The camera's offset, useful for looking around or camera shake animations. </member> <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1"> @@ -180,7 +180,7 @@ <member name="smoothing_speed" type="float" setter="set_follow_smoothing" getter="get_follow_smoothing" default="5.0"> Speed in pixels per second of the camera's smoothing effect when [member smoothing_enabled] is [code]true[/code]. </member> - <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" default="Vector2( 1, 1 )"> + <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" default="Vector2(1, 1)"> The camera's zoom relative to the viewport. Values larger than [code]Vector2(1, 1)[/code] zoom out and smaller values zoom in. For an example, use [code]Vector2(0.5, 0.5)[/code] for a 2× zoom-in, and [code]Vector2(4, 4)[/code] for a 4× zoom-out. </member> </members> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 016eb05308..afba478a20 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -209,7 +209,7 @@ - ~107.51 degrees in a 16:9 viewport - ~121.63 degrees in a 21:9 viewport </member> - <member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2( 0, 0 )"> + <member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2(0, 0)"> The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. </member> <member name="h_offset" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 87b157db4e..d0950ae741 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -24,6 +24,21 @@ Overridable function called by the engine (if defined) to draw the canvas item. </description> </method> + <method name="draw_animation_slice"> + <return type="void"> + </return> + <argument index="0" name="animation_length" type="float"> + </argument> + <argument index="1" name="slice_begin" type="float"> + </argument> + <argument index="2" name="slice_end" type="float"> + </argument> + <argument index="3" name="offset" type="float" default="0.0"> + </argument> + <description> + Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. + </description> + </method> <method name="draw_arc"> <return type="void"> </return> @@ -60,11 +75,11 @@ </argument> <argument index="4" name="size" type="int" default="-1"> </argument> - <argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="6" name="outline_size" type="int" default="0"> </argument> - <argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <description> Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. @@ -90,7 +105,7 @@ </argument> <argument index="1" name="color" type="Color"> </argument> - <argument index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array( )"> + <argument index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array()"> </argument> <argument index="3" name="texture" type="Texture2D" default="null"> </argument> @@ -98,6 +113,13 @@ Draws a colored polygon of any amount of points, convex or concave. </description> </method> + <method name="draw_end_animation"> + <return type="void"> + </return> + <description> + After submitting all animations slices via [method draw_animation_slice], this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. + </description> + </method> <method name="draw_line"> <return type="void"> </return> @@ -120,9 +142,9 @@ </argument> <argument index="1" name="texture" type="Texture2D"> </argument> - <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. @@ -171,11 +193,11 @@ </argument> <argument index="6" name="size" type="int" default="-1"> </argument> - <argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="8" name="outline_size" type="int" default="0"> </argument> - <argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <argument index="10" name="flags" type="int" default="51"> </argument> @@ -201,7 +223,7 @@ </argument> <argument index="1" name="colors" type="PackedColorArray"> </argument> - <argument index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array( )"> + <argument index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array()"> </argument> <argument index="3" name="texture" type="Texture2D" default="null"> </argument> @@ -279,7 +301,7 @@ </argument> <argument index="1" name="rotation" type="float" default="0.0"> </argument> - <argument index="2" name="scale" type="Vector2" default="Vector2( 1, 1 )"> + <argument index="2" name="scale" type="Vector2" default="Vector2(1, 1)"> </argument> <description> Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. @@ -309,11 +331,11 @@ </argument> <argument index="5" name="size" type="int" default="-1"> </argument> - <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="7" name="outline_size" type="int" default="0"> </argument> - <argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <argument index="9" name="flags" type="int" default="3"> </argument> @@ -359,7 +381,7 @@ </argument> <argument index="1" name="position" type="Vector2"> </argument> - <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws a texture at a given position. @@ -374,7 +396,7 @@ </argument> <argument index="2" name="tile" type="bool"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> @@ -391,7 +413,7 @@ </argument> <argument index="2" name="src_rect" type="Rect2"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> @@ -573,10 +595,10 @@ <member name="material" type="Material" setter="set_material" getter="get_material"> The material applied to textures on this [CanvasItem]. </member> - <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> The color applied to textures on this [CanvasItem]. </member> - <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color(1, 1, 1, 1)"> The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s. </member> <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false"> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index 9d952cdba3..f4c04d7bca 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -33,7 +33,7 @@ <member name="layer" type="int" setter="set_layer" getter="get_layer" default="1"> Layer index for draw order. Lower values are drawn first. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The layer's base offset. </member> <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> @@ -42,10 +42,10 @@ <member name="rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees" default="0.0"> The layer's rotation in degrees. </member> - <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )"> + <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The layer's scale. </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> The layer's transform. </member> </members> diff --git a/doc/classes/CanvasModulate.xml b/doc/classes/CanvasModulate.xml index 19f8912cd8..3540fa423f 100644 --- a/doc/classes/CanvasModulate.xml +++ b/doc/classes/CanvasModulate.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The tint color to apply. </member> </members> diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml index 0ca132746b..f7147d9f0b 100644 --- a/doc/classes/CanvasTexture.xml +++ b/doc/classes/CanvasTexture.xml @@ -13,7 +13,7 @@ </member> <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture"> </member> - <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )"> + <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color(1, 1, 1, 1)"> </member> <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0"> </member> diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index 7a6a18f532..1f63b530b1 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(0, 0, 0, 1)"> The color the character will be drawn with. </member> <member name="elapsed_time" type="float" setter="set_elapsed_time" getter="get_elapsed_time" default="0.0"> @@ -33,13 +33,13 @@ <member name="glyph_index" type="int" setter="set_glyph_index" getter="get_glyph_index" default="0"> Font specific glyph index. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The position offset the character will be drawn with (in pixels). </member> <member name="outline" type="bool" setter="set_outline" getter="is_outline" default="false"> If [code]true[/code], FX transform is called for outline drawing. Setting this property won't affect drawing. </member> - <member name="range" type="Vector2i" setter="set_range" getter="get_range" default="Vector2i( 0, 0 )"> + <member name="range" type="Vector2i" setter="set_range" getter="get_range" default="Vector2i(0, 0)"> Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. </member> <member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true"> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 0e6ca073a7..fbe5c34d7d 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -107,7 +107,7 @@ <member name="infinite_inertia" type="bool" setter="set_infinite_inertia_enabled" getter="is_infinite_inertia_enabled" default="true"> If [code]true[/code], the body will be able to push [RigidBody2D] nodes when calling [method move_and_slide], but it also won't detect any collisions with them. If [code]false[/code], it will interact with [RigidBody2D] nodes like with [StaticBody2D]. </member> - <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2( 0, 0 )"> + <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> @@ -116,14 +116,14 @@ <member name="motion/sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="false"> If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method move_and_slide] or [method PhysicsBody2D.move_and_collide] functions. </member> - <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2( 0, 0 )"> + <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2(0, 0)"> When set to a value different from [code]Vector2(0, 0)[/code], the body is kept attached to slopes when calling [method move_and_slide]. As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting [code]snap[/code] to [code]Vector2(0, 0)[/code]. </member> <member name="stop_on_slope" type="bool" setter="set_stop_on_slope_enabled" getter="is_stop_on_slope_enabled" default="false"> If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. </member> - <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2( 0, -1 )"> + <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. If set to [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. </member> </members> diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 790edfcad1..f6c3d68b3c 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -93,20 +93,20 @@ <member name="infinite_inertia" type="bool" setter="set_infinite_inertia_enabled" getter="is_infinite_inertia_enabled" default="true"> If [code]true[/code], the body will be able to push [RigidBody3D] nodes when calling [method move_and_slide], but it also won't detect any collisions with them. If [code]false[/code], it will interact with [RigidBody3D] nodes like with [StaticBody3D]. </member> - <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3( 0, 0, 0 )"> + <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> - <member name="snap" type="Vector3" setter="set_snap" getter="get_snap" default="Vector3( 0, 0, 0 )"> + <member name="snap" type="Vector3" setter="set_snap" getter="get_snap" default="Vector3(0, 0, 0)"> When set to a value different from [code]Vector3(0, 0, 0)[/code], the body is kept attached to slopes when calling [method move_and_slide]. As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting [code]snap[/code] to [code]Vector3(0, 0, 0)[/code]. </member> <member name="stop_on_slope" type="bool" setter="set_stop_on_slope_enabled" getter="is_stop_on_slope_enabled" default="false"> If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. </member> - <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3( 0, 1, 0 )"> + <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. If set to [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. </member> </members> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 05e412e9da..90f3725172 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -35,22 +35,22 @@ <theme_item name="font" type="Font"> The [Font] to use for the [CheckBox] text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> The [CheckBox] text's font color. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> The [CheckBox] text's font color when it's disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> The [CheckBox] text's font color when it's hovered. </theme_item> - <theme_item name="font_hover_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_hover_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckBox] text's font color when it's hovered and pressed. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [CheckBox]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckBox] text's font color when it's pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index 46e590a115..7fa7093b32 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -30,22 +30,22 @@ <theme_item name="font" type="Font"> The [Font] to use for the [CheckButton] text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> The [CheckButton] text's font color. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> The [CheckButton] text's font color when it's disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> The [CheckButton] text's font color when it's hovered. </theme_item> - <theme_item name="font_hover_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_hover_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckButton] text's font color when it's hovered and pressed. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [CheckButton]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckButton] text's font color when it's pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 15a2e76acc..c7dbd86c55 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -45,7 +45,7 @@ </argument> <argument index="2" name="insert_text" type="String"> </argument> - <argument index="3" name="text_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="text_color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="icon" type="Resource" default="null"> </argument> @@ -86,6 +86,15 @@ Line only denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to [code]true[/code]. </description> </method> + <method name="can_fold_line" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block. + </description> + </method> <method name="cancel_code_completion"> <return type="void"> </return> @@ -134,6 +143,22 @@ Inserts the selected entry into the text. If [code]replace[/code] is true, any existing text is replaced rather then merged. </description> </method> + <method name="fold_all_lines"> + <return type="void"> + </return> + <description> + Folds all lines that are possible to be folded (see [method can_fold_line]). + </description> + </method> + <method name="fold_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Folds the given line, if possible (see [method can_fold_line]). + </description> + </method> <method name="get_bookmarked_lines" qualifiers="const"> <return type="Array"> </return> @@ -221,6 +246,13 @@ <description> </description> </method> + <method name="get_folded_lines" qualifiers="const"> + <return type="int[]"> + </return> + <description> + Return all lines that are current folded. + </description> + </method> <method name="get_text_for_code_completion" qualifiers="const"> <return type="String"> </return> @@ -292,6 +324,15 @@ <description> </description> </method> + <method name="is_line_folded" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Returns whether the line at the specified index is folded or not. + </description> + </method> <method name="remove_comment_delimiter"> <return type="void"> </return> @@ -376,6 +417,30 @@ <description> </description> </method> + <method name="toggle_foldable_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Toggle the folding of the code block at the given line. + </description> + </method> + <method name="unfold_all_lines"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="unfold_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Unfolds all lines that were previously folded. + </description> + </method> <method name="update_code_completion_options"> <return type="void"> </return> @@ -391,13 +456,13 @@ <member name="code_completion_enabled" type="bool" setter="set_code_completion_enabled" getter="is_code_completion_enabled" default="false"> Sets whether code completion is allowed. </member> - <member name="code_completion_prefixes" type="String[]" setter="set_code_completion_prefixes" getter="get_code_comletion_prefixes" default="[ ]"> + <member name="code_completion_prefixes" type="String[]" setter="set_code_completion_prefixes" getter="get_code_comletion_prefixes" default="[]"> Sets prefixes that will trigger code completion. </member> - <member name="delimiter_comments" type="String[]" setter="set_comment_delimiters" getter="get_comment_delimiters" default="[ ]"> + <member name="delimiter_comments" type="String[]" setter="set_comment_delimiters" getter="get_comment_delimiters" default="[]"> Sets the comment delimiters. All existing comment delimiters will be removed. </member> - <member name="delimiter_strings" type="String[]" setter="set_string_delimiters" getter="get_string_delimiters" default="[ ]"> + <member name="delimiter_strings" type="String[]" setter="set_string_delimiters" getter="get_string_delimiters" default="[]"> Sets the string delimiters. All existing string delimiters will be removed. </member> <member name="draw_bookmarks" type="bool" setter="set_draw_bookmarks_gutter" getter="is_drawing_bookmarks_gutter" default="false"> @@ -411,7 +476,10 @@ <member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false"> </member> <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" override="true" enum="Control.LayoutDirection" default="2" /> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[ ]" /> + <member name="line_folding" type="bool" setter="set_line_folding_enabled" getter="is_line_folding_enabled" default="true"> + Sets whether line folding is allowed. + </member> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[]" /> <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" override="true" enum="Control.TextDirection" default="1" /> <member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false"> </member> @@ -452,69 +520,71 @@ </constant> </constants> <theme_items> - <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="background_color" type="Color" default="Color(0, 0, 0, 0)"> </theme_item> <theme_item name="bookmark" type="Texture2D"> </theme_item> - <theme_item name="bookmark_color" type="Color" default="Color( 0.5, 0.64, 1, 0.8 )"> + <theme_item name="bookmark_color" type="Color" default="Color(0.5, 0.64, 1, 0.8)"> </theme_item> - <theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )"> + <theme_item name="brace_mismatch_color" type="Color" default="Color(1, 0.2, 0.2, 1)"> </theme_item> <theme_item name="breakpoint" type="Texture2D"> </theme_item> - <theme_item name="breakpoint_color" type="Color" default="Color( 0.9, 0.29, 0.3, 1 )"> + <theme_item name="breakpoint_color" type="Color" default="Color(0.9, 0.29, 0.3, 1)"> </theme_item> <theme_item name="can_fold" type="Texture2D"> </theme_item> - <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="caret_background_color" type="Color" default="Color(0, 0, 0, 1)"> </theme_item> - <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="caret_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> </theme_item> - <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )"> + <theme_item name="code_folding_color" type="Color" default="Color(0.8, 0.8, 0.8, 0.8)"> </theme_item> <theme_item name="completion" type="StyleBox"> </theme_item> - <theme_item name="completion_background_color" type="Color" default="Color( 0.17, 0.16, 0.2, 1 )"> + <theme_item name="completion_background_color" type="Color" default="Color(0.17, 0.16, 0.2, 1)"> </theme_item> - <theme_item name="completion_existing_color" type="Color" default="Color( 0.87, 0.87, 0.87, 0.13 )"> + <theme_item name="completion_existing_color" type="Color" default="Color(0.87, 0.87, 0.87, 0.13)"> </theme_item> - <theme_item name="completion_font_color" type="Color" default="Color( 0.67, 0.67, 0.67, 1 )"> + <theme_item name="completion_font_color" type="Color" default="Color(0.67, 0.67, 0.67, 1)"> </theme_item> <theme_item name="completion_lines" type="int" default="7"> </theme_item> <theme_item name="completion_max_width" type="int" default="50"> </theme_item> - <theme_item name="completion_scroll_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="completion_scroll_color" type="Color" default="Color(1, 1, 1, 1)"> </theme_item> <theme_item name="completion_scroll_width" type="int" default="3"> </theme_item> - <theme_item name="completion_selected_color" type="Color" default="Color( 0.26, 0.26, 0.27, 1 )"> + <theme_item name="completion_selected_color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> </theme_item> - <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> + <theme_item name="current_line_color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)"> </theme_item> <theme_item name="executing_line" type="Texture2D"> </theme_item> - <theme_item name="executing_line_color" type="Color" default="Color( 0.98, 0.89, 0.27, 1 )"> + <theme_item name="executing_line_color" type="Color" default="Color(0.98, 0.89, 0.27, 1)"> </theme_item> <theme_item name="focus" type="StyleBox"> </theme_item> <theme_item name="folded" type="Texture2D"> </theme_item> + <theme_item name="folded_eol_icon" type="Texture2D"> + </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [CodeEdit]. </theme_item> - <theme_item name="font_readonly_color" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> + <theme_item name="font_readonly_color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)"> </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0, 0, 0, 1)"> </theme_item> <theme_item name="font_size" type="int"> Font size of the [CodeEdit]'s text. </theme_item> - <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )"> + <theme_item name="line_number_color" type="Color" default="Color(0.67, 0.67, 0.67, 0.4)"> </theme_item> <theme_item name="line_spacing" type="int" default="4"> </theme_item> @@ -525,15 +595,15 @@ </theme_item> <theme_item name="read_only" type="StyleBox"> </theme_item> - <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )"> + <theme_item name="safe_line_number_color" type="Color" default="Color(0.67, 0.78, 0.67, 0.6)"> </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> + <theme_item name="selection_color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> </theme_item> <theme_item name="space" type="Texture2D"> </theme_item> <theme_item name="tab" type="Texture2D"> </theme_item> - <theme_item name="word_highlighted_color" type="Color" default="Color( 0.8, 0.9, 0.9, 0.15 )"> + <theme_item name="word_highlighted_color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> </theme_item> </theme_items> </class> diff --git a/doc/classes/CodeHighlighter.xml b/doc/classes/CodeHighlighter.xml index f078e4e5b0..0406c25ffd 100644 --- a/doc/classes/CodeHighlighter.xml +++ b/doc/classes/CodeHighlighter.xml @@ -149,7 +149,7 @@ <member name="color_regions" type="Dictionary" setter="set_color_regions" getter="get_color_regions" default="{}"> Sets the color regions. All existing regions will be removed. The [Dictionary] key is the region start and end key, separated by a space. The value is the region color. </member> - <member name="function_color" type="Color" setter="set_function_color" getter="get_function_color" default="Color( 0, 0, 0, 1 )"> + <member name="function_color" type="Color" setter="set_function_color" getter="get_function_color" default="Color(0, 0, 0, 1)"> Sets color for functions. A function is a non-keyword string followed by a '('. </member> <member name="keyword_colors" type="Dictionary" setter="set_keyword_colors" getter="get_keyword_colors" default="{}"> @@ -158,13 +158,13 @@ <member name="member_keyword_colors" type="Dictionary" setter="set_member_keyword_colors" getter="get_member_keyword_colors" default="{}"> Sets the member keyword colors. All existing member keyword will be removed. The [Dictionary] key is the member keyword. The value is the member keyword color. </member> - <member name="member_variable_color" type="Color" setter="set_member_variable_color" getter="get_member_variable_color" default="Color( 0, 0, 0, 1 )"> + <member name="member_variable_color" type="Color" setter="set_member_variable_color" getter="get_member_variable_color" default="Color(0, 0, 0, 1)"> Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'. </member> - <member name="number_color" type="Color" setter="set_number_color" getter="get_number_color" default="Color( 0, 0, 0, 1 )"> + <member name="number_color" type="Color" setter="set_number_color" getter="get_number_color" default="Color(0, 0, 0, 1)"> Sets the color for numbers. </member> - <member name="symbol_color" type="Color" setter="set_symbol_color" getter="get_symbol_color" default="Color( 0, 0, 0, 1 )"> + <member name="symbol_color" type="Color" setter="set_symbol_color" getter="get_symbol_color" default="Color(0, 0, 0, 1)"> Sets the color for symbols. </member> </members> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 242cdb8c80..4607ab3fbd 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -23,7 +23,7 @@ <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. </member> - <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( )"> + <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PackedVector2Array], not a reference. </member> </members> diff --git a/doc/classes/CollisionPolygon3D.xml b/doc/classes/CollisionPolygon3D.xml index 38f4c5fe5c..cf0e55e712 100644 --- a/doc/classes/CollisionPolygon3D.xml +++ b/doc/classes/CollisionPolygon3D.xml @@ -20,7 +20,7 @@ <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04"> The collision margin for the generated [Shape3D]. See [member Shape3D.margin] for more details. </member> - <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( )"> + <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> Array of vertices which define the polygon. [b]Note:[/b] The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the [code]polygon[/code] member. </member> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index ddff92e6fc..29c21b3213 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -139,9 +139,9 @@ <method name="clamp" qualifiers="const"> <return type="Color"> </return> - <argument index="0" name="min" type="Color" default="Color( 0, 0, 0, 0 )"> + <argument index="0" name="min" type="Color" default="Color(0, 0, 0, 0)"> </argument> - <argument index="1" name="max" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="1" name="max" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Returns a new color with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component. @@ -575,442 +575,442 @@ </member> </members> <constants> - <constant name="ALICE_BLUE" value="Color( 0.94, 0.97, 1, 1 )"> + <constant name="ALICE_BLUE" value="Color(0.94, 0.97, 1, 1)"> Alice blue color. </constant> - <constant name="ANTIQUE_WHITE" value="Color( 0.98, 0.92, 0.84, 1 )"> + <constant name="ANTIQUE_WHITE" value="Color(0.98, 0.92, 0.84, 1)"> Antique white color. </constant> - <constant name="AQUA" value="Color( 0, 1, 1, 1 )"> + <constant name="AQUA" value="Color(0, 1, 1, 1)"> Aqua color. </constant> - <constant name="AQUAMARINE" value="Color( 0.5, 1, 0.83, 1 )"> + <constant name="AQUAMARINE" value="Color(0.5, 1, 0.83, 1)"> Aquamarine color. </constant> - <constant name="AZURE" value="Color( 0.94, 1, 1, 1 )"> + <constant name="AZURE" value="Color(0.94, 1, 1, 1)"> Azure color. </constant> - <constant name="BEIGE" value="Color( 0.96, 0.96, 0.86, 1 )"> + <constant name="BEIGE" value="Color(0.96, 0.96, 0.86, 1)"> Beige color. </constant> - <constant name="BISQUE" value="Color( 1, 0.89, 0.77, 1 )"> + <constant name="BISQUE" value="Color(1, 0.89, 0.77, 1)"> Bisque color. </constant> - <constant name="BLACK" value="Color( 0, 0, 0, 1 )"> + <constant name="BLACK" value="Color(0, 0, 0, 1)"> Black color. </constant> - <constant name="BLANCHED_ALMOND" value="Color( 1, 0.92, 0.8, 1 )"> + <constant name="BLANCHED_ALMOND" value="Color(1, 0.92, 0.8, 1)"> Blanched almond color. </constant> - <constant name="BLUE" value="Color( 0, 0, 1, 1 )"> + <constant name="BLUE" value="Color(0, 0, 1, 1)"> Blue color. </constant> - <constant name="BLUE_VIOLET" value="Color( 0.54, 0.17, 0.89, 1 )"> + <constant name="BLUE_VIOLET" value="Color(0.54, 0.17, 0.89, 1)"> Blue violet color. </constant> - <constant name="BROWN" value="Color( 0.65, 0.16, 0.16, 1 )"> + <constant name="BROWN" value="Color(0.65, 0.16, 0.16, 1)"> Brown color. </constant> - <constant name="BURLYWOOD" value="Color( 0.87, 0.72, 0.53, 1 )"> + <constant name="BURLYWOOD" value="Color(0.87, 0.72, 0.53, 1)"> Burlywood color. </constant> - <constant name="CADET_BLUE" value="Color( 0.37, 0.62, 0.63, 1 )"> + <constant name="CADET_BLUE" value="Color(0.37, 0.62, 0.63, 1)"> Cadet blue color. </constant> - <constant name="CHARTREUSE" value="Color( 0.5, 1, 0, 1 )"> + <constant name="CHARTREUSE" value="Color(0.5, 1, 0, 1)"> Chartreuse color. </constant> - <constant name="CHOCOLATE" value="Color( 0.82, 0.41, 0.12, 1 )"> + <constant name="CHOCOLATE" value="Color(0.82, 0.41, 0.12, 1)"> Chocolate color. </constant> - <constant name="CORAL" value="Color( 1, 0.5, 0.31, 1 )"> + <constant name="CORAL" value="Color(1, 0.5, 0.31, 1)"> Coral color. </constant> - <constant name="CORNFLOWER_BLUE" value="Color( 0.39, 0.58, 0.93, 1 )"> + <constant name="CORNFLOWER_BLUE" value="Color(0.39, 0.58, 0.93, 1)"> Cornflower blue color. </constant> - <constant name="CORNSILK" value="Color( 1, 0.97, 0.86, 1 )"> + <constant name="CORNSILK" value="Color(1, 0.97, 0.86, 1)"> Cornsilk color. </constant> - <constant name="CRIMSON" value="Color( 0.86, 0.08, 0.24, 1 )"> + <constant name="CRIMSON" value="Color(0.86, 0.08, 0.24, 1)"> Crimson color. </constant> - <constant name="CYAN" value="Color( 0, 1, 1, 1 )"> + <constant name="CYAN" value="Color(0, 1, 1, 1)"> Cyan color. </constant> - <constant name="DARK_BLUE" value="Color( 0, 0, 0.55, 1 )"> + <constant name="DARK_BLUE" value="Color(0, 0, 0.55, 1)"> Dark blue color. </constant> - <constant name="DARK_CYAN" value="Color( 0, 0.55, 0.55, 1 )"> + <constant name="DARK_CYAN" value="Color(0, 0.55, 0.55, 1)"> Dark cyan color. </constant> - <constant name="DARK_GOLDENROD" value="Color( 0.72, 0.53, 0.04, 1 )"> + <constant name="DARK_GOLDENROD" value="Color(0.72, 0.53, 0.04, 1)"> Dark goldenrod color. </constant> - <constant name="DARK_GRAY" value="Color( 0.66, 0.66, 0.66, 1 )"> + <constant name="DARK_GRAY" value="Color(0.66, 0.66, 0.66, 1)"> Dark gray color. </constant> - <constant name="DARK_GREEN" value="Color( 0, 0.39, 0, 1 )"> + <constant name="DARK_GREEN" value="Color(0, 0.39, 0, 1)"> Dark green color. </constant> - <constant name="DARK_KHAKI" value="Color( 0.74, 0.72, 0.42, 1 )"> + <constant name="DARK_KHAKI" value="Color(0.74, 0.72, 0.42, 1)"> Dark khaki color. </constant> - <constant name="DARK_MAGENTA" value="Color( 0.55, 0, 0.55, 1 )"> + <constant name="DARK_MAGENTA" value="Color(0.55, 0, 0.55, 1)"> Dark magenta color. </constant> - <constant name="DARK_OLIVE_GREEN" value="Color( 0.33, 0.42, 0.18, 1 )"> + <constant name="DARK_OLIVE_GREEN" value="Color(0.33, 0.42, 0.18, 1)"> Dark olive green color. </constant> - <constant name="DARK_ORANGE" value="Color( 1, 0.55, 0, 1 )"> + <constant name="DARK_ORANGE" value="Color(1, 0.55, 0, 1)"> Dark orange color. </constant> - <constant name="DARK_ORCHID" value="Color( 0.6, 0.2, 0.8, 1 )"> + <constant name="DARK_ORCHID" value="Color(0.6, 0.2, 0.8, 1)"> Dark orchid color. </constant> - <constant name="DARK_RED" value="Color( 0.55, 0, 0, 1 )"> + <constant name="DARK_RED" value="Color(0.55, 0, 0, 1)"> Dark red color. </constant> - <constant name="DARK_SALMON" value="Color( 0.91, 0.59, 0.48, 1 )"> + <constant name="DARK_SALMON" value="Color(0.91, 0.59, 0.48, 1)"> Dark salmon color. </constant> - <constant name="DARK_SEA_GREEN" value="Color( 0.56, 0.74, 0.56, 1 )"> + <constant name="DARK_SEA_GREEN" value="Color(0.56, 0.74, 0.56, 1)"> Dark sea green color. </constant> - <constant name="DARK_SLATE_BLUE" value="Color( 0.28, 0.24, 0.55, 1 )"> + <constant name="DARK_SLATE_BLUE" value="Color(0.28, 0.24, 0.55, 1)"> Dark slate blue color. </constant> - <constant name="DARK_SLATE_GRAY" value="Color( 0.18, 0.31, 0.31, 1 )"> + <constant name="DARK_SLATE_GRAY" value="Color(0.18, 0.31, 0.31, 1)"> Dark slate gray color. </constant> - <constant name="DARK_TURQUOISE" value="Color( 0, 0.81, 0.82, 1 )"> + <constant name="DARK_TURQUOISE" value="Color(0, 0.81, 0.82, 1)"> Dark turquoise color. </constant> - <constant name="DARK_VIOLET" value="Color( 0.58, 0, 0.83, 1 )"> + <constant name="DARK_VIOLET" value="Color(0.58, 0, 0.83, 1)"> Dark violet color. </constant> - <constant name="DEEP_PINK" value="Color( 1, 0.08, 0.58, 1 )"> + <constant name="DEEP_PINK" value="Color(1, 0.08, 0.58, 1)"> Deep pink color. </constant> - <constant name="DEEP_SKY_BLUE" value="Color( 0, 0.75, 1, 1 )"> + <constant name="DEEP_SKY_BLUE" value="Color(0, 0.75, 1, 1)"> Deep sky blue color. </constant> - <constant name="DIM_GRAY" value="Color( 0.41, 0.41, 0.41, 1 )"> + <constant name="DIM_GRAY" value="Color(0.41, 0.41, 0.41, 1)"> Dim gray color. </constant> - <constant name="DODGER_BLUE" value="Color( 0.12, 0.56, 1, 1 )"> + <constant name="DODGER_BLUE" value="Color(0.12, 0.56, 1, 1)"> Dodger blue color. </constant> - <constant name="FIREBRICK" value="Color( 0.7, 0.13, 0.13, 1 )"> + <constant name="FIREBRICK" value="Color(0.7, 0.13, 0.13, 1)"> Firebrick color. </constant> - <constant name="FLORAL_WHITE" value="Color( 1, 0.98, 0.94, 1 )"> + <constant name="FLORAL_WHITE" value="Color(1, 0.98, 0.94, 1)"> Floral white color. </constant> - <constant name="FOREST_GREEN" value="Color( 0.13, 0.55, 0.13, 1 )"> + <constant name="FOREST_GREEN" value="Color(0.13, 0.55, 0.13, 1)"> Forest green color. </constant> - <constant name="FUCHSIA" value="Color( 1, 0, 1, 1 )"> + <constant name="FUCHSIA" value="Color(1, 0, 1, 1)"> Fuchsia color. </constant> - <constant name="GAINSBORO" value="Color( 0.86, 0.86, 0.86, 1 )"> + <constant name="GAINSBORO" value="Color(0.86, 0.86, 0.86, 1)"> Gainsboro color. </constant> - <constant name="GHOST_WHITE" value="Color( 0.97, 0.97, 1, 1 )"> + <constant name="GHOST_WHITE" value="Color(0.97, 0.97, 1, 1)"> Ghost white color. </constant> - <constant name="GOLD" value="Color( 1, 0.84, 0, 1 )"> + <constant name="GOLD" value="Color(1, 0.84, 0, 1)"> Gold color. </constant> - <constant name="GOLDENROD" value="Color( 0.85, 0.65, 0.13, 1 )"> + <constant name="GOLDENROD" value="Color(0.85, 0.65, 0.13, 1)"> Goldenrod color. </constant> - <constant name="GRAY" value="Color( 0.75, 0.75, 0.75, 1 )"> + <constant name="GRAY" value="Color(0.75, 0.75, 0.75, 1)"> Gray color. </constant> - <constant name="GREEN" value="Color( 0, 1, 0, 1 )"> + <constant name="GREEN" value="Color(0, 1, 0, 1)"> Green color. </constant> - <constant name="GREEN_YELLOW" value="Color( 0.68, 1, 0.18, 1 )"> + <constant name="GREEN_YELLOW" value="Color(0.68, 1, 0.18, 1)"> Green yellow color. </constant> - <constant name="HONEYDEW" value="Color( 0.94, 1, 0.94, 1 )"> + <constant name="HONEYDEW" value="Color(0.94, 1, 0.94, 1)"> Honeydew color. </constant> - <constant name="HOT_PINK" value="Color( 1, 0.41, 0.71, 1 )"> + <constant name="HOT_PINK" value="Color(1, 0.41, 0.71, 1)"> Hot pink color. </constant> - <constant name="INDIAN_RED" value="Color( 0.8, 0.36, 0.36, 1 )"> + <constant name="INDIAN_RED" value="Color(0.8, 0.36, 0.36, 1)"> Indian red color. </constant> - <constant name="INDIGO" value="Color( 0.29, 0, 0.51, 1 )"> + <constant name="INDIGO" value="Color(0.29, 0, 0.51, 1)"> Indigo color. </constant> - <constant name="IVORY" value="Color( 1, 1, 0.94, 1 )"> + <constant name="IVORY" value="Color(1, 1, 0.94, 1)"> Ivory color. </constant> - <constant name="KHAKI" value="Color( 0.94, 0.9, 0.55, 1 )"> + <constant name="KHAKI" value="Color(0.94, 0.9, 0.55, 1)"> Khaki color. </constant> - <constant name="LAVENDER" value="Color( 0.9, 0.9, 0.98, 1 )"> + <constant name="LAVENDER" value="Color(0.9, 0.9, 0.98, 1)"> Lavender color. </constant> - <constant name="LAVENDER_BLUSH" value="Color( 1, 0.94, 0.96, 1 )"> + <constant name="LAVENDER_BLUSH" value="Color(1, 0.94, 0.96, 1)"> Lavender blush color. </constant> - <constant name="LAWN_GREEN" value="Color( 0.49, 0.99, 0, 1 )"> + <constant name="LAWN_GREEN" value="Color(0.49, 0.99, 0, 1)"> Lawn green color. </constant> - <constant name="LEMON_CHIFFON" value="Color( 1, 0.98, 0.8, 1 )"> + <constant name="LEMON_CHIFFON" value="Color(1, 0.98, 0.8, 1)"> Lemon chiffon color. </constant> - <constant name="LIGHT_BLUE" value="Color( 0.68, 0.85, 0.9, 1 )"> + <constant name="LIGHT_BLUE" value="Color(0.68, 0.85, 0.9, 1)"> Light blue color. </constant> - <constant name="LIGHT_CORAL" value="Color( 0.94, 0.5, 0.5, 1 )"> + <constant name="LIGHT_CORAL" value="Color(0.94, 0.5, 0.5, 1)"> Light coral color. </constant> - <constant name="LIGHT_CYAN" value="Color( 0.88, 1, 1, 1 )"> + <constant name="LIGHT_CYAN" value="Color(0.88, 1, 1, 1)"> Light cyan color. </constant> - <constant name="LIGHT_GOLDENROD" value="Color( 0.98, 0.98, 0.82, 1 )"> + <constant name="LIGHT_GOLDENROD" value="Color(0.98, 0.98, 0.82, 1)"> Light goldenrod color. </constant> - <constant name="LIGHT_GRAY" value="Color( 0.83, 0.83, 0.83, 1 )"> + <constant name="LIGHT_GRAY" value="Color(0.83, 0.83, 0.83, 1)"> Light gray color. </constant> - <constant name="LIGHT_GREEN" value="Color( 0.56, 0.93, 0.56, 1 )"> + <constant name="LIGHT_GREEN" value="Color(0.56, 0.93, 0.56, 1)"> Light green color. </constant> - <constant name="LIGHT_PINK" value="Color( 1, 0.71, 0.76, 1 )"> + <constant name="LIGHT_PINK" value="Color(1, 0.71, 0.76, 1)"> Light pink color. </constant> - <constant name="LIGHT_SALMON" value="Color( 1, 0.63, 0.48, 1 )"> + <constant name="LIGHT_SALMON" value="Color(1, 0.63, 0.48, 1)"> Light salmon color. </constant> - <constant name="LIGHT_SEA_GREEN" value="Color( 0.13, 0.7, 0.67, 1 )"> + <constant name="LIGHT_SEA_GREEN" value="Color(0.13, 0.7, 0.67, 1)"> Light sea green color. </constant> - <constant name="LIGHT_SKY_BLUE" value="Color( 0.53, 0.81, 0.98, 1 )"> + <constant name="LIGHT_SKY_BLUE" value="Color(0.53, 0.81, 0.98, 1)"> Light sky blue color. </constant> - <constant name="LIGHT_SLATE_GRAY" value="Color( 0.47, 0.53, 0.6, 1 )"> + <constant name="LIGHT_SLATE_GRAY" value="Color(0.47, 0.53, 0.6, 1)"> Light slate gray color. </constant> - <constant name="LIGHT_STEEL_BLUE" value="Color( 0.69, 0.77, 0.87, 1 )"> + <constant name="LIGHT_STEEL_BLUE" value="Color(0.69, 0.77, 0.87, 1)"> Light steel blue color. </constant> - <constant name="LIGHT_YELLOW" value="Color( 1, 1, 0.88, 1 )"> + <constant name="LIGHT_YELLOW" value="Color(1, 1, 0.88, 1)"> Light yellow color. </constant> - <constant name="LIME" value="Color( 0, 1, 0, 1 )"> + <constant name="LIME" value="Color(0, 1, 0, 1)"> Lime color. </constant> - <constant name="LIME_GREEN" value="Color( 0.2, 0.8, 0.2, 1 )"> + <constant name="LIME_GREEN" value="Color(0.2, 0.8, 0.2, 1)"> Lime green color. </constant> - <constant name="LINEN" value="Color( 0.98, 0.94, 0.9, 1 )"> + <constant name="LINEN" value="Color(0.98, 0.94, 0.9, 1)"> Linen color. </constant> - <constant name="MAGENTA" value="Color( 1, 0, 1, 1 )"> + <constant name="MAGENTA" value="Color(1, 0, 1, 1)"> Magenta color. </constant> - <constant name="MAROON" value="Color( 0.69, 0.19, 0.38, 1 )"> + <constant name="MAROON" value="Color(0.69, 0.19, 0.38, 1)"> Maroon color. </constant> - <constant name="MEDIUM_AQUAMARINE" value="Color( 0.4, 0.8, 0.67, 1 )"> + <constant name="MEDIUM_AQUAMARINE" value="Color(0.4, 0.8, 0.67, 1)"> Medium aquamarine color. </constant> - <constant name="MEDIUM_BLUE" value="Color( 0, 0, 0.8, 1 )"> + <constant name="MEDIUM_BLUE" value="Color(0, 0, 0.8, 1)"> Medium blue color. </constant> - <constant name="MEDIUM_ORCHID" value="Color( 0.73, 0.33, 0.83, 1 )"> + <constant name="MEDIUM_ORCHID" value="Color(0.73, 0.33, 0.83, 1)"> Medium orchid color. </constant> - <constant name="MEDIUM_PURPLE" value="Color( 0.58, 0.44, 0.86, 1 )"> + <constant name="MEDIUM_PURPLE" value="Color(0.58, 0.44, 0.86, 1)"> Medium purple color. </constant> - <constant name="MEDIUM_SEA_GREEN" value="Color( 0.24, 0.7, 0.44, 1 )"> + <constant name="MEDIUM_SEA_GREEN" value="Color(0.24, 0.7, 0.44, 1)"> Medium sea green color. </constant> - <constant name="MEDIUM_SLATE_BLUE" value="Color( 0.48, 0.41, 0.93, 1 )"> + <constant name="MEDIUM_SLATE_BLUE" value="Color(0.48, 0.41, 0.93, 1)"> Medium slate blue color. </constant> - <constant name="MEDIUM_SPRING_GREEN" value="Color( 0, 0.98, 0.6, 1 )"> + <constant name="MEDIUM_SPRING_GREEN" value="Color(0, 0.98, 0.6, 1)"> Medium spring green color. </constant> - <constant name="MEDIUM_TURQUOISE" value="Color( 0.28, 0.82, 0.8, 1 )"> + <constant name="MEDIUM_TURQUOISE" value="Color(0.28, 0.82, 0.8, 1)"> Medium turquoise color. </constant> - <constant name="MEDIUM_VIOLET_RED" value="Color( 0.78, 0.08, 0.52, 1 )"> + <constant name="MEDIUM_VIOLET_RED" value="Color(0.78, 0.08, 0.52, 1)"> Medium violet red color. </constant> - <constant name="MIDNIGHT_BLUE" value="Color( 0.1, 0.1, 0.44, 1 )"> + <constant name="MIDNIGHT_BLUE" value="Color(0.1, 0.1, 0.44, 1)"> Midnight blue color. </constant> - <constant name="MINT_CREAM" value="Color( 0.96, 1, 0.98, 1 )"> + <constant name="MINT_CREAM" value="Color(0.96, 1, 0.98, 1)"> Mint cream color. </constant> - <constant name="MISTY_ROSE" value="Color( 1, 0.89, 0.88, 1 )"> + <constant name="MISTY_ROSE" value="Color(1, 0.89, 0.88, 1)"> Misty rose color. </constant> - <constant name="MOCCASIN" value="Color( 1, 0.89, 0.71, 1 )"> + <constant name="MOCCASIN" value="Color(1, 0.89, 0.71, 1)"> Moccasin color. </constant> - <constant name="NAVAJO_WHITE" value="Color( 1, 0.87, 0.68, 1 )"> + <constant name="NAVAJO_WHITE" value="Color(1, 0.87, 0.68, 1)"> Navajo white color. </constant> - <constant name="NAVY_BLUE" value="Color( 0, 0, 0.5, 1 )"> + <constant name="NAVY_BLUE" value="Color(0, 0, 0.5, 1)"> Navy blue color. </constant> - <constant name="OLD_LACE" value="Color( 0.99, 0.96, 0.9, 1 )"> + <constant name="OLD_LACE" value="Color(0.99, 0.96, 0.9, 1)"> Old lace color. </constant> - <constant name="OLIVE" value="Color( 0.5, 0.5, 0, 1 )"> + <constant name="OLIVE" value="Color(0.5, 0.5, 0, 1)"> Olive color. </constant> - <constant name="OLIVE_DRAB" value="Color( 0.42, 0.56, 0.14, 1 )"> + <constant name="OLIVE_DRAB" value="Color(0.42, 0.56, 0.14, 1)"> Olive drab color. </constant> - <constant name="ORANGE" value="Color( 1, 0.65, 0, 1 )"> + <constant name="ORANGE" value="Color(1, 0.65, 0, 1)"> Orange color. </constant> - <constant name="ORANGE_RED" value="Color( 1, 0.27, 0, 1 )"> + <constant name="ORANGE_RED" value="Color(1, 0.27, 0, 1)"> Orange red color. </constant> - <constant name="ORCHID" value="Color( 0.85, 0.44, 0.84, 1 )"> + <constant name="ORCHID" value="Color(0.85, 0.44, 0.84, 1)"> Orchid color. </constant> - <constant name="PALE_GOLDENROD" value="Color( 0.93, 0.91, 0.67, 1 )"> + <constant name="PALE_GOLDENROD" value="Color(0.93, 0.91, 0.67, 1)"> Pale goldenrod color. </constant> - <constant name="PALE_GREEN" value="Color( 0.6, 0.98, 0.6, 1 )"> + <constant name="PALE_GREEN" value="Color(0.6, 0.98, 0.6, 1)"> Pale green color. </constant> - <constant name="PALE_TURQUOISE" value="Color( 0.69, 0.93, 0.93, 1 )"> + <constant name="PALE_TURQUOISE" value="Color(0.69, 0.93, 0.93, 1)"> Pale turquoise color. </constant> - <constant name="PALE_VIOLET_RED" value="Color( 0.86, 0.44, 0.58, 1 )"> + <constant name="PALE_VIOLET_RED" value="Color(0.86, 0.44, 0.58, 1)"> Pale violet red color. </constant> - <constant name="PAPAYA_WHIP" value="Color( 1, 0.94, 0.84, 1 )"> + <constant name="PAPAYA_WHIP" value="Color(1, 0.94, 0.84, 1)"> Papaya whip color. </constant> - <constant name="PEACH_PUFF" value="Color( 1, 0.85, 0.73, 1 )"> + <constant name="PEACH_PUFF" value="Color(1, 0.85, 0.73, 1)"> Peach puff color. </constant> - <constant name="PERU" value="Color( 0.8, 0.52, 0.25, 1 )"> + <constant name="PERU" value="Color(0.8, 0.52, 0.25, 1)"> Peru color. </constant> - <constant name="PINK" value="Color( 1, 0.75, 0.8, 1 )"> + <constant name="PINK" value="Color(1, 0.75, 0.8, 1)"> Pink color. </constant> - <constant name="PLUM" value="Color( 0.87, 0.63, 0.87, 1 )"> + <constant name="PLUM" value="Color(0.87, 0.63, 0.87, 1)"> Plum color. </constant> - <constant name="POWDER_BLUE" value="Color( 0.69, 0.88, 0.9, 1 )"> + <constant name="POWDER_BLUE" value="Color(0.69, 0.88, 0.9, 1)"> Powder blue color. </constant> - <constant name="PURPLE" value="Color( 0.63, 0.13, 0.94, 1 )"> + <constant name="PURPLE" value="Color(0.63, 0.13, 0.94, 1)"> Purple color. </constant> - <constant name="REBECCA_PURPLE" value="Color( 0.4, 0.2, 0.6, 1 )"> + <constant name="REBECCA_PURPLE" value="Color(0.4, 0.2, 0.6, 1)"> Rebecca purple color. </constant> - <constant name="RED" value="Color( 1, 0, 0, 1 )"> + <constant name="RED" value="Color(1, 0, 0, 1)"> Red color. </constant> - <constant name="ROSY_BROWN" value="Color( 0.74, 0.56, 0.56, 1 )"> + <constant name="ROSY_BROWN" value="Color(0.74, 0.56, 0.56, 1)"> Rosy brown color. </constant> - <constant name="ROYAL_BLUE" value="Color( 0.25, 0.41, 0.88, 1 )"> + <constant name="ROYAL_BLUE" value="Color(0.25, 0.41, 0.88, 1)"> Royal blue color. </constant> - <constant name="SADDLE_BROWN" value="Color( 0.55, 0.27, 0.07, 1 )"> + <constant name="SADDLE_BROWN" value="Color(0.55, 0.27, 0.07, 1)"> Saddle brown color. </constant> - <constant name="SALMON" value="Color( 0.98, 0.5, 0.45, 1 )"> + <constant name="SALMON" value="Color(0.98, 0.5, 0.45, 1)"> Salmon color. </constant> - <constant name="SANDY_BROWN" value="Color( 0.96, 0.64, 0.38, 1 )"> + <constant name="SANDY_BROWN" value="Color(0.96, 0.64, 0.38, 1)"> Sandy brown color. </constant> - <constant name="SEA_GREEN" value="Color( 0.18, 0.55, 0.34, 1 )"> + <constant name="SEA_GREEN" value="Color(0.18, 0.55, 0.34, 1)"> Sea green color. </constant> - <constant name="SEASHELL" value="Color( 1, 0.96, 0.93, 1 )"> + <constant name="SEASHELL" value="Color(1, 0.96, 0.93, 1)"> Seashell color. </constant> - <constant name="SIENNA" value="Color( 0.63, 0.32, 0.18, 1 )"> + <constant name="SIENNA" value="Color(0.63, 0.32, 0.18, 1)"> Sienna color. </constant> - <constant name="SILVER" value="Color( 0.75, 0.75, 0.75, 1 )"> + <constant name="SILVER" value="Color(0.75, 0.75, 0.75, 1)"> Silver color. </constant> - <constant name="SKY_BLUE" value="Color( 0.53, 0.81, 0.92, 1 )"> + <constant name="SKY_BLUE" value="Color(0.53, 0.81, 0.92, 1)"> Sky blue color. </constant> - <constant name="SLATE_BLUE" value="Color( 0.42, 0.35, 0.8, 1 )"> + <constant name="SLATE_BLUE" value="Color(0.42, 0.35, 0.8, 1)"> Slate blue color. </constant> - <constant name="SLATE_GRAY" value="Color( 0.44, 0.5, 0.56, 1 )"> + <constant name="SLATE_GRAY" value="Color(0.44, 0.5, 0.56, 1)"> Slate gray color. </constant> - <constant name="SNOW" value="Color( 1, 0.98, 0.98, 1 )"> + <constant name="SNOW" value="Color(1, 0.98, 0.98, 1)"> Snow color. </constant> - <constant name="SPRING_GREEN" value="Color( 0, 1, 0.5, 1 )"> + <constant name="SPRING_GREEN" value="Color(0, 1, 0.5, 1)"> Spring green color. </constant> - <constant name="STEEL_BLUE" value="Color( 0.27, 0.51, 0.71, 1 )"> + <constant name="STEEL_BLUE" value="Color(0.27, 0.51, 0.71, 1)"> Steel blue color. </constant> - <constant name="TAN" value="Color( 0.82, 0.71, 0.55, 1 )"> + <constant name="TAN" value="Color(0.82, 0.71, 0.55, 1)"> Tan color. </constant> - <constant name="TEAL" value="Color( 0, 0.5, 0.5, 1 )"> + <constant name="TEAL" value="Color(0, 0.5, 0.5, 1)"> Teal color. </constant> - <constant name="THISTLE" value="Color( 0.85, 0.75, 0.85, 1 )"> + <constant name="THISTLE" value="Color(0.85, 0.75, 0.85, 1)"> Thistle color. </constant> - <constant name="TOMATO" value="Color( 1, 0.39, 0.28, 1 )"> + <constant name="TOMATO" value="Color(1, 0.39, 0.28, 1)"> Tomato color. </constant> - <constant name="TRANSPARENT" value="Color( 1, 1, 1, 0 )"> + <constant name="TRANSPARENT" value="Color(1, 1, 1, 0)"> Transparent color (white with zero alpha). </constant> - <constant name="TURQUOISE" value="Color( 0.25, 0.88, 0.82, 1 )"> + <constant name="TURQUOISE" value="Color(0.25, 0.88, 0.82, 1)"> Turquoise color. </constant> - <constant name="VIOLET" value="Color( 0.93, 0.51, 0.93, 1 )"> + <constant name="VIOLET" value="Color(0.93, 0.51, 0.93, 1)"> Violet color. </constant> - <constant name="WEB_GRAY" value="Color( 0.5, 0.5, 0.5, 1 )"> + <constant name="WEB_GRAY" value="Color(0.5, 0.5, 0.5, 1)"> Web gray color. </constant> - <constant name="WEB_GREEN" value="Color( 0, 0.5, 0, 1 )"> + <constant name="WEB_GREEN" value="Color(0, 0.5, 0, 1)"> Web green color. </constant> - <constant name="WEB_MAROON" value="Color( 0.5, 0, 0, 1 )"> + <constant name="WEB_MAROON" value="Color(0.5, 0, 0, 1)"> Web maroon color. </constant> - <constant name="WEB_PURPLE" value="Color( 0.5, 0, 0.5, 1 )"> + <constant name="WEB_PURPLE" value="Color(0.5, 0, 0.5, 1)"> Web purple color. </constant> - <constant name="WHEAT" value="Color( 0.96, 0.87, 0.7, 1 )"> + <constant name="WHEAT" value="Color(0.96, 0.87, 0.7, 1)"> Wheat color. </constant> - <constant name="WHITE" value="Color( 1, 1, 1, 1 )"> + <constant name="WHITE" value="Color(1, 1, 1, 1)"> White color. </constant> - <constant name="WHITE_SMOKE" value="Color( 0.96, 0.96, 0.96, 1 )"> + <constant name="WHITE_SMOKE" value="Color(0.96, 0.96, 0.96, 1)"> White smoke color. </constant> - <constant name="YELLOW" value="Color( 1, 1, 0, 1 )"> + <constant name="YELLOW" value="Color(1, 1, 0, 1)"> Yellow color. </constant> - <constant name="YELLOW_GREEN" value="Color( 0.6, 0.8, 0.2, 1 )"> + <constant name="YELLOW_GREEN" value="Color(0.6, 0.8, 0.2, 1)"> Yellow green color. </constant> </constants> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index fddfd27573..2111358ef4 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -38,7 +38,7 @@ </method> </methods> <members> - <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(1, 1, 1, 1)"> The currently selected color. </member> <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false"> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index e49027e61d..09b828366f 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -28,7 +28,7 @@ </method> </methods> <members> - <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 0, 0, 0, 1 )"> + <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(0, 0, 0, 1)"> The currently selected color. </member> <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true"> @@ -70,19 +70,19 @@ <theme_item name="font" type="Font"> [Font] of the [ColorPickerButton]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_color" type="Color" default="Color(1, 1, 1, 1)"> Default text [Color] of the [ColorPickerButton]. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.3 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.3)"> Text [Color] used when the [ColorPickerButton] is disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [ColorPickerButton] is being hovered. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [ColorPickerButton]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 0.8, 0.8, 0.8, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(0.8, 0.8, 0.8, 1)"> Text [Color] used when the [ColorPickerButton] is being pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 09ba4c8b26..84955fed8a 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The fill color. [codeblocks] [gdscript] diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml index 9999d086da..e6b2e1845d 100644 --- a/doc/classes/ConcavePolygonShape2D.xml +++ b/doc/classes/ConcavePolygonShape2D.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="segments" type="PackedVector2Array" setter="set_segments" getter="get_segments" default="PackedVector2Array( )"> + <member name="segments" type="PackedVector2Array" setter="set_segments" getter="get_segments" default="PackedVector2Array()"> The array of points that make up the [ConcavePolygonShape2D]'s line segments. </member> </members> diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index 8b903d8dbc..76855fc19f 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -9,7 +9,7 @@ [section] some_key=42 string_example="Hello World3D!" - a_vector=Vector3( 1, 0, 2 ) + a_vector=Vector3(1, 0, 2) [/codeblock] The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. The following example shows how to parse an INI-style file from the system, read its contents and store new values in it: diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 9d8977cef1..0253ef21df 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -27,8 +27,8 @@ </method> </methods> <members> - <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" override="true" default="Vector2i( 200, 70 )" /> - <member name="size" type="Vector2i" setter="set_size" getter="get_size" override="true" default="Vector2i( 200, 100 )" /> + <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" override="true" default="Vector2i(200, 70)" /> + <member name="size" type="Vector2i" setter="set_size" getter="get_size" override="true" default="Vector2i(200, 100)" /> <member name="title" type="String" setter="set_title" getter="get_title" override="true" default=""Please Confirm..."" /> </members> <constants> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 33969cf4c3..9015caa0b4 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -395,7 +395,7 @@ <method name="get_cursor_shape" qualifiers="const"> <return type="int" enum="Control.CursorShape"> </return> - <argument index="0" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="0" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape]. @@ -549,7 +549,7 @@ <method name="get_tooltip" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="at_position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="0" name="at_position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Returns the tooltip, which will appear when the cursor is resting over this control. See [member hint_tooltip]. @@ -1140,13 +1140,13 @@ <member name="rect_global_position" type="Vector2" setter="_set_global_position" getter="get_global_position"> The node's global position, relative to the world (usually to the top-left corner of the window). </member> - <member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2( 0, 0 )"> + <member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. </member> - <member name="rect_pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2( 0, 0 )"> + <member name="rect_pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)"> By default, the node's pivot is its top-left corner. When you change its [member rect_scale], it will scale around this pivot. Set this property to [member rect_size] / 2 to center the pivot in the node's rectangle. </member> - <member name="rect_position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="rect_position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)"> The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by [member rect_pivot_offset]. </member> <member name="rect_rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> @@ -1155,12 +1155,12 @@ <member name="rect_rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees" default="0.0"> The node's rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot's position. </member> - <member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )"> + <member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value. [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property. </member> - <member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2( 0, 0 )"> + <member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. </member> <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" default="1"> diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index 42951e2158..d53900e6c5 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -21,7 +21,7 @@ </method> </methods> <members> - <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array( )"> + <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array()"> The polygon's list of vertices. Can be in either clockwise or counterclockwise order. </member> </members> diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml index e18d716255..a5c86526b0 100644 --- a/doc/classes/ConvexPolygonShape3D.xml +++ b/doc/classes/ConvexPolygonShape3D.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="points" type="PackedVector3Array" setter="set_points" getter="get_points" default="PackedVector3Array( )"> + <member name="points" type="PackedVector3Array" setter="set_points" getter="get_points" default="PackedVector3Array()"> The list of 3D points forming the convex polygon shape. </member> </members> diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml index b33f3b4ffc..c9fcbd2892 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -15,9 +15,9 @@ </return> <argument index="0" name="position" type="Vector2"> </argument> - <argument index="1" name="in" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="in" type="Vector2" default="Vector2(0, 0)"> </argument> - <argument index="2" name="out" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="out" type="Vector2" default="Vector2(0, 0)"> </argument> <argument index="3" name="at_position" type="int" default="-1"> </argument> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index fcd150ad57..fdf96b4262 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -15,9 +15,9 @@ </return> <argument index="0" name="position" type="Vector3"> </argument> - <argument index="1" name="in" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="in" type="Vector3" default="Vector3(0, 0, 0)"> </argument> - <argument index="2" name="out" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="2" name="out" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <argument index="3" name="at_position" type="int" default="-1"> </argument> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index 14c35ae6d3..e84cea7c30 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -79,13 +79,13 @@ <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy" default="1.0"> Energy multiplier for the emission texture. This will make the decal emit light at a higher intensity. </member> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> Sets the size of the [AABB] used by the decal. The AABB goes from [code]-extents[/code] to [code]extents[/code]. </member> <member name="lower_fade" type="float" setter="set_lower_fade" getter="get_lower_fade" default="0.3"> Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. </member> - <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> Changes the [Color] of the Decal by multiplying it with this value. </member> <member name="normal_fade" type="float" setter="set_normal_fade" getter="get_normal_fade" default="0.0"> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 6c1cd37beb..0a4807f046 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -46,7 +46,7 @@ </argument> <argument index="1" name="flags" type="int"> </argument> - <argument index="2" name="rect" type="Rect2i" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="2" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)"> </argument> <description> </description> @@ -64,7 +64,7 @@ </argument> <argument index="1" name="shape" type="int" enum="DisplayServer.CursorShape" default="0"> </argument> - <argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="hotspot" type="Vector2" default="Vector2(0, 0)"> </argument> <description> </description> @@ -650,7 +650,7 @@ </return> <argument index="0" name="existing_text" type="String"> </argument> - <argument index="1" name="position" type="Rect2" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="1" name="position" type="Rect2" default="Rect2i(0, 0, 0, 0)"> </argument> <argument index="2" name="multiline" type="bool" default="false"> </argument> diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml index dcc6d6ef12..221b5e44d6 100644 --- a/doc/classes/EditorNode3DGizmo.xml +++ b/doc/classes/EditorNode3DGizmo.xml @@ -115,7 +115,7 @@ </argument> <argument index="2" name="billboard" type="bool" default="false"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during [method _redraw]. @@ -143,7 +143,7 @@ </argument> <argument index="1" name="default_scale" type="float" default="1"> </argument> - <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Adds an unscaled billboard for visualization. Call this function during [method _redraw]. diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index 5551326533..41c94cbbc6 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -163,7 +163,7 @@ </argument> <argument index="2" name="on_top" type="bool" default="false"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden. diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml index 9daa3f16bc..90eca9072b 100644 --- a/doc/classes/EditorSceneImporterMesh.xml +++ b/doc/classes/EditorSceneImporterMesh.xml @@ -22,7 +22,7 @@ </argument> <argument index="1" name="arrays" type="Array"> </argument> - <argument index="2" name="blend_shapes" type="Array" default="[ ]"> + <argument index="2" name="blend_shapes" type="Array" default="[]"> </argument> <argument index="3" name="lods" type="Dictionary" default="{ }"> @@ -168,7 +168,7 @@ </method> </methods> <members> - <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"surfaces": [ ]}"> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"surfaces": []}"> </member> </members> <constants> diff --git a/doc/classes/EngineDebugger.xml b/doc/classes/EngineDebugger.xml index 7db36b89d0..50ccb6b075 100644 --- a/doc/classes/EngineDebugger.xml +++ b/doc/classes/EngineDebugger.xml @@ -61,7 +61,7 @@ </argument> <argument index="1" name="enable" type="bool"> </argument> - <argument index="2" name="arguments" type="Array" default="[ ]"> + <argument index="2" name="arguments" type="Array" default="[]"> </argument> <description> Calls the [code]toggle[/code] callable of the profiler with given [code]name[/code] and [code]arguments[/code]. Enables/Disables the same profiler depending on [code]enable[/code] argument. diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 878535a08d..ae87a62c84 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -55,13 +55,13 @@ <member name="adjustment_saturation" type="float" setter="set_adjustment_saturation" getter="get_adjustment_saturation" default="1.0"> The global color saturation value of the rendered scene (default value is 1). Effective only if [code]adjustment_enabled[/code] is [code]true[/code]. </member> - <member name="ambient_light_color" type="Color" setter="set_ambient_light_color" getter="get_ambient_light_color" default="Color( 0, 0, 0, 1 )"> + <member name="ambient_light_color" type="Color" setter="set_ambient_light_color" getter="get_ambient_light_color" default="Color(0, 0, 0, 1)"> The ambient light's [Color]. </member> <member name="ambient_light_energy" type="float" setter="set_ambient_light_energy" getter="get_ambient_light_energy" default="1.0"> The ambient light's energy. The higher the value, the stronger the light. </member> - <member name="ambient_light_occlusion_color" type="Color" setter="set_ao_color" getter="get_ao_color" default="Color( 0, 0, 0, 1 )"> + <member name="ambient_light_occlusion_color" type="Color" setter="set_ao_color" getter="get_ao_color" default="Color(0, 0, 0, 1)"> </member> <member name="ambient_light_sky_contribution" type="float" setter="set_ambient_light_sky_contribution" getter="get_ambient_light_sky_contribution" default="1.0"> Defines the amount of light that the sky brings on the scene. A value of 0 means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of 1 means that all the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. @@ -89,7 +89,7 @@ <member name="background_canvas_max_layer" type="int" setter="set_canvas_max_layer" getter="get_canvas_max_layer" default="0"> The maximum layer ID to display. Only effective when using the [constant BG_CANVAS] background mode. </member> - <member name="background_color" type="Color" setter="set_bg_color" getter="get_bg_color" default="Color( 0, 0, 0, 1 )"> + <member name="background_color" type="Color" setter="set_bg_color" getter="get_bg_color" default="Color(0, 0, 0, 1)"> The [Color] displayed for clear areas of the scene. Only effective when using the [constant BG_COLOR] background mode. </member> <member name="background_energy" type="float" setter="set_bg_energy" getter="get_bg_energy" default="1.0"> @@ -111,7 +111,7 @@ </member> <member name="fog_height_density" type="float" setter="set_fog_height_density" getter="get_fog_height_density" default="0.0"> </member> - <member name="fog_light_color" type="Color" setter="set_fog_light_color" getter="get_fog_light_color" default="Color( 0.5, 0.6, 0.7, 1 )"> + <member name="fog_light_color" type="Color" setter="set_fog_light_color" getter="get_fog_light_color" default="Color(0.5, 0.6, 0.7, 1)"> </member> <member name="fog_light_energy" type="float" setter="set_fog_light_energy" getter="get_fog_light_energy" default="1.0"> </member> @@ -200,7 +200,7 @@ </member> <member name="sky_custom_fov" type="float" setter="set_sky_custom_fov" getter="get_sky_custom_fov" default="0.0"> </member> - <member name="sky_rotation" type="Vector3" setter="set_sky_rotation" getter="get_sky_rotation" default="Vector3( 0, 0, 0 )"> + <member name="sky_rotation" type="Vector3" setter="set_sky_rotation" getter="get_sky_rotation" default="Vector3(0, 0, 0)"> </member> <member name="ss_reflections_depth_tolerance" type="float" setter="set_ssr_depth_tolerance" getter="get_ssr_depth_tolerance" default="0.2"> The depth tolerance for screen-space reflections. @@ -263,7 +263,7 @@ </member> <member name="volumetric_fog_length" type="float" setter="set_volumetric_fog_length" getter="get_volumetric_fog_length" default="64.0"> </member> - <member name="volumetric_fog_light" type="Color" setter="set_volumetric_fog_light" getter="get_volumetric_fog_light" default="Color( 0, 0, 0, 1 )"> + <member name="volumetric_fog_light" type="Color" setter="set_volumetric_fog_light" getter="get_volumetric_fog_light" default="Color(0, 0, 0, 1)"> </member> <member name="volumetric_fog_light_energy" type="float" setter="set_volumetric_fog_light_energy" getter="get_volumetric_fog_light_energy" default="1.0"> </member> diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index e41de4c4ed..640b45dca4 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -12,9 +12,9 @@ var expression = Expression.new() func _ready(): - $LineEdit.connect("text_entered", self, "_on_text_entered") + $LineEdit.connect("text_submitted", self, "_on_text_submitted") - func _on_text_entered(command): + func _on_text_submitted(command): var error = expression.parse(command) if error != OK: print(expression.get_error_text()) @@ -28,7 +28,7 @@ public override void _Ready() { - GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered)); + GetNode("LineEdit").Connect("text_submitted", this, nameof(OnTextEntered)); } private void OnTextEntered(string command) @@ -54,7 +54,7 @@ <method name="execute"> <return type="Variant"> </return> - <argument index="0" name="inputs" type="Array" default="[ ]"> + <argument index="0" name="inputs" type="Array" default="[]"> </argument> <argument index="1" name="base_instance" type="Object" default="null"> </argument> @@ -84,7 +84,7 @@ </return> <argument index="0" name="expression" type="String"> </argument> - <argument index="1" name="input_names" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="1" name="input_names" type="PackedStringArray" default="PackedStringArray()"> </argument> <description> Parses the expression and returns an [enum Error] code. diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index 966be0a981..8ccee1c82e 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -72,7 +72,7 @@ <member name="file_mode" type="int" setter="set_file_mode" getter="get_file_mode" enum="FileDialog.FileMode" default="4"> The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]. </member> - <member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray( )"> + <member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray()"> The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code]. </member> <member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title" default="true"> @@ -139,16 +139,16 @@ <theme_item name="file" type="Texture2D"> Custom icon for files. </theme_item> - <theme_item name="file_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="file_icon_modulate" type="Color" default="Color(1, 1, 1, 1)"> The color modulation applied to the file icon. </theme_item> - <theme_item name="files_disabled" type="Color" default="Color( 0, 0, 0, 0.7 )"> + <theme_item name="files_disabled" type="Color" default="Color(0, 0, 0, 0.7)"> The color tint for disabled files (when the [FileDialog] is used in open folder mode). </theme_item> <theme_item name="folder" type="Texture2D"> Custom icon for folders. </theme_item> - <theme_item name="folder_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="folder_icon_modulate" type="Color" default="Color(1, 1, 1, 1)"> The color modulation applied to the folder icon. </theme_item> <theme_item name="forward_folder" type="Texture2D"> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 20d5b6ce9b..186bfbb931 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -85,11 +85,11 @@ </argument> <argument index="4" name="size" type="int" default="-1"> </argument> - <argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="6" name="outline_size" type="int" default="0"> </argument> - <argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <description> Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. @@ -113,11 +113,11 @@ </argument> <argument index="6" name="size" type="int" default="-1"> </argument> - <argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="8" name="outline_size" type="int" default="0"> </argument> - <argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <argument index="10" name="flags" type="int" default="51"> </argument> @@ -141,11 +141,11 @@ </argument> <argument index="5" name="size" type="int" default="-1"> </argument> - <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="7" name="outline_size" type="int" default="0"> </argument> - <argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)"> </argument> <argument index="9" name="flags" type="int" default="3"> </argument> diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml index e426c8fb36..0a2fb03750 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontData.xml @@ -61,7 +61,7 @@ </argument> <argument index="3" name="index" type="int"> </argument> - <argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="4" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. @@ -82,7 +82,7 @@ </argument> <argument index="4" name="index" type="int"> </argument> - <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="5" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn. diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index ebd6d2b92c..8684a7f41a 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -80,7 +80,7 @@ </member> <member name="trail_sections" type="int" setter="set_trail_sections" getter="get_trail_sections" default="8"> </member> - <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" default="Rect2( -100, -100, 200, 200 )"> + <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" default="Rect2(-100, -100, 200, 200)"> The [Rect2] that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The [Rect2] can be grown via code or with the [b]Particles → Generate Visibility Rect[/b] editor tool. </member> diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index 47bdd9d745..55e9b33aa8 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -132,7 +132,7 @@ </member> <member name="transform_align" type="int" setter="set_transform_align" getter="get_transform_align" enum="GPUParticles3D.TransformAlign" default="0"> </member> - <member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB( -4, -4, -4, 8, 8, 8 )"> + <member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB(-4, -4, -4, 8, 8, 8)"> The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the [b]Particles → Generate AABB[/b] editor tool. </member> diff --git a/doc/classes/GPUParticlesAttractorBox.xml b/doc/classes/GPUParticlesAttractorBox.xml index 68616f9bbd..49e6111c29 100644 --- a/doc/classes/GPUParticlesAttractorBox.xml +++ b/doc/classes/GPUParticlesAttractorBox.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> </members> <constants> diff --git a/doc/classes/GPUParticlesAttractorVectorField.xml b/doc/classes/GPUParticlesAttractorVectorField.xml index cf5e375ea3..7364a4b09f 100644 --- a/doc/classes/GPUParticlesAttractorVectorField.xml +++ b/doc/classes/GPUParticlesAttractorVectorField.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture"> </member> diff --git a/doc/classes/GPUParticlesCollisionBox.xml b/doc/classes/GPUParticlesCollisionBox.xml index 17fc124c41..58de18556e 100644 --- a/doc/classes/GPUParticlesCollisionBox.xml +++ b/doc/classes/GPUParticlesCollisionBox.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> </members> <constants> diff --git a/doc/classes/GPUParticlesCollisionHeightField.xml b/doc/classes/GPUParticlesCollisionHeightField.xml index c6987515a9..0ddddda8e4 100644 --- a/doc/classes/GPUParticlesCollisionHeightField.xml +++ b/doc/classes/GPUParticlesCollisionHeightField.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> <member name="follow_camera_enabled" type="bool" setter="set_follow_camera_mode" getter="is_follow_camera_mode_enabled" default="false"> </member> diff --git a/doc/classes/GPUParticlesCollisionSDF.xml b/doc/classes/GPUParticlesCollisionSDF.xml index c3cbe4b1c6..7ef6f5f3cd 100644 --- a/doc/classes/GPUParticlesCollisionSDF.xml +++ b/doc/classes/GPUParticlesCollisionSDF.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF.Resolution" default="2"> </member> diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index 28c647a1c3..1f1f266c59 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -87,10 +87,10 @@ </method> </methods> <members> - <member name="colors" type="PackedColorArray" setter="set_colors" getter="get_colors" default="PackedColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )"> + <member name="colors" type="PackedColorArray" setter="set_colors" getter="get_colors" default="PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1)"> Gradient's colors returned as a [PackedColorArray]. </member> - <member name="offsets" type="PackedFloat32Array" setter="set_offsets" getter="get_offsets" default="PackedFloat32Array( 0, 1 )"> + <member name="offsets" type="PackedFloat32Array" setter="set_offsets" getter="get_offsets" default="PackedFloat32Array(0, 1)"> Gradient's offsets returned as a [PackedFloat32Array]. </member> </members> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index b4536c0589..65701b3a6a 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -187,16 +187,19 @@ <member name="minimap_opacity" type="float" setter="set_minimap_opacity" getter="get_minimap_opacity" default="0.65"> The opacity of the minimap rectangle. </member> - <member name="minimap_size" type="Vector2" setter="set_minimap_size" getter="get_minimap_size" default="Vector2( 240, 160 )"> + <member name="minimap_size" type="Vector2" setter="set_minimap_size" getter="get_minimap_size" default="Vector2(240, 160)"> The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. </member> <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" override="true" default="true" /> <member name="right_disconnects" type="bool" setter="set_right_disconnects" getter="is_right_disconnects_enabled" default="false"> If [code]true[/code], enables disconnection of existing connections in the GraphEdit by dragging the right end. </member> - <member name="scroll_offset" type="Vector2" setter="set_scroll_ofs" getter="get_scroll_ofs" default="Vector2( 0, 0 )"> + <member name="scroll_offset" type="Vector2" setter="set_scroll_ofs" getter="get_scroll_ofs" default="Vector2(0, 0)"> The scroll offset. </member> + <member name="show_zoom_label" type="bool" setter="set_show_zoom_label" getter="is_showing_zoom_label" default="false"> + If [code]true[/code], makes a label with the current zoom level visible. The zoom value is displayed in percents. + </member> <member name="snap_distance" type="int" setter="set_snap" getter="get_snap" default="20"> The snapping distance in pixels. </member> @@ -206,6 +209,15 @@ <member name="zoom" type="float" setter="set_zoom" getter="get_zoom" default="1.0"> The current zoom value. </member> + <member name="zoom_max" type="float" setter="set_zoom_max" getter="get_zoom_max" default="2.0736"> + The upper zoom limit. + </member> + <member name="zoom_min" type="float" setter="set_zoom_min" getter="get_zoom_min" default="0.232568"> + The lower zoom limit. + </member> + <member name="zoom_step" type="float" setter="set_zoom_step" getter="get_zoom_step" default="1.2"> + The step of each zoom level. + </member> </members> <signals> <signal name="begin_node_move"> @@ -317,7 +329,7 @@ <constants> </constants> <theme_items> - <theme_item name="activity" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="activity" type="Color" default="Color(1, 1, 1, 1)"> </theme_item> <theme_item name="bezier_len_neg" type="int" default="160"> </theme_item> @@ -326,10 +338,10 @@ <theme_item name="bg" type="StyleBox"> The background drawn under the grid. </theme_item> - <theme_item name="grid_major" type="Color" default="Color( 1, 1, 1, 0.2 )"> + <theme_item name="grid_major" type="Color" default="Color(1, 1, 1, 0.2)"> Color of major grid lines. </theme_item> - <theme_item name="grid_minor" type="Color" default="Color( 1, 1, 1, 0.05 )"> + <theme_item name="grid_minor" type="Color" default="Color(1, 1, 1, 0.05)"> Color of minor grid lines. </theme_item> <theme_item name="minimap" type="Texture2D"> @@ -349,10 +361,10 @@ <theme_item name="reset" type="Texture2D"> The icon for the zoom reset button. </theme_item> - <theme_item name="selection_fill" type="Color" default="Color( 1, 1, 1, 0.3 )"> + <theme_item name="selection_fill" type="Color" default="Color(1, 1, 1, 0.3)"> The fill color of the selection rectangle. </theme_item> - <theme_item name="selection_stroke" type="Color" default="Color( 1, 1, 1, 0.8 )"> + <theme_item name="selection_stroke" type="Color" default="Color(1, 1, 1, 0.8)"> The outline color of the selection rectangle. </theme_item> <theme_item name="snap" type="Texture2D"> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 82ba45f11a..84eda7fcea 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -285,7 +285,7 @@ <member name="overlay" type="int" setter="set_overlay" getter="get_overlay" enum="GraphNode.Overlay" default="0"> Sets the overlay shown above the GraphNode. See [enum Overlay]. </member> - <member name="position_offset" type="Vector2" setter="set_position_offset" getter="get_position_offset" default="Vector2( 0, 0 )"> + <member name="position_offset" type="Vector2" setter="set_position_offset" getter="get_position_offset" default="Vector2(0, 0)"> The offset of the GraphNode, relative to the scroll offset of the [GraphEdit]. [b]Note:[/b] You cannot use position offset directly, as [GraphEdit] is a [Container]. </member> @@ -365,7 +365,7 @@ <theme_item name="close" type="Texture2D"> The icon for the close button, visible when [member show_close] is enabled. </theme_item> - <theme_item name="close_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="close_color" type="Color" default="Color(0, 0, 0, 1)"> The color modulation applied to the close button icon. </theme_item> <theme_item name="close_offset" type="int" default="18"> @@ -396,7 +396,7 @@ <theme_item name="resizer" type="Texture2D"> The icon used for resizer, visible when [member resizable] is enabled. </theme_item> - <theme_item name="resizer_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="resizer_color" type="Color" default="Color(0, 0, 0, 1)"> The color modulation applied to the resizer icon. </theme_item> <theme_item name="selectedframe" type="StyleBox"> @@ -405,7 +405,7 @@ <theme_item name="separation" type="int" default="1"> The vertical distance between ports. </theme_item> - <theme_item name="title_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="title_color" type="Color" default="Color(0, 0, 0, 1)"> Color of the title text. </theme_item> <theme_item name="title_font" type="Font"> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 25667d8f79..908e355db3 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -192,7 +192,7 @@ </return> <argument index="0" name="url" type="String"> </argument> - <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray()"> </argument> <argument index="2" name="ssl_validate_domain" type="bool" default="true"> </argument> @@ -211,13 +211,13 @@ </return> <argument index="0" name="url" type="String"> </argument> - <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray()"> </argument> <argument index="2" name="ssl_validate_domain" type="bool" default="true"> </argument> <argument index="3" name="method" type="int" enum="HTTPClient.Method" default="0"> </argument> - <argument index="4" name="request_data_raw" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="4" name="request_data_raw" type="PackedByteArray" default="PackedByteArray()"> </argument> <description> Creates request on the underlying [HTTPClient] using a raw array of bytes for the request body. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request]. diff --git a/doc/classes/HeightMapShape3D.xml b/doc/classes/HeightMapShape3D.xml index f6f2a27891..9a9d3bf8f4 100644 --- a/doc/classes/HeightMapShape3D.xml +++ b/doc/classes/HeightMapShape3D.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="map_data" type="PackedFloat32Array" setter="set_map_data" getter="get_map_data" default="PackedFloat32Array( 0, 0, 0, 0 )"> + <member name="map_data" type="PackedFloat32Array" setter="set_map_data" getter="get_map_data" default="PackedFloat32Array(0, 0, 0, 0)"> Height map data, pool array must be of [member map_width] * [member map_depth] size. </member> <member name="map_depth" type="int" setter="set_map_depth" getter="get_map_depth" default="2"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 91a07f66e0..167b90ea73 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -560,7 +560,7 @@ </method> </methods> <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"data": PackedByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}"> + <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"data": PackedByteArray(),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}"> Holds all the image's color data in a given format. See [enum Format] constants. </member> </members> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index ebfd32c5fb..05a8bd268e 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -341,7 +341,7 @@ </argument> <argument index="1" name="shape" type="int" enum="Input.CursorShape" default="0"> </argument> - <argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="hotspot" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See [enum CursorShape] for the list of shapes. diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 28c4773f51..0c8db0de73 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -111,7 +111,7 @@ </return> <argument index="0" name="xform" type="Transform2D"> </argument> - <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="local_ofs" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Returns a copy of the given input event which has been offset by [code]local_ofs[/code] and transformed by [code]xform[/code]. Relevant for events of type [InputEventMouseButton], [InputEventMouseMotion], [InputEventScreenTouch], [InputEventScreenDrag], [InputEventMagnifyGesture] and [InputEventPanGesture]. diff --git a/doc/classes/InputEventGesture.xml b/doc/classes/InputEventGesture.xml index 861ec026cd..fbde318ada 100644 --- a/doc/classes/InputEventGesture.xml +++ b/doc/classes/InputEventGesture.xml @@ -10,7 +10,7 @@ <methods> </methods> <members> - <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> The local gesture position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] that received this gesture. </member> </members> diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index e54c3224da..b8043118b7 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -15,10 +15,10 @@ <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" default="0"> The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. </member> - <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2( 0, 0 )"> + <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2(0, 0)"> The global mouse position relative to the current [Viewport] when used in [method Control._gui_input], otherwise is at 0,0. </member> - <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse. </member> </members> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index 0f9e71adb4..881d74ac7b 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -17,14 +17,14 @@ <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. </member> - <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2( 0, 0 )"> + <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2(0, 0)"> The mouse position relative to the previous position (position at the last frame). [b]Note:[/b] Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of [code]Vector2(0, 0)[/code] when the user stops moving the mouse. </member> - <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )"> + <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2(0, 0)"> The mouse speed in pixels per second. </member> - <member name="tilt" type="Vector2" setter="set_tilt" getter="get_tilt" default="Vector2( 0, 0 )"> + <member name="tilt" type="Vector2" setter="set_tilt" getter="get_tilt" default="Vector2(0, 0)"> Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from [code]-1.0[/code] to [code]1.0[/code] for both axes. </member> </members> diff --git a/doc/classes/InputEventPanGesture.xml b/doc/classes/InputEventPanGesture.xml index 83161cd163..ffb1901dad 100644 --- a/doc/classes/InputEventPanGesture.xml +++ b/doc/classes/InputEventPanGesture.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="delta" type="Vector2" setter="set_delta" getter="get_delta" default="Vector2( 0, 0 )"> + <member name="delta" type="Vector2" setter="set_delta" getter="get_delta" default="Vector2(0, 0)"> </member> </members> <constants> diff --git a/doc/classes/InputEventScreenDrag.xml b/doc/classes/InputEventScreenDrag.xml index d69f175be8..079ac03f45 100644 --- a/doc/classes/InputEventScreenDrag.xml +++ b/doc/classes/InputEventScreenDrag.xml @@ -15,13 +15,13 @@ <member name="index" type="int" setter="set_index" getter="get_index" default="0"> The drag event index in the case of a multi-drag event. </member> - <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> The drag position. </member> - <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2( 0, 0 )"> + <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2(0, 0)"> The drag position relative to its start position. </member> - <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )"> + <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2(0, 0)"> The drag speed. </member> </members> diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml index f497f2fecc..7aa5f62b05 100644 --- a/doc/classes/InputEventScreenTouch.xml +++ b/doc/classes/InputEventScreenTouch.xml @@ -16,7 +16,7 @@ <member name="index" type="int" setter="set_index" getter="get_index" default="0"> The touch index in the case of a multi-touch event. One index = one finger. </member> - <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> The touch position. </member> <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 0020cbf242..c639e0b88e 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -484,7 +484,7 @@ The width all columns will be adjusted to. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. </member> - <member name="fixed_icon_size" type="Vector2" setter="set_fixed_icon_size" getter="get_fixed_icon_size" default="Vector2( 0, 0 )"> + <member name="fixed_icon_size" type="Vector2" setter="set_fixed_icon_size" getter="get_fixed_icon_size" default="Vector2(0, 0)"> The size all icons will be adjusted to. If either X or Y component is not greater than zero, icon size won't be affected. </member> @@ -593,19 +593,19 @@ <theme_item name="font" type="Font"> [Font] of the item's text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.63, 0.63, 0.63, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.63, 0.63, 0.63, 1)"> Default text [Color] of the item. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the item. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the item is selected. </theme_item> <theme_item name="font_size" type="int"> Font size of the item's text. </theme_item> - <theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )"> + <theme_item name="guide_color" type="Color" default="Color(0, 0, 0, 0.1)"> [Color] of the guideline. The guideline is a line drawn between each row of items. </theme_item> <theme_item name="hseparation" type="int" default="4"> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 5480d7d55f..d7999f1aa0 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -21,28 +21,31 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> + <member name="collider_rid" type="RID" setter="" getter="get_collider_rid"> + The colliding body's [RID] used by the [PhysicsServer2D]. + </member> <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> The colliding shape's index. See [CollisionObject2D]. </member> - <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2( 0, 0 )"> + <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2(0, 0)"> The colliding object's velocity. </member> <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> - <member name="normal" type="Vector2" setter="" getter="get_normal" default="Vector2( 0, 0 )"> + <member name="normal" type="Vector2" setter="" getter="get_normal" default="Vector2(0, 0)"> The colliding body's shape's normal at the point of collision. </member> - <member name="position" type="Vector2" setter="" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="" getter="get_position" default="Vector2(0, 0)"> The point of collision, in global coordinates. </member> - <member name="remainder" type="Vector2" setter="" getter="get_remainder" default="Vector2( 0, 0 )"> + <member name="remainder" type="Vector2" setter="" getter="get_remainder" default="Vector2(0, 0)"> The moving object's remaining movement vector. </member> - <member name="travel" type="Vector2" setter="" getter="get_travel" default="Vector2( 0, 0 )"> + <member name="travel" type="Vector2" setter="" getter="get_travel" default="Vector2(0, 0)"> The distance the moving object traveled before collision. </member> </members> diff --git a/doc/classes/KinematicCollision3D.xml b/doc/classes/KinematicCollision3D.xml index 329efab474..abdb5b4f4e 100644 --- a/doc/classes/KinematicCollision3D.xml +++ b/doc/classes/KinematicCollision3D.xml @@ -21,28 +21,31 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> + <member name="collider_rid" type="RID" setter="" getter="get_collider_rid"> + The colliding body's [RID] used by the [PhysicsServer3D]. + </member> <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> The colliding shape's index. See [CollisionObject3D]. </member> - <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" default="Vector3( 0, 0, 0 )"> + <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" default="Vector3(0, 0, 0)"> The colliding object's velocity. </member> <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> - <member name="normal" type="Vector3" setter="" getter="get_normal" default="Vector3( 0, 0, 0 )"> + <member name="normal" type="Vector3" setter="" getter="get_normal" default="Vector3(0, 0, 0)"> The colliding body's shape's normal at the point of collision. </member> - <member name="position" type="Vector3" setter="" getter="get_position" default="Vector3( 0, 0, 0 )"> + <member name="position" type="Vector3" setter="" getter="get_position" default="Vector3(0, 0, 0)"> The point of collision, in global coordinates. </member> - <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3( 0, 0, 0 )"> + <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3(0, 0, 0)"> The moving object's remaining movement vector. </member> - <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3( 0, 0, 0 )"> + <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3(0, 0, 0)"> The distance the moving object traveled before collision. </member> </members> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 76b9686393..ee59f0c85a 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -98,7 +98,7 @@ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]"> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> Set additional options for BiDi override. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> @@ -147,13 +147,13 @@ <theme_item name="font" type="Font"> [Font] used for the [Label]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_color" type="Color" default="Color(1, 1, 1, 1)"> Default text [Color] of the [Label]. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of [Font]'s outline. </theme_item> - <theme_item name="font_shadow_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="font_shadow_color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index f6698352ab..0e71f29b58 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -30,7 +30,7 @@ <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="Light2D.BlendMode" default="0"> The Light2D's blend mode. See [enum BlendMode] constants for values. </member> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The Light2D's [Color]. </member> <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" default="false"> @@ -57,7 +57,7 @@ <member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" default="-1024"> Minimum [code]z[/code] value of objects that are affected by the Light2D. </member> - <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 0 )"> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 0)"> [Color] of shadows cast by the Light2D. </member> <member name="shadow_enabled" type="bool" setter="set_shadow_enabled" getter="is_shadow_enabled" default="false"> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 42b9ed8ab4..84abf57cb6 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -42,7 +42,7 @@ <member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1"> The light's bake mode. See [enum BakeMode]. </member> - <member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The light's color. An [i]overbright[/i] color can be used to achieve a result equivalent to increasing the light's [member light_energy]. </member> <member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295"> @@ -72,7 +72,7 @@ <member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0"> Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. </member> - <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 1 )"> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 1)"> The color of shadows cast by this light. </member> <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false"> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index dec5d60cbb..587d5833b9 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -74,7 +74,7 @@ <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode" default="0"> Controls the style of the line's first point. Use [enum LineCapMode] constants. </member> - <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color( 1, 1, 1, 1 )"> + <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color(1, 1, 1, 1)"> The line's color. Will not be used if a gradient is set. </member> <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0"> @@ -86,7 +86,7 @@ <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode" default="0"> The style for the points between the start and the end. </member> - <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array( )"> + <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array()"> The points that form the lines. The line is drawn between every point set in this array. Points are interpreted as local vectors. </member> <member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision" default="8"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 7adf19632e..f1e7c5f6e1 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -221,7 +221,7 @@ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]"> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> Set additional options for BiDi override. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> @@ -248,7 +248,7 @@ Emitted when the text changes. </description> </signal> - <signal name="text_entered"> + <signal name="text_submitted"> <argument index="0" name="new_text" type="String"> </argument> <description> @@ -359,16 +359,16 @@ </constant> </constants> <theme_items> - <theme_item name="caret_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="caret_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Color of the [LineEdit]'s caret (text cursor). </theme_item> <theme_item name="clear" type="Texture2D"> Texture for the clear button. See [member clear_button_enabled]. </theme_item> - <theme_item name="clear_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="clear_button_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Color used as default tint for the clear button. </theme_item> - <theme_item name="clear_button_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="clear_button_color_pressed" type="Color" default="Color(1, 1, 1, 1)"> Color used for the clear button when it's pressed. </theme_item> <theme_item name="focus" type="StyleBox"> @@ -377,19 +377,19 @@ <theme_item name="font" type="Font"> Font used for the text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default font color. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [LineEdit]. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0, 0, 0, 1)"> Font color for selected text (inside the selection rectangle). </theme_item> <theme_item name="font_size" type="int"> Font size of the [LineEdit]'s text. </theme_item> - <theme_item name="font_uneditable_color" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> + <theme_item name="font_uneditable_color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)"> Font color when editing is disabled. </theme_item> <theme_item name="minimum_character_width" type="int" default="4"> @@ -404,7 +404,7 @@ <theme_item name="read_only" type="StyleBox"> Background used when [LineEdit] is in read-only mode ([member editable] is set to [code]false[/code]). </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> + <theme_item name="selection_color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> Color of the selection rectangle. </theme_item> </theme_items> diff --git a/doc/classes/LineShape2D.xml b/doc/classes/LineShape2D.xml index 58caf1b1de..fed5773583 100644 --- a/doc/classes/LineShape2D.xml +++ b/doc/classes/LineShape2D.xml @@ -14,7 +14,7 @@ <member name="distance" type="float" setter="set_distance" getter="get_distance" default="0.0"> The line's distance from the origin. </member> - <member name="normal" type="Vector2" setter="set_normal" getter="get_normal" default="Vector2( 0, 1 )"> + <member name="normal" type="Vector2" setter="set_normal" getter="get_normal" default="Vector2(0, 1)"> The line's normal. </member> </members> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 6e2f4399b3..51b20cd04d 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -47,7 +47,7 @@ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]"> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> Set additional options for BiDi override. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> @@ -78,16 +78,16 @@ <theme_item name="font" type="Font"> [Font] of the [LinkButton]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [LinkButton]. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] used when the [LinkButton] is being hovered. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [LinkButton]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [LinkButton] is being pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 7cbf9d3dfe..3b37853d70 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -56,19 +56,19 @@ <theme_item name="font" type="Font"> [Font] of the [MenuButton]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [MenuButton]. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 1, 1, 1, 0.3 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(1, 1, 1, 0.3)"> Text [Color] used when the [MenuButton] is disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] used when the [MenuButton] is being hovered. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [MenuButton]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [MenuButton] is being pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index ed7c39d4d9..3bbdfbe62e 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -106,7 +106,7 @@ </method> </methods> <members> - <member name="lightmap_size_hint" type="Vector2i" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint" default="Vector2i( 0, 0 )"> + <member name="lightmap_size_hint" type="Vector2i" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint" default="Vector2i(0, 0)"> Sets a hint to be used for lightmap resolution. </member> </members> diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml index bcc9adf90f..57f2397874 100644 --- a/doc/classes/MeshTexture.xml +++ b/doc/classes/MeshTexture.xml @@ -14,7 +14,7 @@ <member name="base_texture" type="Texture2D" setter="set_base_texture" getter="get_base_texture"> Sets the base texture that the Mesh will use to draw. </member> - <member name="image_size" type="Vector2" setter="set_image_size" getter="get_image_size" default="Vector2( 0, 0 )"> + <member name="image_size" type="Vector2" setter="set_image_size" getter="get_image_size" default="Vector2(0, 0)"> Sets the size of the image, needed for reference. </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 02628f4960..7151e58c5f 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -105,7 +105,7 @@ </method> </methods> <members> - <member name="buffer" type="PackedFloat32Array" setter="set_buffer" getter="get_buffer" default="PackedFloat32Array( )"> + <member name="buffer" type="PackedFloat32Array" setter="set_buffer" getter="get_buffer" default="PackedFloat32Array()"> </member> <member name="color_array" type="PackedColorArray" setter="_set_color_array" getter="_get_color_array"> </member> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index d6de0ef4cf..5d59f994d3 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -53,7 +53,7 @@ <member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0"> The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. </member> - <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> + <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 1300351e47..a9c38e4d06 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -568,7 +568,7 @@ </return> <argument index="0" name="method" type="StringName"> </argument> - <argument index="1" name="args" type="Array" default="[ ]"> + <argument index="1" name="args" type="Array" default="[]"> </argument> <argument index="2" name="parent_first" type="bool" default="false"> </argument> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 8ca945418c..cc99abf9cb 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -131,7 +131,7 @@ <member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform"> Global [Transform2D]. </member> - <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> Position, relative to the node's parent. </member> <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> @@ -140,7 +140,7 @@ <member name="rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees" default="0.0"> Rotation in degrees, relative to the node's parent. </member> - <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )"> + <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale. Unscaled value: [code](1, 1)[/code]. </member> <member name="skew" type="float" setter="set_skew" getter="get_skew" default="0.0"> diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 1c161803db..2dc8659d5d 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -103,7 +103,7 @@ </return> <argument index="0" name="target" type="Vector3"> </argument> - <argument index="1" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> + <argument index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)"> </argument> <description> Rotates itself so that the local -Z axis points towards the [code]target[/code] position. @@ -118,7 +118,7 @@ </argument> <argument index="1" name="target" type="Vector3"> </argument> - <argument index="2" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> + <argument index="2" name="up" type="Vector3" default="Vector3(0, 1, 0)"> </argument> <description> Moves the node to the specified [code]position[/code], and then rotates itself to point toward the [code]target[/code] as per [method look_at]. Operations take place in global space. @@ -291,23 +291,23 @@ <member name="global_transform" type="Transform3D" setter="set_global_transform" getter="get_global_transform"> World3D space (global) [Transform3D] of this node. </member> - <member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3( 0, 0, 0 )"> + <member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)"> Local position or translation of this node relative to the parent. This is equivalent to [code]transform.origin[/code]. </member> <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation"> Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). [b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. </member> - <member name="rotation_degrees" type="Vector3" setter="set_rotation_degrees" getter="get_rotation_degrees" default="Vector3( 0, 0, 0 )"> + <member name="rotation_degrees" type="Vector3" setter="set_rotation_degrees" getter="get_rotation_degrees" default="Vector3(0, 0, 0)"> Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). </member> - <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3( 1, 1, 1 )"> + <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> Scale part of the local transformation. </member> <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false"> If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space. </member> - <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> Local space [Transform3D] of this node, with respect to the parent node. </member> <member name="visibility_parent" type="NodePath" setter="set_visibility_parent" getter="get_visibility_parent" default="NodePath("")"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index bfcd5b1beb..0789a7d231 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -94,7 +94,7 @@ </argument> <argument index="1" name="arguments" type="PackedStringArray"> </argument> - <argument index="2" name="output" type="Array" default="[ ]"> + <argument index="2" name="output" type="Array" default="[]"> </argument> <argument index="3" name="read_stderr" type="bool" default="false"> </argument> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index f5dcd6bcdc..cdf76a3a59 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -92,7 +92,7 @@ </return> <argument index="0" name="signal" type="String"> </argument> - <argument index="1" name="arguments" type="Array" default="[ ]"> + <argument index="1" name="arguments" type="Array" default="[]"> </argument> <description> Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. @@ -173,7 +173,7 @@ </argument> <argument index="1" name="callable" type="Callable"> </argument> - <argument index="2" name="binds" type="Array" default="[ ]"> + <argument index="2" name="binds" type="Array" default="[]"> </argument> <argument index="3" name="flags" type="int" default="0"> </argument> diff --git a/doc/classes/Occluder3D.xml b/doc/classes/Occluder3D.xml index fc676c2b49..501c4a3ccf 100644 --- a/doc/classes/Occluder3D.xml +++ b/doc/classes/Occluder3D.xml @@ -9,9 +9,9 @@ <methods> </methods> <members> - <member name="indices" type="PackedInt32Array" setter="set_indices" getter="get_indices" default="PackedInt32Array( )"> + <member name="indices" type="PackedInt32Array" setter="set_indices" getter="get_indices" default="PackedInt32Array()"> </member> - <member name="vertices" type="PackedVector3Array" setter="set_vertices" getter="get_vertices" default="PackedVector3Array( )"> + <member name="vertices" type="PackedVector3Array" setter="set_vertices" getter="get_vertices" default="PackedVector3Array()"> </member> </members> <constants> diff --git a/doc/classes/OccluderPolygon2D.xml b/doc/classes/OccluderPolygon2D.xml index 8a59ef5cb4..28d3ed433a 100644 --- a/doc/classes/OccluderPolygon2D.xml +++ b/doc/classes/OccluderPolygon2D.xml @@ -17,7 +17,7 @@ <member name="cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" enum="OccluderPolygon2D.CullMode" default="0"> The culling mode to use. </member> - <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( )"> + <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> A [Vector2] array with the index for polygon's vertices positions. [b]Note:[/b] The returned value is a copy of the underlying array, rather than a reference. </member> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 52da08c02f..4c03c59f8b 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -250,19 +250,19 @@ <theme_item name="font" type="Font"> [Font] of the [OptionButton]'s text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [OptionButton]. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Text [Color] used when the [OptionButton] is disabled. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] used when the [OptionButton] is being hovered. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [OptionButton]. </theme_item> - <theme_item name="font_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_pressed_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [OptionButton] is being pressed. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/PackedDataContainer.xml b/doc/classes/PackedDataContainer.xml index 296f9d3373..f72db514f0 100644 --- a/doc/classes/PackedDataContainer.xml +++ b/doc/classes/PackedDataContainer.xml @@ -23,7 +23,7 @@ </method> </methods> <members> - <member name="__data__" type="PackedByteArray" setter="_set_data" getter="_get_data" default="PackedByteArray( )"> + <member name="__data__" type="PackedByteArray" setter="_set_data" getter="_get_data" default="PackedByteArray()"> </member> </members> <constants> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 1d9be7f165..5887238a32 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -110,7 +110,7 @@ </method> </methods> <members> - <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PackedInt32Array( ),"editable_instances": [ ],"names": PackedStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PackedInt32Array( ),"variants": [ ],"version": 2}"> + <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PackedInt32Array(),"editable_instances": [],"names": PackedStringArray(),"node_count": 0,"node_paths": [],"nodes": PackedInt32Array(),"variants": [],"version": 2}"> A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. </member> diff --git a/doc/classes/ParallaxBackground.xml b/doc/classes/ParallaxBackground.xml index 3b730fc4d4..b8097343f4 100644 --- a/doc/classes/ParallaxBackground.xml +++ b/doc/classes/ParallaxBackground.xml @@ -12,22 +12,22 @@ </methods> <members> <member name="layer" type="int" setter="set_layer" getter="get_layer" override="true" default="-100" /> - <member name="scroll_base_offset" type="Vector2" setter="set_scroll_base_offset" getter="get_scroll_base_offset" default="Vector2( 0, 0 )"> + <member name="scroll_base_offset" type="Vector2" setter="set_scroll_base_offset" getter="get_scroll_base_offset" default="Vector2(0, 0)"> The base position offset for all [ParallaxLayer] children. </member> - <member name="scroll_base_scale" type="Vector2" setter="set_scroll_base_scale" getter="get_scroll_base_scale" default="Vector2( 1, 1 )"> + <member name="scroll_base_scale" type="Vector2" setter="set_scroll_base_scale" getter="get_scroll_base_scale" default="Vector2(1, 1)"> The base motion scale for all [ParallaxLayer] children. </member> <member name="scroll_ignore_camera_zoom" type="bool" setter="set_ignore_camera_zoom" getter="is_ignore_camera_zoom" default="false"> If [code]true[/code], elements in [ParallaxLayer] child aren't affected by the zoom level of the camera. </member> - <member name="scroll_limit_begin" type="Vector2" setter="set_limit_begin" getter="get_limit_begin" default="Vector2( 0, 0 )"> + <member name="scroll_limit_begin" type="Vector2" setter="set_limit_begin" getter="get_limit_begin" default="Vector2(0, 0)"> Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work. </member> - <member name="scroll_limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end" default="Vector2( 0, 0 )"> + <member name="scroll_limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end" default="Vector2(0, 0)"> Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work. </member> - <member name="scroll_offset" type="Vector2" setter="set_scroll_offset" getter="get_scroll_offset" default="Vector2( 0, 0 )"> + <member name="scroll_offset" type="Vector2" setter="set_scroll_offset" getter="get_scroll_offset" default="Vector2(0, 0)"> The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present. </member> </members> diff --git a/doc/classes/ParallaxLayer.xml b/doc/classes/ParallaxLayer.xml index 7210bee11c..6b1e013851 100644 --- a/doc/classes/ParallaxLayer.xml +++ b/doc/classes/ParallaxLayer.xml @@ -13,13 +13,13 @@ <methods> </methods> <members> - <member name="motion_mirroring" type="Vector2" setter="set_mirroring" getter="get_mirroring" default="Vector2( 0, 0 )"> + <member name="motion_mirroring" type="Vector2" setter="set_mirroring" getter="get_mirroring" default="Vector2(0, 0)"> The ParallaxLayer's [Texture2D] mirroring. Useful for creating an infinite scrolling background. If an axis is set to [code]0[/code], the [Texture2D] will not be mirrored. </member> - <member name="motion_offset" type="Vector2" setter="set_motion_offset" getter="get_motion_offset" default="Vector2( 0, 0 )"> + <member name="motion_offset" type="Vector2" setter="set_motion_offset" getter="get_motion_offset" default="Vector2(0, 0)"> The ParallaxLayer's offset relative to the parent ParallaxBackground's [member ParallaxBackground.scroll_offset]. </member> - <member name="motion_scale" type="Vector2" setter="set_motion_scale" getter="get_motion_scale" default="Vector2( 1, 1 )"> + <member name="motion_scale" type="Vector2" setter="set_motion_scale" getter="get_motion_scale" default="Vector2(1, 1)"> Multiplies the ParallaxLayer's motion. If an axis is set to [code]0[/code], it will not scroll. </member> </members> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 3c364b621a..e8fde21032 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -141,7 +141,7 @@ </member> <member name="collision_use_scale" type="bool" setter="set_collision_use_scale" getter="is_collision_using_scale" default="false"> </member> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code]. </member> <member name="color_ramp" type="Texture2D" setter="set_color_ramp" getter="get_color_ramp"> @@ -156,7 +156,7 @@ <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Damping randomness ratio. </member> - <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3( 1, 0, 0 )"> + <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3(1, 0, 0)"> Unit vector specifying the particles' emission direction. </member> <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents"> @@ -183,7 +183,7 @@ <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0"> Amount of [member spread] along the Y axis. </member> - <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3( 0, -9.8, 0 )"> + <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -9.8, 0)"> Gravity applied to every particle. </member> <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 9e9c5063ae..ff73844803 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -20,7 +20,7 @@ </argument> <argument index="1" name="callable" type="Callable"> </argument> - <argument index="2" name="arguments" type="Array" default="[ ]"> + <argument index="2" name="arguments" type="Array" default="[]"> </argument> <description> Adds a custom monitor with name same as id. You can specify the category of monitor using '/' in id. If there are more than one '/' then default category is used. Default category is "Custom". diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index 5d15590a3f..736b44ee1c 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -20,7 +20,7 @@ </return> <argument index="0" name="impulse" type="Vector3"> </argument> - <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> </description> @@ -48,7 +48,7 @@ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0"> Damps the body's rotation if greater than [code]0[/code]. </member> - <member name="body_offset" type="Transform3D" setter="set_body_offset" getter="get_body_offset" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="body_offset" type="Transform3D" setter="set_body_offset" getter="get_body_offset" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> Sets the body's transform. </member> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0"> @@ -63,13 +63,13 @@ <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" default="1.0"> This is multiplied by the global 3D gravity setting found in [b]Project > Project Settings > Physics > 3d[/b] to produce the body's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. </member> - <member name="joint_offset" type="Transform3D" setter="set_joint_offset" getter="get_joint_offset" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="joint_offset" type="Transform3D" setter="set_joint_offset" getter="get_joint_offset" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> Sets the joint's transform. </member> <member name="joint_rotation" type="Vector3" setter="set_joint_rotation" getter="get_joint_rotation"> Sets the joint's rotation in radians. </member> - <member name="joint_rotation_degrees" type="Vector3" setter="set_joint_rotation_degrees" getter="get_joint_rotation_degrees" default="Vector3( 0, 0, 0 )"> + <member name="joint_rotation_degrees" type="Vector3" setter="set_joint_rotation_degrees" getter="get_joint_rotation_degrees" default="Vector3(0, 0, 0)"> Sets the joint's rotation in degrees. </member> <member name="joint_type" type="int" setter="set_joint_type" getter="get_joint_type" enum="PhysicalBone3D.JointType" default="0"> diff --git a/doc/classes/PhysicalSkyMaterial.xml b/doc/classes/PhysicalSkyMaterial.xml index 381371b973..20ab998d35 100644 --- a/doc/classes/PhysicalSkyMaterial.xml +++ b/doc/classes/PhysicalSkyMaterial.xml @@ -19,13 +19,13 @@ <member name="exposure" type="float" setter="set_exposure" getter="get_exposure" default="0.1"> Sets the exposure of the sky. Higher exposure values make the entire sky brighter. </member> - <member name="ground_color" type="Color" setter="set_ground_color" getter="get_ground_color" default="Color( 1, 1, 1, 1 )"> + <member name="ground_color" type="Color" setter="set_ground_color" getter="get_ground_color" default="Color(1, 1, 1, 1)"> Modulates the [Color] on the bottom half of the sky to represent the ground. </member> <member name="mie_coefficient" type="float" setter="set_mie_coefficient" getter="get_mie_coefficient" default="0.005"> Controls the strength of mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, mie scattering results in a whitish color around the sun and horizon. </member> - <member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color( 0.36, 0.56, 0.82, 1 )"> + <member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color(0.36, 0.56, 0.82, 1)"> Controls the [Color] of the mie scattering effect. While not physically accurate, this allows for the creation of alien looking planets. </member> <member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8"> @@ -37,7 +37,7 @@ <member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0"> Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. </member> - <member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color( 0.056, 0.14, 0.3, 1 )"> + <member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color(0.056, 0.14, 0.3, 1)"> Controls the [Color] of the Rayleigh scattering. While not physically accurate, this allows for the creation of alien looking planets. For example, setting this to a red [Color] results in a Mars looking atmosphere with a corresponding blue sunset. </member> <member name="sun_disk_scale" type="float" setter="set_sun_disk_scale" getter="get_sun_disk_scale" default="1.0"> diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index 66ff16a3ce..65cb3e7f38 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -24,7 +24,7 @@ </return> <argument index="0" name="force" type="Vector2"> </argument> - <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. @@ -53,7 +53,7 @@ </return> <argument index="0" name="impulse" type="Vector2"> </argument> - <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml index 7cb3a56338..85feeef86e 100644 --- a/doc/classes/PhysicsDirectBodyState3D.xml +++ b/doc/classes/PhysicsDirectBodyState3D.xml @@ -12,7 +12,7 @@ <method name="add_central_force"> <return type="void"> </return> - <argument index="0" name="force" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="0" name="force" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Adds a constant directional force without affecting rotation. @@ -24,7 +24,7 @@ </return> <argument index="0" name="force" type="Vector3"> </argument> - <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. @@ -42,7 +42,7 @@ <method name="apply_central_impulse"> <return type="void"> </return> - <argument index="0" name="impulse" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="0" name="impulse" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Applies a single directional impulse without affecting rotation. @@ -54,7 +54,7 @@ </return> <argument index="0" name="impulse" type="Vector3"> </argument> - <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml index b6f95305ed..6c8c957e5d 100644 --- a/doc/classes/PhysicsDirectSpaceState2D.xml +++ b/doc/classes/PhysicsDirectSpaceState2D.xml @@ -56,7 +56,7 @@ </argument> <argument index="1" name="max_results" type="int" default="32"> </argument> - <argument index="2" name="exclude" type="Array" default="[ ]"> + <argument index="2" name="exclude" type="Array" default="[]"> </argument> <argument index="3" name="collision_layer" type="int" default="2147483647"> </argument> @@ -84,7 +84,7 @@ </argument> <argument index="2" name="max_results" type="int" default="32"> </argument> - <argument index="3" name="exclude" type="Array" default="[ ]"> + <argument index="3" name="exclude" type="Array" default="[]"> </argument> <argument index="4" name="collision_layer" type="int" default="2147483647"> </argument> @@ -102,7 +102,7 @@ </argument> <argument index="1" name="to" type="Vector2"> </argument> - <argument index="2" name="exclude" type="Array" default="[ ]"> + <argument index="2" name="exclude" type="Array" default="[]"> </argument> <argument index="3" name="collision_layer" type="int" default="2147483647"> </argument> diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml index 243d071c56..a69b6f07fd 100644 --- a/doc/classes/PhysicsDirectSpaceState3D.xml +++ b/doc/classes/PhysicsDirectSpaceState3D.xml @@ -57,7 +57,7 @@ </argument> <argument index="1" name="to" type="Vector3"> </argument> - <argument index="2" name="exclude" type="Array" default="[ ]"> + <argument index="2" name="exclude" type="Array" default="[]"> </argument> <argument index="3" name="collision_mask" type="int" default="2147483647"> </argument> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 4c2abcb087..33cd61eb9c 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -16,7 +16,7 @@ </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)"> </argument> <argument index="3" name="disabled" type="bool" default="false"> </argument> @@ -333,7 +333,7 @@ </argument> <argument index="1" name="force" type="Vector2"> </argument> - <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied. @@ -346,7 +346,7 @@ </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)"> </argument> <argument index="3" name="disabled" type="bool" default="false"> </argument> @@ -381,7 +381,7 @@ </argument> <argument index="1" name="impulse" type="Vector2"> </argument> - <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 2972d5155c..aa1f7597ea 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -16,7 +16,7 @@ </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform3D" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <argument index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> </argument> <argument index="3" name="disabled" type="bool" default="false"> </argument> @@ -325,7 +325,7 @@ </argument> <argument index="1" name="force" type="Vector3"> </argument> - <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> </description> @@ -337,7 +337,7 @@ </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform3D" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <argument index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> </argument> <argument index="3" name="disabled" type="bool" default="false"> </argument> @@ -372,7 +372,7 @@ </argument> <argument index="1" name="impulse" type="Vector3"> </argument> - <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Gives the body a push at a [code]position[/code] in the direction of the [code]impulse[/code]. diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml index 92bd9b136a..321a713e26 100644 --- a/doc/classes/PhysicsShapeQueryParameters2D.xml +++ b/doc/classes/PhysicsShapeQueryParameters2D.xml @@ -20,13 +20,13 @@ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="2147483647"> The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]"> + <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]"> The list of objects or object [RID]s that will be excluded from collisions. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The collision margin for the shape. </member> - <member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2( 0, 0 )"> + <member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2(0, 0)"> The motion of the shape being queried for. </member> <member name="shape" type="Resource" setter="set_shape" getter="get_shape"> @@ -63,7 +63,7 @@ [/csharp] [/codeblocks] </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> The queried shape's transform matrix. </member> </members> diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml index 087c52a650..52916a8418 100644 --- a/doc/classes/PhysicsShapeQueryParameters3D.xml +++ b/doc/classes/PhysicsShapeQueryParameters3D.xml @@ -20,7 +20,7 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647"> The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]"> + <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]"> The list of objects or object [RID]s that will be excluded from collisions. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> @@ -60,7 +60,7 @@ [/csharp] [/codeblocks] </member> - <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> The queried shape's transform matrix. </member> </members> diff --git a/doc/classes/PhysicsTestMotionResult2D.xml b/doc/classes/PhysicsTestMotionResult2D.xml index 2744aa17a1..da04ffa86a 100644 --- a/doc/classes/PhysicsTestMotionResult2D.xml +++ b/doc/classes/PhysicsTestMotionResult2D.xml @@ -17,15 +17,15 @@ </member> <member name="collider_shape" type="int" setter="" getter="get_collider_shape" default="0"> </member> - <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2( 0, 0 )"> + <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2(0, 0)"> </member> - <member name="collision_normal" type="Vector2" setter="" getter="get_collision_normal" default="Vector2( 0, 0 )"> + <member name="collision_normal" type="Vector2" setter="" getter="get_collision_normal" default="Vector2(0, 0)"> </member> - <member name="collision_point" type="Vector2" setter="" getter="get_collision_point" default="Vector2( 0, 0 )"> + <member name="collision_point" type="Vector2" setter="" getter="get_collision_point" default="Vector2(0, 0)"> </member> - <member name="motion" type="Vector2" setter="" getter="get_motion" default="Vector2( 0, 0 )"> + <member name="motion" type="Vector2" setter="" getter="get_motion" default="Vector2(0, 0)"> </member> - <member name="motion_remainder" type="Vector2" setter="" getter="get_motion_remainder" default="Vector2( 0, 0 )"> + <member name="motion_remainder" type="Vector2" setter="" getter="get_motion_remainder" default="Vector2(0, 0)"> </member> </members> <constants> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 2342f00631..cca5793fc7 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -204,7 +204,7 @@ The distance from the origin to the plane, in the direction of [member normal]. This value is typically non-negative. In the scalar equation of the plane [code]ax + by + cz = d[/code], this is [code]d[/code], while the [code](a, b, c)[/code] coordinates are represented by the [member normal] property. </member> - <member name="normal" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> + <member name="normal" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> The normal of the plane, which must be normalized. In the scalar equation of the plane [code]ax + by + cz = d[/code], this is the vector [code](a, b, c)[/code], where [code]d[/code] is the [member d] property. </member> @@ -219,13 +219,13 @@ </member> </members> <constants> - <constant name="PLANE_YZ" value="Plane( 1, 0, 0, 0 )"> + <constant name="PLANE_YZ" value="Plane(1, 0, 0, 0)"> A plane that extends in the Y and Z axes (normal vector points +X). </constant> - <constant name="PLANE_XZ" value="Plane( 0, 1, 0, 0 )"> + <constant name="PLANE_XZ" value="Plane(0, 1, 0, 0)"> A plane that extends in the X and Z axes (normal vector points +Y). </constant> - <constant name="PLANE_XY" value="Plane( 0, 0, 1, 0 )"> + <constant name="PLANE_XY" value="Plane(0, 0, 1, 0)"> A plane that extends in the X and Y axes (normal vector points +Z). </constant> </constants> diff --git a/doc/classes/PlaneMesh.xml b/doc/classes/PlaneMesh.xml index 333d687e91..c95ba29ea2 100644 --- a/doc/classes/PlaneMesh.xml +++ b/doc/classes/PlaneMesh.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 2, 2 )"> + <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(2, 2)"> Size of the generated plane. </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0"> diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml index 9337bc8351..a7207a3c80 100644 --- a/doc/classes/PointLight2D.xml +++ b/doc/classes/PointLight2D.xml @@ -12,7 +12,7 @@ <member name="height" type="float" setter="set_height" getter="get_height" default="0.0"> The height of the light. Used with 2D normal mapping. </member> - <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2(0, 0)"> The offset of the light's [member texture]. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 3aca83658d..c33a1424a7 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -88,9 +88,9 @@ <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false"> If [code]true[/code], polygon edges will be anti-aliased. </member> - <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[ ]"> + <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]"> </member> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code]. </member> <member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0"> @@ -101,21 +101,21 @@ <member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false"> If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code]. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The offset applied to each vertex. </member> - <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( )"> + <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> The polygon's list of vertices. The final point will be connected to the first. [b]Note:[/b] This returns a copy of the [PackedVector2Array] rather than a reference. </member> - <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[ ]"> + <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[]"> </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. </member> - <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> + <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2(0, 0)"> Amount to offset the polygon's [code]texture[/code]. If [code](0, 0)[/code] the texture's origin (its top-left corner) will be placed at the polygon's [code]position[/code]. </member> <member name="texture_rotation" type="float" setter="set_texture_rotation" getter="get_texture_rotation"> @@ -124,13 +124,13 @@ <member name="texture_rotation_degrees" type="float" setter="set_texture_rotation_degrees" getter="get_texture_rotation_degrees" default="0.0"> The texture's rotation in degrees. </member> - <member name="texture_scale" type="Vector2" setter="set_texture_scale" getter="get_texture_scale" default="Vector2( 1, 1 )"> + <member name="texture_scale" type="Vector2" setter="set_texture_scale" getter="get_texture_scale" default="Vector2(1, 1)"> Amount to multiply the [code]uv[/code] coordinates when using a [code]texture[/code]. Larger values make the texture smaller, and vice versa. </member> - <member name="uv" type="PackedVector2Array" setter="set_uv" getter="get_uv" default="PackedVector2Array( )"> + <member name="uv" type="PackedVector2Array" setter="set_uv" getter="get_uv" default="PackedVector2Array()"> Texture coordinates for each vertex of the polygon. There should be one [code]uv[/code] per polygon vertex. If there are fewer, undefined vertices will use [code](0, 0)[/code]. </member> - <member name="vertex_colors" type="PackedColorArray" setter="set_vertex_colors" getter="get_vertex_colors" default="PackedColorArray( )"> + <member name="vertex_colors" type="PackedColorArray" setter="set_vertex_colors" getter="get_vertex_colors" default="PackedColorArray()"> Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use [code]color[/code]. </member> </members> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 418785222e..e448d18d73 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -717,22 +717,22 @@ <theme_item name="font" type="Font"> [Font] used for the menu items. </theme_item> - <theme_item name="font_accelerator_color" type="Color" default="Color( 0.7, 0.7, 0.7, 0.8 )"> + <theme_item name="font_accelerator_color" type="Color" default="Color(0.7, 0.7, 0.7, 0.8)"> The text [Color] used for shortcuts and accelerators that show next to the menu item name when defined. See [method get_item_accelerator] for more info on accelerators. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> The default text [Color] for menu items' names. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.4, 0.4, 0.4, 0.8 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.4, 0.4, 0.4, 0.8)"> [Color] used for disabled menu items' text. </theme_item> - <theme_item name="font_hover_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_hover_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> [Color] used for the hovered text. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the menu item. </theme_item> - <theme_item name="font_separator_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_separator_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> [Color] used for labeled separators' text. See [method add_separator]. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 3892633654..ca41c367c8 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -30,7 +30,7 @@ </method> </methods> <members> - <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )"> + <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. </member> <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false"> diff --git a/doc/classes/PrismMesh.xml b/doc/classes/PrismMesh.xml index b2e1fdd3f0..0e66281fd1 100644 --- a/doc/classes/PrismMesh.xml +++ b/doc/classes/PrismMesh.xml @@ -14,7 +14,7 @@ <member name="left_to_right" type="float" setter="set_left_to_right" getter="get_left_to_right" default="0.5"> Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. </member> - <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3( 2, 2, 2 )"> + <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(2, 2, 2)"> Size of the prism. </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0"> diff --git a/doc/classes/ProceduralSkyMaterial.xml b/doc/classes/ProceduralSkyMaterial.xml index d3e1dbca27..c598a2c266 100644 --- a/doc/classes/ProceduralSkyMaterial.xml +++ b/doc/classes/ProceduralSkyMaterial.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color( 0.12, 0.12, 0.13, 1 )"> + <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color(0.12, 0.12, 0.13, 1)"> Color of the ground at the bottom. Blends with [member ground_horizon_color]. </member> <member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve" default="0.02"> @@ -22,7 +22,7 @@ <member name="ground_energy" type="float" setter="set_ground_energy" getter="get_ground_energy" default="1.0"> Amount of energy contribution from the ground. </member> - <member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" default="Color( 0.37, 0.33, 0.31, 1 )"> + <member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" default="Color(0.37, 0.33, 0.31, 1)"> Color of the ground at the horizon. Blends with [member ground_bottom_color]. </member> <member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve" default="0.09"> @@ -31,10 +31,10 @@ <member name="sky_energy" type="float" setter="set_sky_energy" getter="get_sky_energy" default="1.0"> Amount of energy contribution from the sky. </member> - <member name="sky_horizon_color" type="Color" setter="set_sky_horizon_color" getter="get_sky_horizon_color" default="Color( 0.55, 0.69, 0.81, 1 )"> + <member name="sky_horizon_color" type="Color" setter="set_sky_horizon_color" getter="get_sky_horizon_color" default="Color(0.55, 0.69, 0.81, 1)"> Color of the sky at the horizon. Blends with [member sky_top_color]. </member> - <member name="sky_top_color" type="Color" setter="set_sky_top_color" getter="get_sky_top_color" default="Color( 0.35, 0.46, 0.71, 1 )"> + <member name="sky_top_color" type="Color" setter="set_sky_top_color" getter="get_sky_top_color" default="Color(0.35, 0.46, 0.71, 1)"> Color of the sky at the top. Blends with [member sky_horizon_color]. </member> <member name="sun_angle_max" type="float" setter="set_sun_angle_max" getter="get_sun_angle_max" default="100.0"> diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index 160b61c720..c33f6f636d 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -29,13 +29,13 @@ <theme_item name="font" type="Font"> Font used to draw the fill percentage if [member percent_visible] is [code]true[/code]. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> The color of the text. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [ProgressBar]. </theme_item> - <theme_item name="font_shadow_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="font_shadow_color" type="Color" default="Color(0, 0, 0, 1)"> The color of the text's shadow. </theme_item> <theme_item name="font_size" type="int"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 757f0691bf..04d1af3f6a 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -226,7 +226,7 @@ </method> </methods> <members> - <member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color( 0.14, 0.14, 0.14, 1 )"> + <member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color(0.14, 0.14, 0.14, 1)"> Background color for the boot splash. </member> <member name="application/boot_splash/fullsize" type="bool" setter="" getter="" default="true"> @@ -461,7 +461,7 @@ <member name="debug/settings/visual_script/max_call_stack" type="int" setter="" getter="" default="1024"> Maximum call stack in visual scripting, to avoid infinite recursion. </member> - <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color( 1, 0.2, 0.1, 0.8 )"> + <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color(1, 0.2, 0.1, 0.8)"> Color of the contact points between collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/collision/draw_2d_outlines" type="bool" setter="" getter="" default="true"> @@ -470,22 +470,22 @@ <member name="debug/shapes/collision/max_contacts_displayed" type="int" setter="" getter="" default="10000"> Maximum number of contact points between collision shapes to display when "Visible Collision Shapes" is enabled in the Debug menu. </member> - <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color( 0, 0.6, 0.7, 0.42 )"> + <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color(0, 0.6, 0.7, 0.42)"> Color of the collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> - <member name="debug/shapes/navigation/disabled_geometry_color" type="Color" setter="" getter="" default="Color( 1, 0.7, 0.1, 0.4 )"> + <member name="debug/shapes/navigation/disabled_geometry_color" type="Color" setter="" getter="" default="Color(1, 0.7, 0.1, 0.4)"> Color of the disabled navigation geometry, visible when "Visible Navigation" is enabled in the Debug menu. </member> - <member name="debug/shapes/navigation/geometry_color" type="Color" setter="" getter="" default="Color( 0.1, 1, 0.7, 0.4 )"> + <member name="debug/shapes/navigation/geometry_color" type="Color" setter="" getter="" default="Color(0.1, 1, 0.7, 0.4)"> Color of the navigation geometry, visible when "Visible Navigation" is enabled in the Debug menu. </member> <member name="display/mouse_cursor/custom_image" type="String" setter="" getter="" default=""""> Custom image for the mouse cursor (limited to 256×256). </member> - <member name="display/mouse_cursor/custom_image_hotspot" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> + <member name="display/mouse_cursor/custom_image_hotspot" type="Vector2" setter="" getter="" default="Vector2(0, 0)"> Hotspot for the custom mouse cursor image. </member> - <member name="display/mouse_cursor/tooltip_position_offset" type="Vector2" setter="" getter="" default="Vector2( 10, 10 )"> + <member name="display/mouse_cursor/tooltip_position_offset" type="Vector2" setter="" getter="" default="Vector2(10, 10)"> Position offset for tooltips, relative to the mouse cursor's hotspot. </member> <member name="display/window/dpi/allow_hidpi" type="bool" setter="" getter="" default="false"> @@ -551,7 +551,7 @@ prime-run %command% [/codeblock] </member> - <member name="editor/script/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( "gd", "gdshader" )"> + <member name="editor/script/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray("gd", "gdshader")"> Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files. </member> <member name="editor/script/templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> @@ -739,6 +739,8 @@ If no selection is currently active, selects the word currently under the caret in text fields. If a selection is currently active, deselects the current selection. [b]Note:[/b] Currently, this is only implemented in [TextEdit], not [LineEdit]. </member> + <member name="input/ui_text_submit" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_text_toggle_insert_mode" type="Dictionary" setter="" getter=""> </member> <member name="input/ui_undo" type="Dictionary" setter="" getter=""> @@ -1220,7 +1222,7 @@ [/csharp] [/codeblocks] </member> - <member name="physics/2d/default_gravity_vector" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )"> + <member name="physics/2d/default_gravity_vector" type="Vector2" setter="" getter="" default="Vector2(0, 1)"> The default gravity direction in 2D. [b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample: [codeblocks] @@ -1272,7 +1274,7 @@ [/csharp] [/codeblocks] </member> - <member name="physics/3d/default_gravity_vector" type="Vector3" setter="" getter="" default="Vector3( 0, -1, 0 )"> + <member name="physics/3d/default_gravity_vector" type="Vector3" setter="" getter="" default="Vector3(0, -1, 0)"> The default gravity direction in 3D. [b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample: [codeblocks] @@ -1364,7 +1366,7 @@ <member name="rendering/driver/threads/thread_model" type="int" setter="" getter="" default="1"> Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. </member> - <member name="rendering/environment/defaults/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )"> + <member name="rendering/environment/defaults/default_clear_color" type="Color" setter="" getter="" default="Color(0.3, 0.3, 0.3, 1)"> Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color]. </member> <member name="rendering/environment/defaults/default_environment" type="String" setter="" getter="" default=""""> diff --git a/doc/classes/ProximityGroup3D.xml b/doc/classes/ProximityGroup3D.xml index 512d55c9a0..22e397b832 100644 --- a/doc/classes/ProximityGroup3D.xml +++ b/doc/classes/ProximityGroup3D.xml @@ -23,7 +23,7 @@ <members> <member name="dispatch_mode" type="int" setter="set_dispatch_mode" getter="get_dispatch_mode" enum="ProximityGroup3D.DispatchMode" default="0"> </member> - <member name="grid_radius" type="Vector3" setter="set_grid_radius" getter="get_grid_radius" default="Vector3( 1, 1, 1 )"> + <member name="grid_radius" type="Vector3" setter="set_grid_radius" getter="get_grid_radius" default="Vector3(1, 1, 1)"> </member> <member name="group_name" type="String" setter="set_group_name" getter="get_group_name" default=""""> </member> diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml index 24a3d76ee2..94d638888c 100644 --- a/doc/classes/QuadMesh.xml +++ b/doc/classes/QuadMesh.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 1, 1 )"> + <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(1, 1)"> Size on the X and Y axes. </member> </members> diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index 678fb0d44d..660204ee7d 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -83,6 +83,16 @@ Constructs a quaternion defined by the given values. </description> </method> + <method name="angle_to" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="to" type="Quaternion"> + </argument> + <description> + Returns the angle between this quaternion and [code]to[/code]. This is the magnitude of the angle you would need to rotate by to get from one to the other. + [b]Note:[/b] This method has an abnormally high amount of floating-point error, so methods such as [code]is_zero_approx[/code] will not work reliably. + </description> + </method> <method name="cubic_slerp" qualifiers="const"> <return type="Quaternion"> </return> @@ -301,7 +311,7 @@ </member> </members> <constants> - <constant name="IDENTITY" value="Quaternion( 0, 0, 0, 1 )"> + <constant name="IDENTITY" value="Quaternion(0, 0, 0, 1)"> The identity quaternion, representing no rotation. Equivalent to an identity [Basis] matrix. If a vector is transformed by an identity quaternion, it will not change. </constant> </constants> diff --git a/doc/classes/RDPipelineColorBlendState.xml b/doc/classes/RDPipelineColorBlendState.xml index 1424a0d653..b672a053c7 100644 --- a/doc/classes/RDPipelineColorBlendState.xml +++ b/doc/classes/RDPipelineColorBlendState.xml @@ -9,9 +9,9 @@ <methods> </methods> <members> - <member name="attachments" type="RDPipelineColorBlendStateAttachment[]" setter="set_attachments" getter="get_attachments" default="[ ]"> + <member name="attachments" type="RDPipelineColorBlendStateAttachment[]" setter="set_attachments" getter="get_attachments" default="[]"> </member> - <member name="blend_constant" type="Color" setter="set_blend_constant" getter="get_blend_constant" default="Color( 0, 0, 0, 1 )"> + <member name="blend_constant" type="Color" setter="set_blend_constant" getter="get_blend_constant" default="Color(0, 0, 0, 1)"> </member> <member name="enable_logic_op" type="bool" setter="set_enable_logic_op" getter="get_enable_logic_op" default="false"> </member> diff --git a/doc/classes/RDPipelineMultisampleState.xml b/doc/classes/RDPipelineMultisampleState.xml index 8c90f02301..b4345f1f8b 100644 --- a/doc/classes/RDPipelineMultisampleState.xml +++ b/doc/classes/RDPipelineMultisampleState.xml @@ -19,7 +19,7 @@ </member> <member name="sample_count" type="int" setter="set_sample_count" getter="get_sample_count" enum="RenderingDevice.TextureSamples" default="0"> </member> - <member name="sample_masks" type="int[]" setter="set_sample_masks" getter="get_sample_masks" default="[ ]"> + <member name="sample_masks" type="int[]" setter="set_sample_masks" getter="get_sample_masks" default="[]"> </member> </members> <constants> diff --git a/doc/classes/RDShaderBytecode.xml b/doc/classes/RDShaderBytecode.xml index 7a3501004e..20bf9bdd72 100644 --- a/doc/classes/RDShaderBytecode.xml +++ b/doc/classes/RDShaderBytecode.xml @@ -45,15 +45,15 @@ </method> </methods> <members> - <member name="bytecode_compute" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray( )"> + <member name="bytecode_compute" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray()"> </member> - <member name="bytecode_fragment" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray( )"> + <member name="bytecode_fragment" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray()"> </member> - <member name="bytecode_tesselation_control" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray( )"> + <member name="bytecode_tesselation_control" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray()"> </member> - <member name="bytecode_tesselation_evaluation" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray( )"> + <member name="bytecode_tesselation_evaluation" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray()"> </member> - <member name="bytecode_vertex" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray( )"> + <member name="bytecode_vertex" type="PackedByteArray" setter="set_stage_bytecode" getter="get_stage_bytecode" default="PackedByteArray()"> </member> <member name="compile_error_compute" type="String" setter="set_stage_compile_error" getter="get_stage_compile_error" default=""""> </member> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index e30d7df63f..14b67b46df 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -138,7 +138,7 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], the parent node will be excluded from collision detection. </member> - <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2( 0, 50 )"> + <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 50)"> The ray's destination point, relative to the RayCast's [code]position[/code]. </member> </members> diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml index 443890438f..98c8c96403 100644 --- a/doc/classes/RayCast3D.xml +++ b/doc/classes/RayCast3D.xml @@ -136,7 +136,7 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="debug_shape_custom_color" type="Color" setter="set_debug_shape_custom_color" getter="get_debug_shape_custom_color" default="Color( 0, 0, 0, 1 )"> + <member name="debug_shape_custom_color" type="Color" setter="set_debug_shape_custom_color" getter="get_debug_shape_custom_color" default="Color(0, 0, 0, 1)"> The custom color to use to draw the shape in the editor and at run-time if [b]Visible Collision Shapes[/b] is enabled in the [b]Debug[/b] menu. This color will be highlighted at run-time if the [RayCast3D] is colliding with something. If set to [code]Color(0.0, 0.0, 0.0)[/code] (by default), the color set in [member ProjectSettings.debug/shapes/collision/shape_color] is used. </member> @@ -149,7 +149,7 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent. </member> - <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3( 0, -1, 0 )"> + <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, -1, 0)"> The ray's destination point, relative to the RayCast's [code]position[/code]. </member> </members> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 352a18e326..627c488b01 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -214,13 +214,13 @@ </method> </methods> <members> - <member name="end" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> + <member name="end" type="Vector2" setter="" getter="" default="Vector2(0, 0)"> Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size. </member> - <member name="position" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> + <member name="position" type="Vector2" setter="" getter="" default="Vector2(0, 0)"> Beginning corner. Typically has values lower than [member end]. </member> - <member name="size" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> + <member name="size" type="Vector2" setter="" getter="" default="Vector2(0, 0)"> Size from [member position] to [member end]. Typically, all components are positive. If the size is negative, you can use [method abs] to fix it. </member> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 84bef9b406..67d148084f 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -193,13 +193,13 @@ </method> </methods> <members> - <member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + <member name="end" type="Vector2i" setter="" getter="" default="Vector2i(0, 0)"> Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size. </member> - <member name="position" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + <member name="position" type="Vector2i" setter="" getter="" default="Vector2i(0, 0)"> Beginning corner. Typically has values lower than [member end]. </member> - <member name="size" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + <member name="size" type="Vector2i" setter="" getter="" default="Vector2i(0, 0)"> Size from [member position] to [member end]. Typically, all components are positive. If the size is negative, you can use [method abs] to fix it. </member> diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml index 8e37fbad6f..f2795ae4a1 100644 --- a/doc/classes/RectangleShape2D.xml +++ b/doc/classes/RectangleShape2D.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 20, 20 )"> + <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(20, 20)"> The rectangle's width and height. </member> </members> diff --git a/doc/classes/ReferenceRect.xml b/doc/classes/ReferenceRect.xml index 1a3fbbdfc5..df9a6f0a46 100644 --- a/doc/classes/ReferenceRect.xml +++ b/doc/classes/ReferenceRect.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color( 1, 0, 0, 1 )"> + <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color(1, 0, 0, 1)"> Sets the border [Color] of the [ReferenceRect]. </member> <member name="border_width" type="float" setter="set_border_width" getter="get_border_width" default="1.0"> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 13df17cd22..1d32a8b509 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -13,7 +13,7 @@ <methods> </methods> <members> - <member name="ambient_color" type="Color" setter="set_ambient_color" getter="get_ambient_color" default="Color( 0, 0, 0, 1 )"> + <member name="ambient_color" type="Color" setter="set_ambient_color" getter="get_ambient_color" default="Color(0, 0, 0, 1)"> </member> <member name="ambient_color_energy" type="float" setter="set_ambient_color_energy" getter="get_ambient_color_energy" default="1.0"> </member> @@ -28,7 +28,7 @@ <member name="enable_shadows" type="bool" setter="set_enable_shadows" getter="are_shadows_enabled" default="false"> If [code]true[/code], computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [constant UPDATE_ALWAYS] [member update_mode]. </member> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them. </member> <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0"> @@ -42,7 +42,7 @@ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0"> Sets the max distance away from the probe an object can be before it is culled. </member> - <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3( 0, 0, 0 )"> + <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3(0, 0, 0)"> Sets the origin offset to be used when this reflection probe is in box project mode. </member> <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="ReflectionProbe.UpdateMode" default="0"> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 841d2bde72..dc56e6fd5d 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -196,15 +196,15 @@ </argument> <argument index="4" name="final_depth_action" type="int" enum="RenderingDevice.FinalAction"> </argument> - <argument index="5" name="clear_color_values" type="PackedColorArray" default="PackedColorArray( )"> + <argument index="5" name="clear_color_values" type="PackedColorArray" default="PackedColorArray()"> </argument> <argument index="6" name="clear_depth" type="float" default="1.0"> </argument> <argument index="7" name="clear_stencil" type="int" default="0"> </argument> - <argument index="8" name="region" type="Rect2" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="8" name="region" type="Rect2" default="Rect2i(0, 0, 0, 0)"> </argument> - <argument index="9" name="storage_textures" type="Array" default="[ ]"> + <argument index="9" name="storage_textures" type="Array" default="[]"> </argument> <description> </description> @@ -214,7 +214,7 @@ </return> <argument index="0" name="screen" type="int" default="0"> </argument> - <argument index="1" name="clear_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <argument index="1" name="clear_color" type="Color" default="Color(0, 0, 0, 1)"> </argument> <description> </description> @@ -234,15 +234,15 @@ </argument> <argument index="5" name="final_depth_action" type="int" enum="RenderingDevice.FinalAction"> </argument> - <argument index="6" name="clear_color_values" type="PackedColorArray" default="PackedColorArray( )"> + <argument index="6" name="clear_color_values" type="PackedColorArray" default="PackedColorArray()"> </argument> <argument index="7" name="clear_depth" type="float" default="1.0"> </argument> <argument index="8" name="clear_stencil" type="int" default="0"> </argument> - <argument index="9" name="region" type="Rect2" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="9" name="region" type="Rect2" default="Rect2i(0, 0, 0, 0)"> </argument> - <argument index="10" name="storage_textures" type="RID[]" default="[ ]"> + <argument index="10" name="storage_textures" type="RID[]" default="[]"> </argument> <description> </description> @@ -316,7 +316,7 @@ </return> <argument index="0" name="draw_list" type="int"> </argument> - <argument index="1" name="rect" type="Rect2" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="1" name="rect" type="Rect2" default="Rect2i(0, 0, 0, 0)"> </argument> <description> </description> @@ -488,7 +488,7 @@ </argument> <argument index="1" name="format" type="int" enum="RenderingDevice.IndexBufferFormat"> </argument> - <argument index="2" name="data" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="2" name="data" type="PackedByteArray" default="PackedByteArray()"> </argument> <argument index="3" name="use_restart_indices" type="bool" default="false"> </argument> @@ -606,7 +606,7 @@ </return> <argument index="0" name="size_bytes" type="int"> </argument> - <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray()"> </argument> <argument index="2" name="usage" type="int" default="0"> </argument> @@ -632,7 +632,7 @@ </argument> <argument index="1" name="format" type="int" enum="RenderingDevice.DataFormat"> </argument> - <argument index="2" name="data" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="2" name="data" type="PackedByteArray" default="PackedByteArray()"> </argument> <description> </description> @@ -690,7 +690,7 @@ </argument> <argument index="1" name="view" type="RDTextureView"> </argument> - <argument index="2" name="data" type="PackedByteArray[]" default="[ ]"> + <argument index="2" name="data" type="PackedByteArray[]" default="[]"> </argument> <description> </description> @@ -788,7 +788,7 @@ </return> <argument index="0" name="size_bytes" type="int"> </argument> - <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray()"> </argument> <description> </description> @@ -818,7 +818,7 @@ </return> <argument index="0" name="size_bytes" type="int"> </argument> - <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray( )"> + <argument index="1" name="data" type="PackedByteArray" default="PackedByteArray()"> </argument> <argument index="2" name="use_as_storage" type="bool" default="false"> </argument> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 9b9644093f..44e0202307 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -620,7 +620,7 @@ </argument> <argument index="5" name="reflection_source" type="int" enum="RenderingServer.EnvironmentReflectionSource" default="0"> </argument> - <argument index="6" name="ao_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <argument index="6" name="ao_color" type="Color" default="Color(0, 0, 0, 1)"> </argument> <description> </description> @@ -2725,7 +2725,7 @@ </return> <argument index="0" name="viewport" type="RID"> </argument> - <argument index="1" name="rect" type="Rect2" default="Rect2( 0, 0, 0, 0 )"> + <argument index="1" name="rect" type="Rect2" default="Rect2(0, 0, 0, 0)"> </argument> <argument index="2" name="screen" type="int" default="0"> </argument> @@ -3702,7 +3702,7 @@ </constant> <constant name="INSTANCE_OCCLUDER" value="11" enum="InstanceType"> </constant> - <constant name="INSTANCE_MAX" value="12" enum="InstanceType"> + <constant name="INSTANCE_MAX" value="13" enum="InstanceType"> Represents the size of the [enum InstanceType] enum. </constant> <constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType"> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index c81b21333f..682d7b97f3 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -84,7 +84,7 @@ </return> <argument index="0" name="path" type="String"> </argument> - <argument index="1" name="progress" type="Array" default="[ ]"> + <argument index="1" name="progress" type="Array" default="[]"> </argument> <description> Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [code]path[/code]. See [enum ThreadLoadStatus] for possible return values. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 7ca70f5a7a..623ee7520d 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -24,7 +24,7 @@ </argument> <argument index="2" name="height" type="int" default="0"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="inline_align" type="int" enum="VAlign" default="0"> </argument> @@ -209,13 +209,13 @@ </argument> <argument index="2" name="size" type="int"> </argument> - <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2( 0, 0, 0, 0 )"> + <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)"> </argument> - <argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="4" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="5" name="outline_size" type="int" default="0"> </argument> - <argument index="6" name="outline_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <argument index="6" name="outline_color" type="Color" default="Color(0, 0, 0, 0)"> </argument> <description> Adds a [code][dropcap][/code] tag to the tag stack. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. @@ -450,7 +450,7 @@ The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. [b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. </member> - <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[ ]"> + <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]"> The currently installed custom effects. This is an array of [RichTextEffect]s. To add a custom effect, it's more convenient to use [method install_effect]. </member> @@ -484,7 +484,7 @@ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]"> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> Set additional options for BiDi override. </member> <member name="tab_size" type="int" setter="set_tab_size" getter="get_tab_size" default="4"> @@ -612,19 +612,19 @@ <theme_item name="bold_italics_font_size" type="int"> The font size used for bold italics text. </theme_item> - <theme_item name="default_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="default_color" type="Color" default="Color(1, 1, 1, 1)"> The default text color. </theme_item> <theme_item name="focus" type="StyleBox"> The background The background used when the [RichTextLabel] is focused. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The default tint of text outline. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0, 0, 0, 1)"> The color of selected text, used when [member selection_enabled] is [code]true[/code]. </theme_item> - <theme_item name="font_shadow_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="font_shadow_color" type="Color" default="Color(0, 0, 0, 0)"> The color of the font's shadow. </theme_item> <theme_item name="italics_font" type="Font"> @@ -654,7 +654,7 @@ <theme_item name="outline_size" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.1, 0.1, 1, 0.8 )"> + <theme_item name="selection_color" type="Color" default="Color(0.1, 0.1, 1, 0.8)"> The color of the selection box. </theme_item> <theme_item name="shadow_as_outline" type="int" default="0"> @@ -666,16 +666,16 @@ <theme_item name="shadow_offset_y" type="int" default="1"> The vertical offset of the font's shadow. </theme_item> - <theme_item name="table_border" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="table_border" type="Color" default="Color(0, 0, 0, 0)"> The default cell border color. </theme_item> - <theme_item name="table_even_row_bg" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="table_even_row_bg" type="Color" default="Color(0, 0, 0, 0)"> The default background color for even rows. </theme_item> <theme_item name="table_hseparation" type="int" default="3"> The horizontal separation of elements in a table. </theme_item> - <theme_item name="table_odd_row_bg" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="table_odd_row_bg" type="Color" default="Color(0, 0, 0, 0)"> The default background color for odd rows. </theme_item> <theme_item name="table_vseparation" type="int" default="3"> diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 237317daf1..64573b7282 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -39,7 +39,7 @@ </return> <argument index="0" name="force" type="Vector2"> </argument> - <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. @@ -57,7 +57,7 @@ <method name="apply_central_impulse"> <return type="void"> </return> - <argument index="0" name="impulse" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="0" name="impulse" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Applies a directional impulse without affecting rotation. @@ -68,7 +68,7 @@ </return> <argument index="0" name="impulse" type="Vector2"> </argument> - <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin. @@ -109,7 +109,7 @@ <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" default="0.0"> The body's rotational velocity. </member> - <member name="applied_force" type="Vector2" setter="set_applied_force" getter="get_applied_force" default="Vector2( 0, 0 )"> + <member name="applied_force" type="Vector2" setter="set_applied_force" getter="get_applied_force" default="Vector2(0, 0)"> The body's total applied force. </member> <member name="applied_torque" type="float" setter="set_applied_torque" getter="get_applied_torque" default="0.0"> @@ -142,7 +142,7 @@ Damps the body's [member linear_velocity]. If [code]-1[/code], the body will use the [b]Default Linear Damp[/b] in [b]Project > Project Settings > Physics > 2d[/b]. See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping. </member> - <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2( 0, 0 )"> + <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> The body's linear velocity. </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0"> diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index e3349169ff..fb2b9690a3 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -40,7 +40,7 @@ </return> <argument index="0" name="force" type="Vector3"> </argument> - <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Adds a constant directional force (i.e. acceleration). @@ -71,7 +71,7 @@ </return> <argument index="0" name="impulse" type="Vector3"> </argument> - <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)"> </argument> <description> Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. @@ -116,7 +116,7 @@ Damps RigidBody3D's rotational forces. See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping. </member> - <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3( 0, 0, 0 )"> + <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)"> RigidBody3D's rotational velocity. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> @@ -143,7 +143,7 @@ The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden. See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping. </member> - <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3( 0, 0, 0 )"> + <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> The body's linear velocity. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0"> diff --git a/doc/classes/SegmentShape2D.xml b/doc/classes/SegmentShape2D.xml index 31c0f7f1f3..341c5e9d20 100644 --- a/doc/classes/SegmentShape2D.xml +++ b/doc/classes/SegmentShape2D.xml @@ -11,10 +11,10 @@ <methods> </methods> <members> - <member name="a" type="Vector2" setter="set_a" getter="get_a" default="Vector2( 0, 0 )"> + <member name="a" type="Vector2" setter="set_a" getter="get_a" default="Vector2(0, 0)"> The segment's first point position. </member> - <member name="b" type="Vector2" setter="set_b" getter="get_b" default="Vector2( 0, 10 )"> + <member name="b" type="Vector2" setter="set_b" getter="get_b" default="Vector2(0, 10)"> The segment's second point position. </member> </members> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 84efc974c0..1fd70a43fd 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -40,7 +40,7 @@ </return> <argument index="0" name="callable" type="Callable"> </argument> - <argument index="1" name="binds" type="Array" default="[ ]"> + <argument index="1" name="binds" type="Array" default="[]"> </argument> <argument index="2" name="flags" type="int" default="0"> </argument> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index d8b35ad272..136f2f0a63 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -171,7 +171,7 @@ <method name="physical_bones_start_simulation"> <return type="void"> </return> - <argument index="0" name="bones" type="StringName[]" default="[ ]"> + <argument index="0" name="bones" type="StringName[]" default="[]"> </argument> <description> Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml index dccc45d0ec..138ebe4411 100644 --- a/doc/classes/SkeletonIK3D.xml +++ b/doc/classes/SkeletonIK3D.xml @@ -38,7 +38,7 @@ <members> <member name="interpolation" type="float" setter="set_interpolation" getter="get_interpolation" default="1.0"> </member> - <member name="magnet" type="Vector3" setter="set_magnet_position" getter="get_magnet_position" default="Vector3( 0, 0, 0 )"> + <member name="magnet" type="Vector3" setter="set_magnet_position" getter="get_magnet_position" default="Vector3(0, 0, 0)"> </member> <member name="max_iterations" type="int" setter="set_max_iterations" getter="get_max_iterations" default="10"> </member> @@ -48,7 +48,7 @@ </member> <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" default="&"""> </member> - <member name="target" type="Transform3D" setter="set_target_transform" getter="get_target_transform" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="target" type="Transform3D" setter="set_target_transform" getter="get_target_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> </member> <member name="target_node" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> </member> diff --git a/doc/classes/SkeletonModification2DJiggle.xml b/doc/classes/SkeletonModification2DJiggle.xml index 7f8cf2d4d9..ae46acd0d0 100644 --- a/doc/classes/SkeletonModification2DJiggle.xml +++ b/doc/classes/SkeletonModification2DJiggle.xml @@ -208,7 +208,7 @@ <member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.75"> The default amount of dampening applied to the Jiggle joints, if they are not overriden. Higher values lead to more of the calculated velocity being applied. </member> - <member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2( 0, 6 )"> + <member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2(0, 6)"> The default amount of gravity applied to the Jiggle joints, if they are not overriden. </member> <member name="jiggle_data_chain_length" type="int" setter="set_jiggle_data_chain_length" getter="get_jiggle_data_chain_length" default="0"> diff --git a/doc/classes/SkeletonModification2DPhysicalBones.xml b/doc/classes/SkeletonModification2DPhysicalBones.xml index d8aaf09a8e..2547727097 100644 --- a/doc/classes/SkeletonModification2DPhysicalBones.xml +++ b/doc/classes/SkeletonModification2DPhysicalBones.xml @@ -40,7 +40,7 @@ <method name="start_simulation"> <return type="void"> </return> - <argument index="0" name="bones" type="StringName[]" default="[ ]"> + <argument index="0" name="bones" type="StringName[]" default="[]"> </argument> <description> Tell the [PhysicalBone2D] nodes to start simulating and interacting with the physics world. @@ -50,7 +50,7 @@ <method name="stop_simulation"> <return type="void"> </return> - <argument index="0" name="bones" type="StringName[]" default="[ ]"> + <argument index="0" name="bones" type="StringName[]" default="[]"> </argument> <description> Tell the [PhysicalBone2D] nodes to stop simulating and interacting with the physics world. diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index c320adb1be..b419b003bf 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -64,13 +64,13 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. </member> - <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i( 0, 0 )"> + <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)"> Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </member> <member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false"> @@ -79,7 +79,7 @@ <member name="region_filter_clip_enabled" type="bool" setter="set_region_filter_clip_enabled" getter="is_region_filter_clip_enabled" default="false"> If [code]true[/code], the outermost pixels get blurred out. [member region_enabled] must be [code]true[/code]. </member> - <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> + <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 8c4b9e7d10..f7f2ff0de1 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -14,7 +14,7 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. </member> - <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i( 0, 0 )"> + <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)"> Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> @@ -23,7 +23,7 @@ <member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false"> If [code]true[/code], texture will be cut from a larger atlas texture. See [member region_rect]. </member> - <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> + <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index 06b9c2b042..3168e2d848 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -66,10 +66,10 @@ <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" default="false"> If [code]true[/code], texture is flipped vertically. </member> - <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> A color value that gets multiplied on, could be used for mood-coloring or to simulate the color of light. </member> - <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </member> <member name="opacity" type="float" setter="set_opacity" getter="get_opacity" default="1.0"> diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index 298339d5fc..85915a53fe 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -18,7 +18,7 @@ <member name="constant_angular_velocity" type="float" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="0.0"> The body's constant angular velocity. This does not rotate the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were rotating. </member> - <member name="constant_linear_velocity" type="Vector2" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector2( 0, 0 )"> + <member name="constant_linear_velocity" type="Vector2" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector2(0, 0)"> The body's constant linear velocity. This does not move the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were moving. </member> <member name="kinematic_motion" type="bool" setter="set_kinematic_motion_enabled" getter="is_kinematic_motion_enabled" default="false"> diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml index 5ffbb71522..f83d440f10 100644 --- a/doc/classes/StaticBody3D.xml +++ b/doc/classes/StaticBody3D.xml @@ -18,10 +18,10 @@ <methods> </methods> <members> - <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="Vector3( 0, 0, 0 )"> + <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="Vector3(0, 0, 0)"> The body's constant angular velocity. This does not rotate the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were rotating. </member> - <member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector3( 0, 0, 0 )"> + <member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector3(0, 0, 0)"> The body's constant linear velocity. This does not move the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were moving. </member> <member name="kinematic_motion" type="bool" setter="set_kinematic_motion_enabled" getter="is_kinematic_motion_enabled" default="false"> diff --git a/doc/classes/StreamPeerBuffer.xml b/doc/classes/StreamPeerBuffer.xml index 41cef9fb55..03a150b90f 100644 --- a/doc/classes/StreamPeerBuffer.xml +++ b/doc/classes/StreamPeerBuffer.xml @@ -49,7 +49,7 @@ </method> </methods> <members> - <member name="data_array" type="PackedByteArray" setter="set_data_array" getter="get_data_array" default="PackedByteArray( )"> + <member name="data_array" type="PackedByteArray" setter="set_data_array" getter="get_data_array" default="PackedByteArray()"> </member> </members> <constants> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index d66ae210ec..9e02fb57c3 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -156,13 +156,13 @@ <member name="anti_aliasing_size" type="int" setter="set_aa_size" getter="get_aa_size" default="1"> This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. </member> - <member name="bg_color" type="Color" setter="set_bg_color" getter="get_bg_color" default="Color( 0.6, 0.6, 0.6, 1 )"> + <member name="bg_color" type="Color" setter="set_bg_color" getter="get_bg_color" default="Color(0.6, 0.6, 0.6, 1)"> The background color of the stylebox. </member> <member name="border_blend" type="bool" setter="set_border_blend" getter="get_border_blend" default="false"> If [code]true[/code], the border will fade into the background color. </member> - <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color( 0.8, 0.8, 0.8, 1 )"> + <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color(0.8, 0.8, 0.8, 1)"> Sets the color of the border. </member> <member name="border_width_bottom" type="int" setter="set_border_width" getter="get_border_width" default="0"> @@ -209,10 +209,10 @@ <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the stylebox outside of the control rect on the top edge. Useful in combination with [member border_width_top] to draw a border outside the control rect. </member> - <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 0.6 )"> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 0.6)"> The color of the shadow. This has no effect if [member shadow_size] is lower than 1. </member> - <member name="shadow_offset" type="Vector2" setter="set_shadow_offset" getter="get_shadow_offset" default="Vector2( 0, 0 )"> + <member name="shadow_offset" type="Vector2" setter="set_shadow_offset" getter="get_shadow_offset" default="Vector2(0, 0)"> The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox. </member> <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" default="0"> diff --git a/doc/classes/StyleBoxLine.xml b/doc/classes/StyleBoxLine.xml index 4a2dbf60e4..850c656720 100644 --- a/doc/classes/StyleBoxLine.xml +++ b/doc/classes/StyleBoxLine.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(0, 0, 0, 1)"> The line's color. </member> <member name="grow_begin" type="float" setter="set_grow_begin" getter="get_grow_begin" default="1.0"> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index f4a1f1f01d..be14048126 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -116,10 +116,10 @@ A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative. </member> - <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> Modulates the color of the texture when this style box is drawn. </member> - <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> + <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> Species a sub-region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. </member> diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml index f54f22d6fa..9c5610e2c7 100644 --- a/doc/classes/SubViewport.xml +++ b/doc/classes/SubViewport.xml @@ -25,10 +25,10 @@ <member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="SubViewport.UpdateMode" default="2"> The update mode when the sub-viewport is used as a render target. </member> - <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i( 512, 512 )"> + <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(512, 512)"> The width and height of the sub-viewport. </member> - <member name="size_2d_override" type="Vector2i" setter="set_size_2d_override" getter="get_size_2d_override" default="Vector2i( 0, 0 )"> + <member name="size_2d_override" type="Vector2i" setter="set_size_2d_override" getter="get_size_2d_override" default="Vector2i(0, 0)"> The 2D size override of the sub-viewport. If either the width or height is [code]0[/code], the override is disabled. </member> <member name="size_2d_override_stretch" type="bool" setter="set_size_2d_override_stretch" getter="is_size_2d_override_stretch_enabled" default="false"> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 56b47f4a24..22d1b52479 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -45,15 +45,15 @@ </return> <argument index="0" name="vertices" type="PackedVector3Array"> </argument> - <argument index="1" name="uvs" type="PackedVector2Array" default="PackedVector2Array( )"> + <argument index="1" name="uvs" type="PackedVector2Array" default="PackedVector2Array()"> </argument> - <argument index="2" name="colors" type="PackedColorArray" default="PackedColorArray( )"> + <argument index="2" name="colors" type="PackedColorArray" default="PackedColorArray()"> </argument> - <argument index="3" name="uv2s" type="PackedVector2Array" default="PackedVector2Array( )"> + <argument index="3" name="uv2s" type="PackedVector2Array" default="PackedVector2Array()"> </argument> - <argument index="4" name="normals" type="PackedVector3Array" default="PackedVector3Array( )"> + <argument index="4" name="normals" type="PackedVector3Array" default="PackedVector3Array()"> </argument> - <argument index="5" name="tangents" type="Array" default="[ ]"> + <argument index="5" name="tangents" type="Array" default="[]"> </argument> <description> Inserts a triangle fan made of array data into [Mesh] being constructed. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index ddf6b465a4..3f24509ec7 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -198,19 +198,19 @@ <theme_item name="font" type="Font"> The font used to draw tab names. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Font color of disabled tabs. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the tab name. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Font color of the currently selected tab. </theme_item> <theme_item name="font_size" type="int"> Font size of the tab names. </theme_item> - <theme_item name="font_unselected_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> + <theme_item name="font_unselected_color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Font color of the other, unselected tabs. </theme_item> <theme_item name="icon_separation" type="int" default="4"> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index d784585e20..aff104c922 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -362,19 +362,19 @@ <theme_item name="font" type="Font"> The font used to draw tab names. </theme_item> - <theme_item name="font_disabled_color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> + <theme_item name="font_disabled_color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Font color of disabled tabs. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the tab name. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Font color of the currently selected tab. </theme_item> <theme_item name="font_size" type="int"> Font size of the tab names. </theme_item> - <theme_item name="font_unselected_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> + <theme_item name="font_unselected_color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Font color of the other, unselected tabs. </theme_item> <theme_item name="hseparation" type="int" default="4"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 74811318dc..03e4556c92 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -18,15 +18,6 @@ <description> </description> </method> - <method name="can_fold" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns if the given line is foldable, that is, it has indented lines right below it. - </description> - </method> <method name="center_viewport_to_cursor"> <return type="void"> </return> @@ -95,7 +86,7 @@ <description> Moves the cursor at the specified [code]line[/code] index. If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. - If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. + If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden. </description> </method> <method name="cut"> @@ -112,22 +103,6 @@ Deselects the current selection. </description> </method> - <method name="fold_all_lines"> - <return type="void"> - </return> - <description> - Folds all lines that are possible to be folded (see [method can_fold]). - </description> - </method> - <method name="fold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Folds the given line, if possible (see [method can_fold]). - </description> - </method> <method name="get_caret_draw_pos" qualifiers="const"> <return type="Vector2"> </return> @@ -329,15 +304,6 @@ Returns [code]true[/code] if the caret is visible on the screen. </description> </method> - <method name="is_folded" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns whether the line at the specified index is folded or not. - </description> - </method> <method name="is_gutter_clickable" qualifiers="const"> <return type="bool"> </return> @@ -372,15 +338,6 @@ <description> </description> </method> - <method name="is_line_hidden" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns whether the line at the specified index is hidden or not. - </description> - </method> <method name="is_selection_active" qualifiers="const"> <return type="bool"> </return> @@ -560,17 +517,6 @@ Sets the text for a specific line. </description> </method> - <method name="set_line_as_hidden"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> - <description> - If [code]true[/code], hides the line of the specified index. - </description> - </method> <method name="set_line_background_color"> <return type="void"> </return> @@ -665,15 +611,6 @@ <description> </description> </method> - <method name="toggle_fold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Toggle the folding of the code block at the given line. - </description> - </method> <method name="undo"> <return type="void"> </return> @@ -681,22 +618,6 @@ Perform undo operation. </description> </method> - <method name="unfold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Unfolds the given line, if folded. - </description> - </method> - <method name="unhide_all_lines"> - <return type="void"> - </return> - <description> - Unhide all lines that were previously set to hidden by [method set_line_as_hidden]. - </description> - </method> </methods> <members> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false"> @@ -730,9 +651,6 @@ If [code]true[/code], the "tab" character will have a visible representation. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> - <member name="hiding_enabled" type="bool" setter="set_hiding_enabled" getter="is_hiding_enabled" default="false"> - If [code]true[/code], all lines that have been set to hidden by [method set_line_as_hidden], will not be visible. - </member> <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" default="false"> If [code]true[/code], all occurrences of the selected text will be highlighted. </member> @@ -774,7 +692,7 @@ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> - <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]"> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> Set additional options for BiDi override. </member> <member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter"> @@ -963,18 +881,16 @@ </constant> </constants> <theme_items> - <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="background_color" type="Color" default="Color(0, 0, 0, 0)"> Sets the background [Color] of this [TextEdit]. </theme_item> - <theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )"> - </theme_item> - <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="brace_mismatch_color" type="Color" default="Color(1, 0.2, 0.2, 1)"> </theme_item> - <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="caret_background_color" type="Color" default="Color(0, 0, 0, 1)"> </theme_item> - <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )"> + <theme_item name="caret_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> </theme_item> - <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> + <theme_item name="current_line_color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)"> Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. </theme_item> <theme_item name="focus" type="StyleBox"> @@ -982,15 +898,15 @@ <theme_item name="font" type="Font"> Sets the default [Font]. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Sets the font [Color]. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [TextEdit]. </theme_item> - <theme_item name="font_readonly_color" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> + <theme_item name="font_readonly_color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)"> </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(0, 0, 0, 1)"> Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. </theme_item> <theme_item name="font_size" type="int"> @@ -1008,7 +924,7 @@ <theme_item name="read_only" type="StyleBox"> Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled. </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> + <theme_item name="selection_color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> Sets the highlight [Color] of text selections. </theme_item> <theme_item name="space" type="Texture2D"> @@ -1017,7 +933,7 @@ <theme_item name="tab" type="Texture2D"> Sets a custom [Texture2D] for tab text characters. </theme_item> - <theme_item name="word_highlighted_color" type="Color" default="Color( 0.8, 0.9, 0.9, 0.15 )"> + <theme_item name="word_highlighted_color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. </theme_item> </theme_items> diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index ddbae0e977..318c3be794 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -56,7 +56,7 @@ </argument> <argument index="1" name="pos" type="Vector2"> </argument> - <argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -71,7 +71,7 @@ </argument> <argument index="2" name="outline_size" type="int" default="1"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index e9afe47ee8..d67a9bcb85 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -63,9 +63,9 @@ </argument> <argument index="1" name="pos" type="Vector2"> </argument> - <argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> - <argument index="3" name="dc_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="dc_color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw all lines of the text and drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -78,7 +78,7 @@ </argument> <argument index="1" name="pos" type="Vector2"> </argument> - <argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -93,7 +93,7 @@ </argument> <argument index="2" name="outline_size" type="int" default="1"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw drop cap outline into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -108,7 +108,7 @@ </argument> <argument index="2" name="line" type="int"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -125,7 +125,7 @@ </argument> <argument index="3" name="outline_size" type="int" default="1"> </argument> - <argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="4" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw outline of the single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -140,9 +140,9 @@ </argument> <argument index="2" name="outline_size" type="int" default="1"> </argument> - <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> - <argument index="4" name="dc_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="4" name="dc_color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw outlines of all lines of the text and drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box. @@ -344,7 +344,7 @@ </argument> <argument index="2" name="size" type="int"> </argument> - <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2( 0, 0, 0, 0 )"> + <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)"> </argument> <argument index="4" name="opentype_features" type="Dictionary" default="{ }"> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 9a96d8699c..c943946ab3 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -149,7 +149,7 @@ </argument> <argument index="4" name="index" type="int"> </argument> - <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="5" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. @@ -171,7 +171,7 @@ </argument> <argument index="5" name="index" type="int"> </argument> - <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="6" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. @@ -788,7 +788,7 @@ </argument> <argument index="4" name="clip_r" type="float" default="-1"> </argument> - <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="5" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). @@ -809,7 +809,7 @@ </argument> <argument index="5" name="outline_size" type="int" default="1"> </argument> - <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="6" name="color" type="Color" default="Color(1, 1, 1, 1)"> </argument> <description> Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index c33f32c9e4..35b719ae48 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -19,7 +19,7 @@ </argument> <argument index="1" name="position" type="Vector2"> </argument> - <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="3" name="transpose" type="bool" default="false"> </argument> @@ -36,7 +36,7 @@ </argument> <argument index="2" name="tile" type="bool"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> @@ -53,7 +53,7 @@ </argument> <argument index="2" name="src_rect" type="Rect2"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index b40759578f..59cde536ad 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -36,7 +36,7 @@ <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" default="false"> If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. When using a radial [member fill_mode], this setting will enable stretching. </member> - <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" default="Vector2( 0, 0 )"> + <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" default="Vector2(0, 0)"> Offsets [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. </member> <member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees" default="360.0"> @@ -68,13 +68,13 @@ <member name="texture_under" type="Texture2D" setter="set_under_texture" getter="get_under_texture"> [Texture2D] that draws under the progress bar. The bar's background. </member> - <member name="tint_over" type="Color" setter="set_tint_over" getter="get_tint_over" default="Color( 1, 1, 1, 1 )"> + <member name="tint_over" type="Color" setter="set_tint_over" getter="get_tint_over" default="Color(1, 1, 1, 1)"> Multiplies the color of the bar's [code]texture_over[/code] texture. The effect is similar to [member CanvasItem.modulate], except it only affects this specific texture instead of the entire node. </member> - <member name="tint_progress" type="Color" setter="set_tint_progress" getter="get_tint_progress" default="Color( 1, 1, 1, 1 )"> + <member name="tint_progress" type="Color" setter="set_tint_progress" getter="get_tint_progress" default="Color(1, 1, 1, 1)"> Multiplies the color of the bar's [code]texture_progress[/code] texture. </member> - <member name="tint_under" type="Color" setter="set_tint_under" getter="get_tint_under" default="Color( 1, 1, 1, 1 )"> + <member name="tint_under" type="Color" setter="set_tint_under" getter="get_tint_under" default="Color(1, 1, 1, 1)"> Multiplies the color of the bar's [code]texture_under[/code] texture. </member> </members> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index efcbdf2e95..1f0f807a08 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -219,13 +219,13 @@ </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false"> </member> - <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> + <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> </member> <member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0"> </member> <member name="terrain_set" type="int" setter="set_terrain_set" getter="get_terrain_set" default="-1"> </member> - <member name="texture_offset" type="Vector2i" setter="set_texture_offset" getter="get_texture_offset" default="Vector2i( 0, 0 )"> + <member name="texture_offset" type="Vector2i" setter="set_texture_offset" getter="get_texture_offset" default="Vector2i(0, 0)"> </member> <member name="transpose" type="bool" setter="set_transpose" getter="get_transpose" default="false"> </member> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 93d5dd8037..5a4068ec86 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -103,7 +103,7 @@ </argument> <argument index="1" name="source_id" type="int" default="-1"> </argument> - <argument index="2" name="atlas_coords" type="Vector2i" default="Vector2i( -1, -1 )"> + <argument index="2" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)"> </argument> <argument index="3" name="alternative_tile" type="int" default="-1"> </argument> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 2015b1f1cd..7d8b589f78 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -287,9 +287,9 @@ </member> <member name="tile_shape" type="int" setter="set_tile_shape" getter="get_tile_shape" enum="TileSet.TileShape" default="0"> </member> - <member name="tile_size" type="Vector2i" setter="set_tile_size" getter="get_tile_size" default="Vector2i( 16, 16 )"> + <member name="tile_size" type="Vector2i" setter="set_tile_size" getter="get_tile_size" default="Vector2i(16, 16)"> </member> - <member name="tile_skew" type="Vector2" setter="set_tile_skew" getter="get_tile_skew" default="Vector2( 0, 0 )"> + <member name="tile_skew" type="Vector2" setter="set_tile_skew" getter="get_tile_skew" default="Vector2(0, 0)"> </member> <member name="uv_clipping" type="bool" setter="set_uv_clipping" getter="is_uv_clipping" default="false"> </member> diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml index a7a304ca27..8482c356d7 100644 --- a/doc/classes/TileSetAtlasSource.xml +++ b/doc/classes/TileSetAtlasSource.xml @@ -12,9 +12,9 @@ </return> <argument index="0" name="atlas_coords" type="Vector2i"> </argument> - <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i( -1, -1 )"> + <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)"> </argument> - <argument index="2" name="new_size" type="Vector2i" default="Vector2i( -1, -1 )"> + <argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)"> </argument> <description> </description> @@ -40,7 +40,7 @@ </return> <argument index="0" name="atlas_coords" type="Vector2i"> </argument> - <argument index="1" name="size" type="Vector2i" default="Vector2i( 1, 1 )"> + <argument index="1" name="size" type="Vector2i" default="Vector2i(1, 1)"> </argument> <description> </description> @@ -154,9 +154,9 @@ </return> <argument index="0" name="atlas_coords" type="Vector2i"> </argument> - <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i( -1, -1 )"> + <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)"> </argument> - <argument index="2" name="new_size" type="Vector2i" default="Vector2i( -1, -1 )"> + <argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)"> </argument> <description> </description> @@ -193,13 +193,13 @@ </method> </methods> <members> - <member name="margins" type="Vector2i" setter="set_margins" getter="get_margins" default="Vector2i( 0, 0 )"> + <member name="margins" type="Vector2i" setter="set_margins" getter="get_margins" default="Vector2i(0, 0)"> </member> - <member name="separation" type="Vector2i" setter="set_separation" getter="get_separation" default="Vector2i( 0, 0 )"> + <member name="separation" type="Vector2i" setter="set_separation" getter="get_separation" default="Vector2i(0, 0)"> </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> </member> - <member name="tile_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i( 16, 16 )"> + <member name="tile_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)"> </member> </members> <constants> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 0dbf95376a..4f9b59c188 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -132,7 +132,7 @@ <method name="looking_at" qualifiers="const"> <return type="Transform2D"> </return> - <argument index="0" name="target" type="Vector2" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <argument index="0" name="target" type="Vector2" default="Transform2D(1, 0, 0, 1, 0, 0)"> </argument> <description> Returns a copy of the transform rotated such that it's rotation on the X-axis points towards the [code]target[/code] position. @@ -148,9 +148,17 @@ </description> </method> <method name="operator *" qualifiers="operator"> - <return type="PackedVector2Array"> + <return type="Vector2"> </return> - <argument index="0" name="right" type="PackedVector2Array"> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Rect2"> + </return> + <argument index="0" name="right" type="Rect2"> </argument> <description> </description> @@ -164,19 +172,29 @@ </description> </method> <method name="operator *" qualifiers="operator"> - <return type="Rect2"> + <return type="PackedVector2Array"> </return> - <argument index="0" name="right" type="Rect2"> + <argument index="0" name="right" type="PackedVector2Array"> </argument> <description> </description> </method> <method name="operator *" qualifiers="operator"> - <return type="Vector2"> + <return type="Transform2D"> </return> - <argument index="0" name="right" type="Vector2"> + <argument index="0" name="right" type="float"> + </argument> + <description> + This operator multiplies all components of the [Transform2D], including the origin vector, which scales it uniformly. + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Transform2D"> + </return> + <argument index="0" name="right" type="int"> </argument> <description> + This operator multiplies all components of the [Transform2D], including the origin vector, which scales it uniformly. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -241,24 +259,24 @@ </method> </methods> <members> - <member name="origin" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> + <member name="origin" type="Vector2" setter="" getter="" default="Vector2(0, 0)"> The origin vector (column 2, the third column). Equivalent to array index [code]2[/code]. The origin vector represents translation. </member> - <member name="x" type="Vector2" setter="" getter="" default="Vector2( 1, 0 )"> + <member name="x" type="Vector2" setter="" getter="" default="Vector2(1, 0)"> The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code]. </member> - <member name="y" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )"> + <member name="y" type="Vector2" setter="" getter="" default="Vector2(0, 1)"> The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code]. </member> </members> <constants> - <constant name="IDENTITY" value="Transform2D( 1, 0, 0, 1, 0, 0 )"> + <constant name="IDENTITY" value="Transform2D(1, 0, 0, 1, 0, 0)"> The identity [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation. </constant> - <constant name="FLIP_X" value="Transform2D( -1, 0, 0, 1, 0, 0 )"> + <constant name="FLIP_X" value="Transform2D(-1, 0, 0, 1, 0, 0)"> The [Transform2D] that will flip something along the X axis. </constant> - <constant name="FLIP_Y" value="Transform2D( 1, 0, 0, -1, 0, 0 )"> + <constant name="FLIP_Y" value="Transform2D(1, 0, 0, -1, 0, 0)"> The [Transform2D] that will flip something along the Y axis. </constant> </constants> diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 0d49255523..5410cbced7 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -97,7 +97,7 @@ </return> <argument index="0" name="target" type="Vector3"> </argument> - <argument index="1" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> + <argument index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)"> </argument> <description> Returns a copy of the transform rotated such that its -Z axis points towards the [code]target[/code] position. @@ -145,6 +145,24 @@ <description> </description> </method> + <method name="operator *" qualifiers="operator"> + <return type="Transform3D"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + This operator multiplies all components of the [Transform3D], including the origin vector, which scales it uniformly. + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Transform3D"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + This operator multiplies all components of the [Transform3D], including the origin vector, which scales it uniformly. + </description> + </method> <method name="operator ==" qualifiers="operator"> <return type="bool"> </return> @@ -192,24 +210,24 @@ </method> </methods> <members> - <member name="basis" type="Basis" setter="" getter="" default="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )"> + <member name="basis" type="Basis" setter="" getter="" default="Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)"> The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> - <member name="origin" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> + <member name="origin" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> The translation offset of the transform (column 3, the fourth column). Equivalent to array index [code]3[/code]. </member> </members> <constants> - <constant name="IDENTITY" value="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <constant name="IDENTITY" value="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> [Transform3D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation. </constant> - <constant name="FLIP_X" value="Transform3D( -1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <constant name="FLIP_X" value="Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> [Transform3D] with mirroring applied perpendicular to the YZ plane. </constant> - <constant name="FLIP_Y" value="Transform3D( 1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0 )"> + <constant name="FLIP_Y" value="Transform3D(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0)"> [Transform3D] with mirroring applied perpendicular to the XZ plane. </constant> - <constant name="FLIP_Z" value="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0 )"> + <constant name="FLIP_Z" value="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0)"> [Transform3D] with mirroring applied perpendicular to the XY plane. </constant> </constants> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index fe83bf9c2d..6a65d4ff7d 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -533,7 +533,7 @@ <theme_item name="checked" type="Texture2D"> The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is checked. </theme_item> - <theme_item name="children_hl_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )"> + <theme_item name="children_hl_line_color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> The [Color] of the relationship lines between the selected [TreeItem] and its children. </theme_item> <theme_item name="children_hl_line_width" type="int" default="1"> @@ -548,7 +548,7 @@ <theme_item name="custom_button" type="StyleBox"> Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell. </theme_item> - <theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + <theme_item name="custom_button_font_highlight" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. </theme_item> <theme_item name="custom_button_hover" type="StyleBox"> @@ -563,25 +563,25 @@ <theme_item name="draw_relationship_lines" type="int" default="0"> Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. </theme_item> - <theme_item name="drop_position_color" type="Color" default="Color( 1, 0.3, 0.2, 1 )"> + <theme_item name="drop_position_color" type="Color" default="Color(1, 0.3, 0.2, 1)"> [Color] used to draw possible drop locations. See [enum DropModeFlags] constants for further description of drop locations. </theme_item> <theme_item name="font" type="Font"> [Font] of the item's text. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> + <theme_item name="font_color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Default text [Color] of the item. </theme_item> - <theme_item name="font_outline_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the item. </theme_item> - <theme_item name="font_selected_color" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="font_selected_color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the item is selected. </theme_item> <theme_item name="font_size" type="int"> Font size of the item's text. </theme_item> - <theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )"> + <theme_item name="guide_color" type="Color" default="Color(0, 0, 0, 0.1)"> [Color] of the guideline. </theme_item> <theme_item name="hseparation" type="int" default="4"> @@ -593,7 +593,7 @@ <theme_item name="outline_size" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="parent_hl_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )"> + <theme_item name="parent_hl_line_color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> The [Color] of the relationship lines between the selected [TreeItem] and its parents. </theme_item> <theme_item name="parent_hl_line_margin" type="int" default="0"> @@ -602,7 +602,7 @@ <theme_item name="parent_hl_line_width" type="int" default="1"> The width of the relationship lines between the selected [TreeItem] and its parents. </theme_item> - <theme_item name="relationship_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )"> + <theme_item name="relationship_line_color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> The default [Color] of the relationship lines. </theme_item> <theme_item name="relationship_line_width" type="int" default="1"> @@ -623,7 +623,7 @@ <theme_item name="selected_focus" type="StyleBox"> [StyleBox] for the selected items, used when the [Tree] is being focused. </theme_item> - <theme_item name="title_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + <theme_item name="title_button_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the title button. </theme_item> <theme_item name="title_button_font" type="Font"> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 1390a5e45b..07d09c31dc 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -513,25 +513,25 @@ <constant name="AXIS_Y" value="1"> Enumerated value for the Y axis. </constant> - <constant name="ZERO" value="Vector2( 0, 0 )"> + <constant name="ZERO" value="Vector2(0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. </constant> - <constant name="ONE" value="Vector2( 1, 1 )"> + <constant name="ONE" value="Vector2(1, 1)"> One vector, a vector with all components set to [code]1[/code]. </constant> - <constant name="INF" value="Vector2( inf, inf )"> + <constant name="INF" value="Vector2(inf, inf)"> Infinity vector, a vector with all components set to [constant @GDScript.INF]. </constant> - <constant name="LEFT" value="Vector2( -1, 0 )"> + <constant name="LEFT" value="Vector2(-1, 0)"> Left unit vector. Represents the direction of left. </constant> - <constant name="RIGHT" value="Vector2( 1, 0 )"> + <constant name="RIGHT" value="Vector2(1, 0)"> Right unit vector. Represents the direction of right. </constant> - <constant name="UP" value="Vector2( 0, -1 )"> + <constant name="UP" value="Vector2(0, -1)"> Up unit vector. Y is down in 2D, so this vector points -Y. </constant> - <constant name="DOWN" value="Vector2( 0, 1 )"> + <constant name="DOWN" value="Vector2(0, 1)"> Down unit vector. Y is down in 2D, so this vector points +Y. </constant> </constants> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 6efb52b712..930ec944ba 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -246,22 +246,22 @@ <constant name="AXIS_Y" value="1"> Enumerated value for the Y axis. </constant> - <constant name="ZERO" value="Vector2i( 0, 0 )"> + <constant name="ZERO" value="Vector2i(0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. </constant> - <constant name="ONE" value="Vector2i( 1, 1 )"> + <constant name="ONE" value="Vector2i(1, 1)"> One vector, a vector with all components set to [code]1[/code]. </constant> - <constant name="LEFT" value="Vector2i( -1, 0 )"> + <constant name="LEFT" value="Vector2i(-1, 0)"> Left unit vector. Represents the direction of left. </constant> - <constant name="RIGHT" value="Vector2i( 1, 0 )"> + <constant name="RIGHT" value="Vector2i(1, 0)"> Right unit vector. Represents the direction of right. </constant> - <constant name="UP" value="Vector2i( 0, -1 )"> + <constant name="UP" value="Vector2i(0, -1)"> Up unit vector. Y is down in 2D, so this vector points -Y. </constant> - <constant name="DOWN" value="Vector2i( 0, 1 )"> + <constant name="DOWN" value="Vector2i(0, 1)"> Down unit vector. Y is down in 2D, so this vector points +Y. </constant> </constants> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index b6effd441b..eb1fd5f098 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -173,7 +173,7 @@ <return type="Vector3"> </return> <description> - Returns the inverse of the vector. This is the same as [code]Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )[/code]. + Returns the inverse of the vector. This is the same as [code]Vector3(1.0 / v.x, 1.0 / v.y, 1.0 / v.z)[/code]. </description> </method> <method name="is_equal_approx" qualifiers="const"> @@ -556,31 +556,31 @@ <constant name="AXIS_Z" value="2"> Enumerated value for the Z axis. Returned by [method max_axis] and [method min_axis]. </constant> - <constant name="ZERO" value="Vector3( 0, 0, 0 )"> + <constant name="ZERO" value="Vector3(0, 0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. </constant> - <constant name="ONE" value="Vector3( 1, 1, 1 )"> + <constant name="ONE" value="Vector3(1, 1, 1)"> One vector, a vector with all components set to [code]1[/code]. </constant> - <constant name="INF" value="Vector3( inf, inf, inf )"> + <constant name="INF" value="Vector3(inf, inf, inf)"> Infinity vector, a vector with all components set to [constant @GDScript.INF]. </constant> - <constant name="LEFT" value="Vector3( -1, 0, 0 )"> + <constant name="LEFT" value="Vector3(-1, 0, 0)"> Left unit vector. Represents the local direction of left, and the global direction of west. </constant> - <constant name="RIGHT" value="Vector3( 1, 0, 0 )"> + <constant name="RIGHT" value="Vector3(1, 0, 0)"> Right unit vector. Represents the local direction of right, and the global direction of east. </constant> - <constant name="UP" value="Vector3( 0, 1, 0 )"> + <constant name="UP" value="Vector3(0, 1, 0)"> Up unit vector. </constant> - <constant name="DOWN" value="Vector3( 0, -1, 0 )"> + <constant name="DOWN" value="Vector3(0, -1, 0)"> Down unit vector. </constant> - <constant name="FORWARD" value="Vector3( 0, 0, -1 )"> + <constant name="FORWARD" value="Vector3(0, 0, -1)"> Forward unit vector. Represents the local direction of forward, and the global direction of north. </constant> - <constant name="BACK" value="Vector3( 0, 0, 1 )"> + <constant name="BACK" value="Vector3(0, 0, 1)"> Back unit vector. Represents the local direction of back, and the global direction of south. </constant> </constants> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 6e8a34b692..8b45a62afa 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -260,28 +260,28 @@ <constant name="AXIS_Z" value="2"> Enumerated value for the Z axis. </constant> - <constant name="ZERO" value="Vector3i( 0, 0, 0 )"> + <constant name="ZERO" value="Vector3i(0, 0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. </constant> - <constant name="ONE" value="Vector3i( 1, 1, 1 )"> + <constant name="ONE" value="Vector3i(1, 1, 1)"> One vector, a vector with all components set to [code]1[/code]. </constant> - <constant name="LEFT" value="Vector3i( -1, 0, 0 )"> + <constant name="LEFT" value="Vector3i(-1, 0, 0)"> Left unit vector. Represents the local direction of left, and the global direction of west. </constant> - <constant name="RIGHT" value="Vector3i( 1, 0, 0 )"> + <constant name="RIGHT" value="Vector3i(1, 0, 0)"> Right unit vector. Represents the local direction of right, and the global direction of east. </constant> - <constant name="UP" value="Vector3i( 0, 1, 0 )"> + <constant name="UP" value="Vector3i(0, 1, 0)"> Up unit vector. </constant> - <constant name="DOWN" value="Vector3i( 0, -1, 0 )"> + <constant name="DOWN" value="Vector3i(0, -1, 0)"> Down unit vector. </constant> - <constant name="FORWARD" value="Vector3i( 0, 0, -1 )"> + <constant name="FORWARD" value="Vector3i(0, 0, -1)"> Forward unit vector. Represents the local direction of forward, and the global direction of north. </constant> - <constant name="BACK" value="Vector3i( 0, 0, 1 )"> + <constant name="BACK" value="Vector3i(0, 0, 1)"> Back unit vector. Represents the local direction of back, and the global direction of south. </constant> </constants> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 96d63b27ad..292be34a0d 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -179,13 +179,6 @@ <description> </description> </method> - <method name="update_worlds"> - <return type="void"> - </return> - <description> - Forces update of the 2D and 3D worlds. - </description> - </method> <method name="warp_mouse"> <return type="void"> </return> diff --git a/doc/classes/VisibilityEnabler3D.xml b/doc/classes/VisibilityEnabler3D.xml deleted file mode 100644 index d78ebb55f2..0000000000 --- a/doc/classes/VisibilityEnabler3D.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler3D" inherits="VisibilityNotifier3D" version="4.0"> - <brief_description> - Enables certain nodes only when approximately visible. - </brief_description> - <description> - The VisibilityEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler3D itself. - If you just want to receive notifications, use [VisibilityNotifier3D] instead. - [b]Note:[/b] VisibilityEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. - [b]Note:[/b] VisibilityEnabler3D will not affect nodes added after scene initialization. - </description> - <tutorials> - </tutorials> - <methods> - <method name="is_enabler_enabled" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler3D.Enabler"> - </argument> - <description> - Returns whether the enabler identified by given [enum Enabler] constant is active. - </description> - </method> - <method name="set_enabler"> - <return type="void"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler3D.Enabler"> - </argument> - <argument index="1" name="enabled" type="bool"> - </argument> - <description> - Sets active state of the enabler identified by given [enum Enabler] constant. - </description> - </method> - </methods> - <members> - <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [RigidBody3D] nodes will be paused. - </member> - <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [AnimationPlayer] nodes will be paused. - </member> - </members> - <constants> - <constant name="ENABLER_PAUSE_ANIMATIONS" value="0" enum="Enabler"> - This enabler will pause [AnimationPlayer] nodes. - </constant> - <constant name="ENABLER_FREEZE_BODIES" value="1" enum="Enabler"> - This enabler will freeze [RigidBody3D] nodes. - </constant> - <constant name="ENABLER_MAX" value="2" enum="Enabler"> - Represents the size of the [enum Enabler] enum. - </constant> - </constants> -</class> diff --git a/doc/classes/VisibilityNotifier3D.xml b/doc/classes/VisibilityNotifier3D.xml deleted file mode 100644 index e5d3116612..0000000000 --- a/doc/classes/VisibilityNotifier3D.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier3D" inherits="Node3D" version="4.0"> - <brief_description> - Detects approximately when the node is visible on screen. - </brief_description> - <description> - The VisibilityNotifier3D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera3D]'s view. - If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler3D] instead. - [b]Note:[/b] VisibilityNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. - </description> - <tutorials> - </tutorials> - <methods> - <method name="is_on_screen" qualifiers="const"> - <return type="bool"> - </return> - <description> - If [code]true[/code], the bounding box is on the screen. - [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. - </description> - </method> - </methods> - <members> - <member name="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB( -1, -1, -1, 2, 2, 2 )"> - The VisibilityNotifier3D's bounding box. - </member> - </members> - <signals> - <signal name="camera_entered"> - <argument index="0" name="camera" type="Camera3D"> - </argument> - <description> - Emitted when the VisibilityNotifier3D enters a [Camera3D]'s view. - </description> - </signal> - <signal name="camera_exited"> - <argument index="0" name="camera" type="Camera3D"> - </argument> - <description> - Emitted when the VisibilityNotifier3D exits a [Camera3D]'s view. - </description> - </signal> - <signal name="screen_entered"> - <description> - Emitted when the VisibilityNotifier3D enters the screen. - </description> - </signal> - <signal name="screen_exited"> - <description> - Emitted when the VisibilityNotifier3D exits the screen. - </description> - </signal> - </signals> - <constants> - </constants> -</class> diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibleOnScreenEnabler2D.xml index 8eb16ba075..c6ae8227d2 100644 --- a/doc/classes/VisibilityEnabler2D.xml +++ b/doc/classes/VisibleOnScreenEnabler2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler2D" inherits="VisibilityNotifier2D" version="4.0"> +<class name="VisibleOnScreenEnabler2D" inherits="VisibleOnScreenNotifier2D" version="4.0"> <brief_description> </brief_description> <description> @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibilityEnabler2D.EnableMode" default="0"> + <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler2D.EnableMode" default="0"> </member> <member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath("..")"> </member> diff --git a/doc/classes/VisibleOnScreenEnabler3D.xml b/doc/classes/VisibleOnScreenEnabler3D.xml new file mode 100644 index 0000000000..3205d6b415 --- /dev/null +++ b/doc/classes/VisibleOnScreenEnabler3D.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenEnabler3D" inherits="VisibleOnScreenNotifier3D" version="4.0"> + <brief_description> + Enables certain nodes only when approximately visible. + </brief_description> + <description> + The VisibleOnScreenEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibleOnScreenEnabler3D itself. + If you just want to receive notifications, use [VisibleOnScreenNotifier3D] instead. + [b]Note:[/b] VisibleOnScreenEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. + [b]Note:[/b] VisibleOnScreenEnabler3D will not affect nodes added after scene initialization. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler3D.EnableMode" default="0"> + </member> + <member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath("..")"> + </member> + </members> + <constants> + <constant name="ENABLE_MODE_INHERIT" value="0" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_ALWAYS" value="1" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_WHEN_PAUSED" value="2" enum="EnableMode"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibleOnScreenNotifier2D.xml index 78983e74ee..daad200ca8 100644 --- a/doc/classes/VisibilityNotifier2D.xml +++ b/doc/classes/VisibleOnScreenNotifier2D.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier2D" inherits="Node2D" version="4.0"> +<class name="VisibleOnScreenNotifier2D" inherits="Node2D" version="4.0"> <brief_description> Detects when the node extents are visible on screen. </brief_description> <description> - The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. - If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler2D] instead. + The VisibleOnScreenNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. + If you want nodes to be disabled automatically when they exit the screen, use [VisibleOnScreenEnabler2D] instead. </description> <tutorials> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> @@ -21,19 +21,19 @@ </method> </methods> <members> - <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2( -10, -10, 20, 20 )"> - The VisibilityNotifier2D's bounding rectangle. + <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2(-10, -10, 20, 20)"> + The VisibleOnScreenNotifier2D's bounding rectangle. </member> </members> <signals> <signal name="screen_entered"> <description> - Emitted when the VisibilityNotifier2D enters the screen. + Emitted when the VisibleOnScreenNotifier2D enters the screen. </description> </signal> <signal name="screen_exited"> <description> - Emitted when the VisibilityNotifier2D exits the screen. + Emitted when the VisibleOnScreenNotifier2D exits the screen. </description> </signal> </signals> diff --git a/doc/classes/VisibleOnScreenNotifier3D.xml b/doc/classes/VisibleOnScreenNotifier3D.xml new file mode 100644 index 0000000000..85ff324fbf --- /dev/null +++ b/doc/classes/VisibleOnScreenNotifier3D.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenNotifier3D" inherits="VisualInstance3D" version="4.0"> + <brief_description> + Detects approximately when the node is visible on screen. + </brief_description> + <description> + The VisibleOnScreenNotifier3D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera3D]'s view. + If you want nodes to be disabled automatically when they exit the screen, use [VisibleOnScreenEnabler3D] instead. + [b]Note:[/b] VisibleOnScreenNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="is_on_screen" qualifiers="const"> + <return type="bool"> + </return> + <description> + If [code]true[/code], the bounding box is on the screen. + [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. + </description> + </method> + </methods> + <members> + <member name="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB(-1, -1, -1, 2, 2, 2)"> + The VisibleOnScreenNotifier3D's bounding box. + </member> + </members> + <signals> + <signal name="screen_entered"> + <description> + Emitted when the VisibleOnScreenNotifier3D enters the screen. + </description> + </signal> + <signal name="screen_exited"> + <description> + Emitted when the VisibleOnScreenNotifier3D exits the screen. + </description> + </signal> + </signals> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml index 775ac88eff..19b4acd8f1 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -206,7 +206,7 @@ </method> </methods> <members> - <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2( 0, 0 )"> + <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2(0, 0)"> The offset vector of the whole graph. </member> <member name="version" type="String" setter="set_version" getter="get_version" default=""""> diff --git a/doc/classes/VisualShaderNodeColorConstant.xml b/doc/classes/VisualShaderNodeColorConstant.xml index 8644013ef2..fa1a11c488 100644 --- a/doc/classes/VisualShaderNodeColorConstant.xml +++ b/doc/classes/VisualShaderNodeColorConstant.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="constant" type="Color" setter="set_constant" getter="get_constant" default="Color( 1, 1, 1, 1 )"> + <member name="constant" type="Color" setter="set_constant" getter="get_constant" default="Color(1, 1, 1, 1)"> A [Color] constant which represents a state of this node. </member> </members> diff --git a/doc/classes/VisualShaderNodeColorUniform.xml b/doc/classes/VisualShaderNodeColorUniform.xml index 90ef381b76..bdaf301f09 100644 --- a/doc/classes/VisualShaderNodeColorUniform.xml +++ b/doc/classes/VisualShaderNodeColorUniform.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="default_value" type="Color" setter="set_default_value" getter="get_default_value" default="Color( 1, 1, 1, 1 )"> + <member name="default_value" type="Color" setter="set_default_value" getter="get_default_value" default="Color(1, 1, 1, 1)"> A default value to be assigned within the shader. </member> <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false"> diff --git a/doc/classes/VisualShaderNodeResizableBase.xml b/doc/classes/VisualShaderNodeResizableBase.xml index 9f827a96cc..9052f6854b 100644 --- a/doc/classes/VisualShaderNodeResizableBase.xml +++ b/doc/classes/VisualShaderNodeResizableBase.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )"> + <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node in the visual shader graph. </member> </members> diff --git a/doc/classes/VisualShaderNodeTransformConstant.xml b/doc/classes/VisualShaderNodeTransformConstant.xml index 550ed829c9..30178752d0 100644 --- a/doc/classes/VisualShaderNodeTransformConstant.xml +++ b/doc/classes/VisualShaderNodeTransformConstant.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="constant" type="Transform3D" setter="set_constant" getter="get_constant" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="constant" type="Transform3D" setter="set_constant" getter="get_constant" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> A [Transform3D] constant which represents the state of this node. </member> </members> diff --git a/doc/classes/VisualShaderNodeTransformUniform.xml b/doc/classes/VisualShaderNodeTransformUniform.xml index 1f1cc4b630..2f7818ec8a 100644 --- a/doc/classes/VisualShaderNodeTransformUniform.xml +++ b/doc/classes/VisualShaderNodeTransformUniform.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="default_value" type="Transform3D" setter="set_default_value" getter="get_default_value" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="default_value" type="Transform3D" setter="set_default_value" getter="get_default_value" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> A default value to be assigned within the shader. </member> <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false"> diff --git a/doc/classes/VisualShaderNodeVec3Constant.xml b/doc/classes/VisualShaderNodeVec3Constant.xml index b01bb514fe..28c3d22345 100644 --- a/doc/classes/VisualShaderNodeVec3Constant.xml +++ b/doc/classes/VisualShaderNodeVec3Constant.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="constant" type="Vector3" setter="set_constant" getter="get_constant" default="Vector3( 0, 0, 0 )"> + <member name="constant" type="Vector3" setter="set_constant" getter="get_constant" default="Vector3(0, 0, 0)"> A [Vector3] constant which represents the state of this node. </member> </members> diff --git a/doc/classes/VisualShaderNodeVec3Uniform.xml b/doc/classes/VisualShaderNodeVec3Uniform.xml index cd1500f5a1..215e2cfbea 100644 --- a/doc/classes/VisualShaderNodeVec3Uniform.xml +++ b/doc/classes/VisualShaderNodeVec3Uniform.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="default_value" type="Vector3" setter="set_default_value" getter="get_default_value" default="Vector3( 0, 0, 0 )"> + <member name="default_value" type="Vector3" setter="set_default_value" getter="get_default_value" default="Vector3(0, 0, 0)"> A default value to be assigned within the shader. </member> <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false"> diff --git a/doc/classes/VoxelGI.xml b/doc/classes/VoxelGI.xml index fa5035349e..5b395becb7 100644 --- a/doc/classes/VoxelGI.xml +++ b/doc/classes/VoxelGI.xml @@ -36,7 +36,7 @@ <member name="data" type="VoxelGIData" setter="set_probe_data" getter="get_probe_data"> The [VoxelGIData] resource that holds the data for this [VoxelGI]. </member> - <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )"> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)"> The size of the area covered by the [VoxelGI]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting. </member> <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="VoxelGI.Subdiv" default="1"> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 9c320747d1..6ae5a5f449 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -218,7 +218,7 @@ <method name="popup"> <return type="void"> </return> - <argument index="0" name="rect" type="Rect2i" default="Rect2i( 0, 0, 0, 0 )"> + <argument index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)"> </argument> <description> </description> @@ -226,7 +226,7 @@ <method name="popup_centered"> <return type="void"> </return> - <argument index="0" name="minsize" type="Vector2i" default="Vector2i( 0, 0 )"> + <argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)"> </argument> <description> </description> @@ -234,7 +234,7 @@ <method name="popup_centered_clamped"> <return type="void"> </return> - <argument index="0" name="minsize" type="Vector2i" default="Vector2i( 0, 0 )"> + <argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)"> </argument> <argument index="1" name="fallback_ratio" type="float" default="0.75"> </argument> @@ -322,21 +322,21 @@ </member> <member name="content_scale_mode" type="int" setter="set_content_scale_mode" getter="get_content_scale_mode" enum="Window.ContentScaleMode" default="0"> </member> - <member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i( 0, 0 )"> + <member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i(0, 0)"> </member> <member name="current_screen" type="int" setter="set_current_screen" getter="get_current_screen" default="0"> </member> <member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false"> </member> - <member name="max_size" type="Vector2i" setter="set_max_size" getter="get_max_size" default="Vector2i( 0, 0 )"> + <member name="max_size" type="Vector2i" setter="set_max_size" getter="get_max_size" default="Vector2i(0, 0)"> </member> - <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" default="Vector2i( 0, 0 )"> + <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" default="Vector2i(0, 0)"> </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Window.Mode" default="0"> </member> - <member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i( 0, 0 )"> + <member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)"> </member> - <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i( 100, 100 )"> + <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)"> </member> <member name="theme" type="Theme" setter="set_theme" getter="get_theme"> </member> @@ -472,7 +472,7 @@ </theme_item> <theme_item name="scaleborder_size" type="int" default="4"> </theme_item> - <theme_item name="title_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="title_color" type="Color" default="Color(0, 0, 0, 1)"> </theme_item> <theme_item name="title_font" type="Font"> </theme_item> @@ -481,7 +481,7 @@ </theme_item> <theme_item name="title_height" type="int" default="20"> </theme_item> - <theme_item name="title_outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <theme_item name="title_outline_modulate" type="Color" default="Color(1, 1, 1, 1)"> The color of the title outline. </theme_item> <theme_item name="title_outline_size" type="int" default="0"> diff --git a/doc/classes/WorldMarginShape3D.xml b/doc/classes/WorldMarginShape3D.xml index a91447056b..9a26f254f1 100644 --- a/doc/classes/WorldMarginShape3D.xml +++ b/doc/classes/WorldMarginShape3D.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="plane" type="Plane" setter="set_plane" getter="get_plane" default="Plane( 0, 1, 0, 0 )"> + <member name="plane" type="Plane" setter="set_plane" getter="get_plane" default="Plane(0, 1, 0, 0)"> The [Plane] used by the [WorldMarginShape3D] for collision. </member> </members> diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index d12fa78b0e..f138276364 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -20685,9 +20685,9 @@ msgid "" "onready var expression = Expression.new()\n" "\n" "func _ready():\n" -" $LineEdit.connect(\"text_entered\", self, \"_on_text_entered\")\n" +" $LineEdit.connect(\"text_submitted\", self, \"_on_text_submitted\")\n" "\n" -"func _on_text_entered(command):\n" +"func _on_text_submitted(command):\n" " var error = expression.parse(command, [])\n" " if error != OK:\n" " print(expression.get_error_text())\n" @@ -33187,7 +33187,7 @@ msgid "" "Examples:\n" "[codeblock]\n" "connect(\"pressed\", self, \"_on_Button_pressed\") # BaseButton signal\n" -"connect(\"text_entered\", self, \"_on_LineEdit_text_entered\") # LineEdit " +"connect(\"text_submitted\", self, \"_on_LineEdit_text_submitted\") # LineEdit " "signal\n" "connect(\"hit\", self, \"_on_Player_hit\", [ weapon_type, damage ]) # User-" "defined signal\n" diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index cc07d589c5..b0b79ca069 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -1106,7 +1106,7 @@ ActionMapEditor::ActionMapEditor() { add_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_edit->set_placeholder(TTR("Add New Action")); add_edit->set_clear_button_enabled(true); - add_edit->connect("text_entered", callable_mp(this, &ActionMapEditor::_add_action)); + add_edit->connect("text_submitted", callable_mp(this, &ActionMapEditor::_add_action)); add_hbox->add_child(add_edit); Button *add_button = memnew(Button); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index b26b5ce595..4196bc8940 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1168,31 +1168,29 @@ public: p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); } break; case Animation::TYPE_VALUE: { - if (!same_key_type) { - break; - } + if (same_key_type) { + Variant v = animation->track_get_key_value(first_track, first_key); - Variant v = animation->track_get_key_value(first_track, first_key); - - if (hint.type != Variant::NIL) { - PropertyInfo pi = hint; - pi.name = "value"; - p_list->push_back(pi); - } else { - PropertyHint hint = PROPERTY_HINT_NONE; - String hint_string; - - if (v.get_type() == Variant::OBJECT) { - //could actually check the object property if exists..? yes i will! - Ref<Resource> res = v; - if (res.is_valid()) { - hint = PROPERTY_HINT_RESOURCE_TYPE; - hint_string = res->get_class(); + if (hint.type != Variant::NIL) { + PropertyInfo pi = hint; + pi.name = "value"; + p_list->push_back(pi); + } else { + PropertyHint hint = PROPERTY_HINT_NONE; + String hint_string; + + if (v.get_type() == Variant::OBJECT) { + //could actually check the object property if exists..? yes i will! + Ref<Resource> res = v; + if (res.is_valid()) { + hint = PROPERTY_HINT_RESOURCE_TYPE; + hint_string = res->get_class(); + } } - } - if (v.get_type() != Variant::NIL) { - p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); + if (v.get_type() != Variant::NIL) { + p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); + } } } @@ -2380,7 +2378,7 @@ void AnimationTrackEdit::_zoom_changed() { play_position->update(); } -void AnimationTrackEdit::_path_entered(const String &p_text) { +void AnimationTrackEdit::_path_submitted(const String &p_text) { undo_redo->create_action(TTR("Change Track Path")); undo_redo->add_do_method(animation.ptr(), "track_set_path", track, p_text); undo_redo->add_undo_method(animation.ptr(), "track_set_path", track, animation->track_get_path(track)); @@ -2755,7 +2753,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { path = memnew(LineEdit); path_popup->add_child(path); path->set_anchors_and_offsets_preset(PRESET_WIDE); - path->connect("text_entered", callable_mp(this, &AnimationTrackEdit::_path_entered)); + path->connect("text_submitted", callable_mp(this, &AnimationTrackEdit::_path_submitted)); } path->set_text(animation->track_get_path(track)); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index d083235c68..6d977e5a3f 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -177,7 +177,7 @@ class AnimationTrackEdit : public Control { void _menu_selected(int p_index); - void _path_entered(const String &p_text); + void _path_submitted(const String &p_text); void _play_position_draw(); bool _is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const; diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 7b96858ec7..807a45eb32 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -539,7 +539,7 @@ void FindReplaceBar::_search_text_changed(const String &p_text) { search_current(); } -void FindReplaceBar::_search_text_entered(const String &p_text) { +void FindReplaceBar::_search_text_submitted(const String &p_text) { if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { search_prev(); } else { @@ -547,7 +547,7 @@ void FindReplaceBar::_search_text_entered(const String &p_text) { } } -void FindReplaceBar::_replace_text_entered(const String &p_text) { +void FindReplaceBar::_replace_text_submitted(const String &p_text) { if (selection_only->is_pressed() && text_editor->is_selection_active()) { _replace_all(); _hide_bar(); @@ -643,7 +643,7 @@ FindReplaceBar::FindReplaceBar() { vbc_lineedit->add_child(search_text); search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->connect("text_changed", callable_mp(this, &FindReplaceBar::_search_text_changed)); - search_text->connect("text_entered", callable_mp(this, &FindReplaceBar::_search_text_entered)); + search_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_search_text_submitted)); matches_label = memnew(Label); hbc_button_search->add_child(matches_label); @@ -677,7 +677,7 @@ FindReplaceBar::FindReplaceBar() { replace_text = memnew(LineEdit); vbc_lineedit->add_child(replace_text); replace_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - replace_text->connect("text_entered", callable_mp(this, &FindReplaceBar::_replace_text_entered)); + replace_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_replace_text_submitted)); replace = memnew(Button); hbc_button_replace->add_child(replace); @@ -940,7 +940,7 @@ void CodeTextEditor::update_editor_settings() { text_editor->set_draw_line_numbers(EditorSettings::get_singleton()->get("text_editor/appearance/show_line_numbers")); text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/appearance/line_numbers_zero_padded")); text_editor->set_draw_bookmarks_gutter(EditorSettings::get_singleton()->get("text_editor/appearance/show_bookmark_gutter")); - text_editor->set_hiding_enabled(EditorSettings::get_singleton()->get("text_editor/appearance/code_folding")); + text_editor->set_line_folding_enabled(EditorSettings::get_singleton()->get("text_editor/appearance/code_folding")); text_editor->set_draw_fold_gutter(EditorSettings::get_singleton()->get("text_editor/appearance/code_folding")); text_editor->set_wrap_enabled(EditorSettings::get_singleton()->get("text_editor/appearance/word_wrap")); text_editor->set_show_line_length_guidelines(EditorSettings::get_singleton()->get("text_editor/appearance/show_line_length_guidelines")); @@ -1502,6 +1502,7 @@ void CodeTextEditor::set_error_pos(int p_line, int p_column) { void CodeTextEditor::goto_error() { if (error->get_text() != "") { + text_editor->unfold_line(error_line); text_editor->cursor_set_line(error_line); text_editor->cursor_set_column(error_column); text_editor->center_viewport_to_cursor(); diff --git a/editor/code_editor.h b/editor/code_editor.h index 9fc659b611..f368305e85 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -99,8 +99,8 @@ class FindReplaceBar : public HBoxContainer { void _editor_text_changed(); void _search_options_changed(bool p_pressed); void _search_text_changed(const String &p_text); - void _search_text_entered(const String &p_text); - void _replace_text_entered(const String &p_text); + void _search_text_submitted(const String &p_text); + void _replace_text_submitted(const String &p_text); void _update_size(); protected: diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index a17b1aec10..de6407da73 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -146,7 +146,7 @@ void ConnectDialog::_item_activated() { _ok_pressed(); // From AcceptDialog. } -void ConnectDialog::_text_entered(const String &p_text) { +void ConnectDialog::_text_submitted(const String &p_text) { _ok_pressed(); // From AcceptDialog. } @@ -471,7 +471,7 @@ ConnectDialog::ConnectDialog() { dst_method = memnew(LineEdit); dst_method->set_h_size_flags(Control::SIZE_EXPAND_FILL); - dst_method->connect("text_entered", callable_mp(this, &ConnectDialog::_text_entered)); + dst_method->connect("text_submitted", callable_mp(this, &ConnectDialog::_text_submitted)); dstm_hb->add_child(dst_method); advanced = memnew(CheckButton); diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 18feba0a61..b9911c1cc5 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -105,7 +105,7 @@ private: void ok_pressed() override; void _cancel_pressed(); void _item_activated(); - void _text_entered(const String &_text); + void _text_submitted(const String &_text); void _tree_node_selected(); void _add_bind(); void _remove_bind(); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 13296e2f23..e08334c00e 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -782,7 +782,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { set_v_size_flags(SIZE_EXPAND_FILL); track_name = memnew(LineEdit); - track_name->connect("text_entered", callable_mp(this, &EditorAudioBus::_name_changed)); + track_name->connect("text_submitted", callable_mp(this, &EditorAudioBus::_name_changed)); track_name->connect("focus_exited", callable_mp(this, &EditorAudioBus::_name_focus_exit)); vb->add_child(track_name); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 1a09b1ac7b..304c2fe532 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -327,7 +327,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) { add_autoload->set_disabled(false); } -void EditorAutoloadSettings::_autoload_text_entered(const String p_name) { +void EditorAutoloadSettings::_autoload_text_submitted(const String p_name) { if (autoload_add_path->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) { _autoload_add(); } @@ -859,7 +859,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { autoload_add_name = memnew(LineEdit); autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL); - autoload_add_name->connect("text_entered", callable_mp(this, &EditorAutoloadSettings::_autoload_text_entered)); + autoload_add_name->connect("text_submitted", callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted)); autoload_add_name->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_text_changed)); hbc->add_child(autoload_add_name); @@ -916,7 +916,7 @@ EditorAutoloadSettings::~EditorAutoloadSettings() { void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) { autoload_add_path->set_text(p_text); - autoload_add_path->emit_signal("text_entered", p_text); + autoload_add_path->emit_signal("text_submitted", p_text); } void EditorAutoloadSettings::_browse_autoload_add_path() { diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 762457463c..b709728856 100644 --- a/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h @@ -81,7 +81,7 @@ class EditorAutoloadSettings : public VBoxContainer { void _autoload_button_pressed(Object *p_item, int p_column, int p_button); void _autoload_activated(); void _autoload_path_text_changed(const String p_path); - void _autoload_text_entered(const String p_name); + void _autoload_text_submitted(const String p_name); void _autoload_text_changed(const String p_name); void _autoload_open(const String &fpath); void _autoload_file_callback(const String &p_path); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 991d76ce72..f3cee7576d 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -230,14 +230,14 @@ void EditorFileDialog::update_dir() { } } -void EditorFileDialog::_dir_entered(String p_dir) { +void EditorFileDialog::_dir_submitted(String p_dir) { dir_access->change_dir(p_dir); invalidate(); update_dir(); _push_history(); } -void EditorFileDialog::_file_entered(const String &p_file) { +void EditorFileDialog::_file_submitted(const String &p_file) { _action_pressed(); } @@ -1676,8 +1676,8 @@ EditorFileDialog::EditorFileDialog() { item_list->connect("multi_selected", callable_mp(this, &EditorFileDialog::_multi_selected), varray(), CONNECT_DEFERRED); item_list->connect("item_activated", callable_mp(this, &EditorFileDialog::_item_dc_selected), varray()); item_list->connect("nothing_selected", callable_mp(this, &EditorFileDialog::_items_clear_selection)); - dir->connect("text_entered", callable_mp(this, &EditorFileDialog::_dir_entered)); - file->connect("text_entered", callable_mp(this, &EditorFileDialog::_file_entered)); + dir->connect("text_submitted", callable_mp(this, &EditorFileDialog::_dir_submitted)); + file->connect("text_submitted", callable_mp(this, &EditorFileDialog::_file_submitted)); filter->connect("item_selected", callable_mp(this, &EditorFileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index f7879838d4..d789956a3e 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -167,8 +167,8 @@ private: void _item_menu_id_pressed(int p_option); void _select_drive(int p_idx); - void _dir_entered(String p_dir); - void _file_entered(const String &p_file); + void _dir_submitted(String p_dir); + void _file_submitted(const String &p_file); void _action_pressed(); void _save_confirm_pressed(); void _cancel_pressed(); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index c61b097ccd..3f715c1f93 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1475,8 +1475,6 @@ void EditorFileSystem::update_file(const String &p_file) { if (cpos == -1) { // The file did not exist, it was added. - - late_added_files.insert(p_file); // Remember that it was added. This mean it will be scanned and imported on editor restart. int idx = 0; String file_name = p_file.get_file(); @@ -1723,9 +1721,6 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName } } } - - } else { - late_added_files.insert(p_file); //imported files do not call update_file(), but just in case.. } if (importer_name == "keep") { diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 04879bad6d..37eee13c16 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -148,7 +148,6 @@ class EditorFileSystem : public Node { void _scan_filesystem(); - Set<String> late_added_files; //keep track of files that were added, these will be re-scanned Set<String> late_update_files; void _save_late_updated_files(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 9361981db6..7365e8fd7d 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1761,7 +1761,7 @@ FindBar::FindBar() { search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->set_h_size_flags(SIZE_EXPAND_FILL); search_text->connect("text_changed", callable_mp(this, &FindBar::_search_text_changed)); - search_text->connect("text_entered", callable_mp(this, &FindBar::_search_text_entered)); + search_text->connect("text_submitted", callable_mp(this, &FindBar::_search_text_submitted)); matches_label = memnew(Label); add_child(matches_label); @@ -1849,9 +1849,6 @@ bool FindBar::_search(bool p_search_previous) { bool keep = prev_search == stext; bool ret = rich_text_label->search(stext, keep, p_search_previous); - if (!ret) { - ret = rich_text_label->search(stext, false, p_search_previous); - } prev_search = stext; @@ -1878,7 +1875,7 @@ void FindBar::_update_results_count() { int from_pos = 0; while (true) { - int pos = full_text.find(searched, from_pos); + int pos = full_text.findn(searched, from_pos); if (pos == -1) { break; } @@ -1935,7 +1932,7 @@ void FindBar::_search_text_changed(const String &p_text) { search_next(); } -void FindBar::_search_text_entered(const String &p_text) { +void FindBar::_search_text_submitted(const String &p_text) { if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { search_prev(); } else { diff --git a/editor/editor_help.h b/editor/editor_help.h index 65e20f060c..69bb72c52d 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -61,7 +61,7 @@ class FindBar : public HBoxContainer { void _hide_bar(); void _search_text_changed(const String &p_text); - void _search_text_entered(const String &p_text); + void _search_text_submitted(const String &p_text); void _update_results_count(); void _update_matches_label(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b6df9f6088..657ec9d70b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -609,7 +609,7 @@ void EditorNode::_notification(int p_what) { } break; case NOTIFICATION_APPLICATION_FOCUS_IN: { - // Restore the original FPS cap after focusing back on the editor + // Restore the original FPS cap after focusing back on the editor. OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); EditorFileSystem::get_singleton()->scan_changes(); @@ -617,7 +617,12 @@ void EditorNode::_notification(int p_what) { } break; case NOTIFICATION_APPLICATION_FOCUS_OUT: { - // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused + // Save on focus loss before applying the FPS limit to avoid slowing down the saving process. + if (EDITOR_GET("interface/editor/save_on_focus_loss")) { + _menu_option_confirm(FILE_SAVE_SCENE, false); + } + + // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused. OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); } break; @@ -2403,11 +2408,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } } break; - case FILE_CLOSE_ALL_AND_QUIT: - case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER: case FILE_CLOSE: { + _scene_tab_closed(editor_data.get_edited_scene()); + } break; + case FILE_CLOSE_ALL_AND_QUIT: + case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER: { if (!p_confirmed) { - tab_closing = p_option == FILE_CLOSE ? editor_data.get_edited_scene() : _next_unsaved_scene(false); + tab_closing = _next_unsaved_scene(false); _scene_tab_changed(tab_closing); if (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) { @@ -2420,8 +2427,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } } - } else if (p_option == FILE_CLOSE) { - tab_closing = editor_data.get_edited_scene(); } if (!editor_data.get_edited_scene_root(tab_closing)) { // empty tab @@ -5689,36 +5694,10 @@ EditorNode::EditorNode() { int display_scale = EditorSettings::get_singleton()->get("interface/editor/display_scale"); switch (display_scale) { - case 0: { + case 0: // Try applying a suitable display scale automatically. - // The code below is adapted in `editor/editor_settings.cpp` and `editor/project_manager.cpp`. - // Make sure to update those when modifying the code below. -#ifdef OSX_ENABLED - editor_set_scale(DisplayServer::get_singleton()->screen_get_max_scale()); -#else - const int screen = DisplayServer::get_singleton()->window_get_current_screen(); - // Use the smallest dimension to use a correct display scale on portait displays. - const int smallest_dimension = MIN(DisplayServer::get_singleton()->screen_get_size(screen).x, DisplayServer::get_singleton()->screen_get_size(screen).y); - float scale; - if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && smallest_dimension >= 1400) { - // hiDPI display. - scale = 2.0; - } else if (smallest_dimension >= 1700) { - // Likely a hiDPI display, but we aren't certain due to the returned DPI. - // Use an intermediate scale to handle this situation. - scale = 1.5; - } else if (smallest_dimension <= 800) { - // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. - // Icons won't look great, but this is better than having editor elements overflow from its window. - scale = 0.75; - } else { - scale = 1.0; - } - - editor_set_scale(scale); -#endif - } break; - + editor_set_scale(EditorSettings::get_singleton()->get_auto_display_scale()); + break; case 1: editor_set_scale(0.75); break; @@ -5871,6 +5850,7 @@ EditorNode::EditorNode() { EDITOR_DEF("run/output/always_open_output_on_play", true); EDITOR_DEF("run/output/always_close_output_on_stop", true); EDITOR_DEF("run/auto_save/save_before_running", true); + EDITOR_DEF("interface/editor/save_on_focus_loss", false); EDITOR_DEF_RST("interface/editor/save_each_scene_on_quit", true); EDITOR_DEF("interface/editor/show_update_spinner", false); EDITOR_DEF("interface/editor/update_continuously", false); diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 323707ec6c..c9817190dd 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -186,7 +186,7 @@ EditorPaths::EditorPaths() { // Validate or create project-specific editor data dir (`res://.godot`), // including shader cache subdir. - if (Main::is_project_manager()) { + if (Main::is_project_manager() || Main::is_cmdline_tool()) { // Nothing to create, use shared editor data dir for shader cache. Engine::get_singleton()->set_shader_cache_path(data_dir); } else { @@ -209,6 +209,4 @@ EditorPaths::EditorPaths() { dir_res->make_dir(ProjectSettings::IMPORTED_FILES_PATH); } } - - print_line("paths valid: " + itos((int)paths_valid)); } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index fd3cf662a9..3feeaec070 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -51,7 +51,7 @@ EditorPropertyNil::EditorPropertyNil() { ///////////////////// TEXT ///////////////////////// -void EditorPropertyText::_text_entered(const String &p_string) { +void EditorPropertyText::_text_submitted(const String &p_string) { if (updating) { return; } @@ -100,7 +100,7 @@ EditorPropertyText::EditorPropertyText() { add_child(text); add_focusable(text); text->connect("text_changed", callable_mp(this, &EditorPropertyText::_text_changed)); - text->connect("text_entered", callable_mp(this, &EditorPropertyText::_text_entered)); + text->connect("text_submitted", callable_mp(this, &EditorPropertyText::_text_submitted)); string_name = false; updating = false; @@ -297,7 +297,7 @@ EditorPropertyPath::EditorPropertyPath() { path = memnew(LineEdit); path->set_structured_text_bidi_override(Control::STRUCTURED_TEXT_FILE); path_hb->add_child(path); - path->connect("text_entered", callable_mp(this, &EditorPropertyPath::_path_selected)); + path->connect("text_submitted", callable_mp(this, &EditorPropertyPath::_path_selected)); path->connect("focus_exited", callable_mp(this, &EditorPropertyPath::_path_focus_exited)); path->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 121848d936..dcde7dda3d 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -56,7 +56,7 @@ class EditorPropertyText : public EditorProperty { bool updating; bool string_name; void _text_changed(const String &p_string); - void _text_entered(const String &p_string); + void _text_submitted(const String &p_string); protected: static void _bind_methods(); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 1ea8c71f85..b591007a93 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -644,7 +644,7 @@ void EditorResourcePicker::_bind_methods() { ClassDB::add_virtual_method(get_class_static(), MethodInfo("_handle_menu_selected", PropertyInfo(Variant::INT, "id"))); ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type"), "set_base_type", "get_base_type"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource", 0), "set_edited_resource", "get_edited_resource"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource", PROPERTY_USAGE_NONE), "set_edited_resource", "get_edited_resource"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editable"), "set_editable", "is_editable"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode"); @@ -857,7 +857,7 @@ void EditorScriptPicker::_bind_methods() { ClassDB::bind_method(D_METHOD("set_script_owner", "owner_node"), &EditorScriptPicker::set_script_owner); ClassDB::bind_method(D_METHOD("get_script_owner"), &EditorScriptPicker::get_script_owner); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "script_owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_script_owner", "get_script_owner"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "script_owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_script_owner", "get_script_owner"); } EditorScriptPicker::EditorScriptPicker() { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d81c94bd35..3f66326b41 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -373,30 +373,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Editor _initial_set("interface/editor/display_scale", 0); // Display what the Auto display scale setting effectively corresponds to. - // The code below is adapted in `editor/editor_node.cpp` and `editor/project_manager.cpp`. - // Make sure to update those when modifying the code below. -#ifdef OSX_ENABLED - float scale = DisplayServer::get_singleton()->screen_get_max_scale(); -#else - const int screen = DisplayServer::get_singleton()->window_get_current_screen(); - // Use the smallest dimension to use a correct display scale on portait displays. - const int smallest_dimension = MIN(DisplayServer::get_singleton()->screen_get_size(screen).x, DisplayServer::get_singleton()->screen_get_size(screen).y); - float scale; - if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && smallest_dimension >= 1400) { - // hiDPI display. - scale = 2.0; - } else if (smallest_dimension <= 1700) { - // Likely a hiDPI display, but we aren't certain due to the returned DPI. - // Use an intermediate scale to handle this situation. - scale = 1.5; - } else if (smallest_dimension <= 800) { - // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. - // Icons won't look great, but this is better than having editor elements overflow from its window. - scale = 0.75; - } else { - scale = 1.0; - } -#endif + float scale = get_auto_display_scale(); hints["interface/editor/display_scale"] = PropertyInfo(Variant::INT, "interface/editor/display_scale", PROPERTY_HINT_ENUM, vformat("Auto (%d%%),75%%,100%%,125%%,150%%,175%%,200%%,Custom", Math::round(scale * 100)), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/custom_display_scale", 1.0f); hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::FLOAT, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); @@ -423,8 +400,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/low_processor_mode_sleep_usec", 6900); // ~144 FPS hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS - hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 100000); // 10 FPS + // Allow an unfocused FPS limit as low as 1 FPS for those who really need low power usage + // (but don't need to preview particles or shaders while the editor is unfocused). + // With very low FPS limits, the editor can take a small while to become usable after being focused again, + // so this should be used at the user's discretion. + hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,1000000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/separate_distraction_mode", false); _initial_set("interface/editor/automatically_open_screenshots", true); _initial_set("interface/editor/single_window_mode", false); @@ -1447,6 +1428,29 @@ String EditorSettings::get_editor_layouts_config() const { return EditorPaths::get_singleton()->get_config_dir().plus_file("editor_layouts.cfg"); } +float EditorSettings::get_auto_display_scale() const { +#ifdef OSX_ENABLED + return DisplayServer::get_singleton()->screen_get_max_scale(); +#else + const int screen = DisplayServer::get_singleton()->window_get_current_screen(); + // Use the smallest dimension to use a correct display scale on portait displays. + const int smallest_dimension = MIN(DisplayServer::get_singleton()->screen_get_size(screen).x, DisplayServer::get_singleton()->screen_get_size(screen).y); + if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && smallest_dimension >= 1400) { + // hiDPI display. + return 2.0; + } else if (smallest_dimension >= 1700) { + // Likely a hiDPI display, but we aren't certain due to the returned DPI. + // Use an intermediate scale to handle this situation. + return 1.5; + } else if (smallest_dimension <= 800) { + // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. + // Icons won't look great, but this is better than having editor elements overflow from its window. + return 0.75; + } + return 1.0; +#endif +} + // Shortcuts void EditorSettings::add_shortcut(const String &p_name, Ref<Shortcut> &p_shortcut) { diff --git a/editor/editor_settings.h b/editor/editor_settings.h index d6a9a9d1b9..3a28c18b27 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -174,6 +174,7 @@ public: Vector<String> get_script_templates(const String &p_extension, const String &p_custom_path = String()); String get_editor_layouts_config() const; + float get_auto_display_scale() const; void add_shortcut(const String &p_name, Ref<Shortcut> &p_shortcut); bool is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const; diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 657dcfa760..4f0d75ecce 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -386,8 +386,8 @@ void EditorSpinSlider::_evaluate_input_text() { set_value(v); } -//text_entered signal -void EditorSpinSlider::_value_input_entered(const String &p_text) { +//text_submitted signal +void EditorSpinSlider::_value_input_submitted(const String &p_text) { value_input_just_closed = true; value_input_popup->hide(); } @@ -510,7 +510,7 @@ EditorSpinSlider::EditorSpinSlider() { value_input_popup->set_wrap_controls(true); value_input->set_anchors_and_offsets_preset(PRESET_WIDE); value_input_popup->connect("popup_hide", callable_mp(this, &EditorSpinSlider::_value_input_closed)); - value_input->connect("text_entered", callable_mp(this, &EditorSpinSlider::_value_input_entered)); + value_input->connect("text_submitted", callable_mp(this, &EditorSpinSlider::_value_input_submitted)); value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited)); value_input_just_closed = false; hide_slider = false; diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h index 248a13f7b6..50d04c9583 100644 --- a/editor/editor_spin_slider.h +++ b/editor/editor_spin_slider.h @@ -68,7 +68,7 @@ class EditorSpinSlider : public Range { void _grabber_gui_input(const Ref<InputEvent> &p_event); void _value_input_closed(); - void _value_input_entered(const String &); + void _value_input_submitted(const String &); void _value_focus_exited(); bool hide_slider; bool flat; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 46bb6a1632..fe1fa9f9d6 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -365,7 +365,7 @@ void FileSystemDock::_notification(int p_what) { file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option)); tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option)); - current_path->connect("text_entered", callable_mp(this, &FileSystemDock::_navigate_to_path), make_binds(false)); + current_path->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path), make_binds(false)); always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 17d24a295c..c29b5d5906 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -311,7 +311,7 @@ FindInFilesDialog::FindInFilesDialog() { _search_text_line_edit = memnew(LineEdit); _search_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); _search_text_line_edit->connect("text_changed", callable_mp(this, &FindInFilesDialog::_on_search_text_modified)); - _search_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_search_text_entered)); + _search_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_search_text_submitted)); gc->add_child(_search_text_line_edit); _replace_label = memnew(Label); @@ -321,7 +321,7 @@ FindInFilesDialog::FindInFilesDialog() { _replace_text_line_edit = memnew(LineEdit); _replace_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); - _replace_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_replace_text_entered)); + _replace_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_replace_text_submitted)); _replace_text_line_edit->hide(); gc->add_child(_replace_text_line_edit); @@ -503,7 +503,7 @@ void FindInFilesDialog::_on_search_text_modified(String text) { _replace_button->set_disabled(get_search_text().is_empty()); } -void FindInFilesDialog::_on_search_text_entered(String text) { +void FindInFilesDialog::_on_search_text_submitted(String text) { // This allows to trigger a global search without leaving the keyboard if (!_find_button->is_disabled()) { if (_mode == SEARCH_MODE) { @@ -518,7 +518,7 @@ void FindInFilesDialog::_on_search_text_entered(String text) { } } -void FindInFilesDialog::_on_replace_text_entered(String text) { +void FindInFilesDialog::_on_replace_text_submitted(String text) { // This allows to trigger a global search without leaving the keyboard if (!_replace_button->is_disabled()) { if (_mode == REPLACE_MODE) { diff --git a/editor/find_in_files.h b/editor/find_in_files.h index b9d60a8d4f..488f14a922 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -128,8 +128,8 @@ private: void _on_folder_button_pressed(); void _on_folder_selected(String path); void _on_search_text_modified(String text); - void _on_search_text_entered(String text); - void _on_replace_text_entered(String text); + void _on_search_text_submitted(String text); + void _on_replace_text_submitted(String text); FindInFilesMode _mode; LineEdit *_search_text_line_edit; diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index d8e5a05c5d..1b11ec4451 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -446,7 +446,7 @@ GroupDialog::GroupDialog() { add_group_text = memnew(LineEdit); chbc->add_child(add_group_text); add_group_text->set_h_size_flags(Control::SIZE_EXPAND_FILL); - add_group_text->connect("text_entered", callable_mp(this, &GroupDialog::_add_group_pressed)); + add_group_text->connect("text_submitted", callable_mp(this, &GroupDialog::_add_group_pressed)); Button *add_group_button = memnew(Button); add_group_button->set_text(TTR("Add")); @@ -689,7 +689,7 @@ GroupsEditor::GroupsEditor() { group_name = memnew(LineEdit); group_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(group_name); - group_name->connect("text_entered", callable_mp(this, &GroupsEditor::_add_group)); + group_name->connect("text_submitted", callable_mp(this, &GroupsEditor::_add_group)); add = memnew(Button); add->set_text(TTR("Add")); diff --git a/editor/icons/VisibilityEnabler2D.svg b/editor/icons/VisibleOnScreenEnabler2D.svg index 989675f44f..989675f44f 100644 --- a/editor/icons/VisibilityEnabler2D.svg +++ b/editor/icons/VisibleOnScreenEnabler2D.svg diff --git a/editor/icons/VisibilityEnabler3D.svg b/editor/icons/VisibleOnScreenEnabler3D.svg index 6923bcb46b..6923bcb46b 100644 --- a/editor/icons/VisibilityEnabler3D.svg +++ b/editor/icons/VisibleOnScreenEnabler3D.svg diff --git a/editor/icons/VisibilityNotifier2D.svg b/editor/icons/VisibleOnScreenNotifier2D.svg index 13df19be56..13df19be56 100644 --- a/editor/icons/VisibilityNotifier2D.svg +++ b/editor/icons/VisibleOnScreenNotifier2D.svg diff --git a/editor/icons/VisibilityNotifier3D.svg b/editor/icons/VisibleOnScreenNotifier3D.svg index 2fdf784701..2fdf784701 100644 --- a/editor/icons/VisibilityNotifier3D.svg +++ b/editor/icons/VisibleOnScreenNotifier3D.svg diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 809f47bad9..72df65a787 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -308,6 +308,7 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String &p_to_path, CompressMode p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, bool p_streamable, bool p_detect_3d, bool p_detect_roughness, bool p_detect_normal, bool p_force_normal, bool p_srgb_friendly, bool p_force_po2_for_compressed, uint32_t p_limit_mipmap, const Ref<Image> &p_normal, Image::RoughnessChannel p_roughness_channel) { FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE); + ERR_FAIL_NULL(f); f->store_8('G'); f->store_8('S'); f->store_8('T'); diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 5c69a1e975..19663e46e1 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -55,7 +55,7 @@ #include "scene/3d/spring_arm_3d.h" #include "scene/3d/sprite_3d.h" #include "scene/3d/vehicle_body_3d.h" -#include "scene/3d/visibility_notifier_3d.h" +#include "scene/3d/visible_on_screen_notifier_3d.h" #include "scene/3d/voxel_gi.h" #include "scene/resources/box_shape_3d.h" #include "scene/resources/capsule_shape_3d.h" @@ -2127,7 +2127,7 @@ bool SoftBody3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_giz /////////// -VisibilityNotifier3DGizmoPlugin::VisibilityNotifier3DGizmoPlugin() { +VisibleOnScreenNotifier3DGizmoPlugin::VisibleOnScreenNotifier3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7)); create_material("visibility_notifier_material", gizmo_color); gizmo_color.a = 0.1; @@ -2135,19 +2135,19 @@ VisibilityNotifier3DGizmoPlugin::VisibilityNotifier3DGizmoPlugin() { create_handle_material("handles"); } -bool VisibilityNotifier3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { - return Object::cast_to<VisibilityNotifier3D>(p_spatial) != nullptr; +bool VisibleOnScreenNotifier3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<VisibleOnScreenNotifier3D>(p_spatial) != nullptr; } -String VisibilityNotifier3DGizmoPlugin::get_gizmo_name() const { - return "VisibilityNotifier3D"; +String VisibleOnScreenNotifier3DGizmoPlugin::get_gizmo_name() const { + return "VisibleOnScreenNotifier3D"; } -int VisibilityNotifier3DGizmoPlugin::get_priority() const { +int VisibleOnScreenNotifier3DGizmoPlugin::get_priority() const { return -1; } -String VisibilityNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String VisibleOnScreenNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Size X"; @@ -2166,13 +2166,13 @@ String VisibilityNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo return ""; } -Variant VisibilityNotifier3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); +Variant VisibleOnScreenNotifier3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { + VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node()); return notifier->get_aabb(); } -void VisibilityNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); +void VisibleOnScreenNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { + VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node()); Transform3D gt = notifier->get_global_transform(); @@ -2223,8 +2223,8 @@ void VisibilityNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int } } -void VisibilityNotifier3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); +void VisibleOnScreenNotifier3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { + VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node()); if (p_cancel) { notifier->set_aabb(p_restore); @@ -2238,8 +2238,8 @@ void VisibilityNotifier3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, ur->commit_action(); } -void VisibilityNotifier3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); +void VisibleOnScreenNotifier3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { + VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); diff --git a/editor/node_3d_editor_gizmos.h b/editor/node_3d_editor_gizmos.h index 8a0e10241a..6f071859ec 100644 --- a/editor/node_3d_editor_gizmos.h +++ b/editor/node_3d_editor_gizmos.h @@ -218,8 +218,8 @@ public: SoftBody3DGizmoPlugin(); }; -class VisibilityNotifier3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(VisibilityNotifier3DGizmoPlugin, EditorNode3DGizmoPlugin); +class VisibleOnScreenNotifier3DGizmoPlugin : public EditorNode3DGizmoPlugin { + GDCLASS(VisibleOnScreenNotifier3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial) override; @@ -232,7 +232,7 @@ public: void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) override; void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false) override; - VisibilityNotifier3DGizmoPlugin(); + VisibleOnScreenNotifier3DGizmoPlugin(); }; class CPUParticles3DGizmoPlugin : public EditorNode3DGizmoPlugin { diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 78c30df04b..867c701733 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -139,7 +139,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { name->set_expand_to_text_length_enabled(true); node->add_child(name); node->set_slot(0, false, 0, Color(), true, 0, get_theme_color("font_color", "Label")); - name->connect("text_entered", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode), CONNECT_DEFERRED); + name->connect("text_submitted", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode), CONNECT_DEFERRED); name->connect("focus_exited", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out), varray(name, agnode), CONNECT_DEFERRED); base = 1; node->set_show_close_button(true); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index bd88d96a66..4a3f3212fa 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1694,7 +1694,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay file->connect("file_selected", callable_mp(this, &AnimationPlayerEditor::_dialog_action)); frame->connect("value_changed", callable_mp(this, &AnimationPlayerEditor::_seek_value_changed), make_binds(true, false)); - scale->connect("text_entered", callable_mp(this, &AnimationPlayerEditor::_scale_changed)); + scale->connect("text_submitted", callable_mp(this, &AnimationPlayerEditor::_scale_changed)); renaming = false; last_active = false; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index c915276d3a..fe5a0cab4d 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1329,7 +1329,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { name_edit = memnew(LineEdit); name_edit_popup->add_child(name_edit); name_edit->set_anchors_and_offsets_preset(PRESET_WIDE); - name_edit->connect("text_entered", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited)); + name_edit->connect("text_submitted", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited)); name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out)); open_file = memnew(EditorFileDialog); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 11eae9e041..c6ca1ecd4f 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -282,7 +282,7 @@ class EditorAssetLibrary : public PanelContainer { void _search(int p_page = 0); void _rerun_search(int p_ignore); void _search_text_changed(const String &p_text = ""); - void _search_text_entered(const String &p_text = ""); + void _search_text_submitted(const String &p_text = ""); void _api_request(const String &p_request, RequestType p_request_type, const String &p_arguments = ""); void _http_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data); void _http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index fdb6e27367..3027246862 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "core/config/project_settings.h" #include "core/input/input.h" #include "core/math/camera_matrix.h" +#include "core/math/math_funcs.h" #include "core/os/keyboard.h" #include "core/string/print_string.h" #include "core/templates/sort_array.h" @@ -6492,7 +6493,7 @@ void Node3DEditor::_register_all_gizmos() { add_gizmo_plugin(Ref<RayCast3DGizmoPlugin>(memnew(RayCast3DGizmoPlugin))); add_gizmo_plugin(Ref<SpringArm3DGizmoPlugin>(memnew(SpringArm3DGizmoPlugin))); add_gizmo_plugin(Ref<VehicleWheel3DGizmoPlugin>(memnew(VehicleWheel3DGizmoPlugin))); - add_gizmo_plugin(Ref<VisibilityNotifier3DGizmoPlugin>(memnew(VisibilityNotifier3DGizmoPlugin))); + add_gizmo_plugin(Ref<VisibleOnScreenNotifier3DGizmoPlugin>(memnew(VisibleOnScreenNotifier3DGizmoPlugin))); add_gizmo_plugin(Ref<GPUParticles3DGizmoPlugin>(memnew(GPUParticles3DGizmoPlugin))); add_gizmo_plugin(Ref<GPUParticlesCollision3DGizmoPlugin>(memnew(GPUParticlesCollision3DGizmoPlugin))); add_gizmo_plugin(Ref<CPUParticles3DGizmoPlugin>(memnew(CPUParticles3DGizmoPlugin))); @@ -6547,9 +6548,11 @@ void Node3DEditor::clear() { void Node3DEditor::_sun_direction_draw() { sun_direction->draw_rect(Rect2(Vector2(), sun_direction->get_size()), Color(1, 1, 1, 1)); - sun_direction_material->set_shader_param("sun_direction", -preview_sun->get_transform().basis.get_axis(Vector3::AXIS_Z)); - float nrg = sun_energy->get_value(); - sun_direction_material->set_shader_param("sun_color", Vector3(sun_color->get_pick_color().r * nrg, sun_color->get_pick_color().g * nrg, sun_color->get_pick_color().b * nrg)); + Vector3 z_axis = preview_sun->get_transform().basis.get_axis(Vector3::AXIS_Z); + z_axis = get_editor_viewport(0)->camera->get_camera_transform().basis.xform_inv(z_axis); + sun_direction_material->set_shader_param("sun_direction", Vector3(z_axis.x, -z_axis.y, z_axis.z)); + Color color = sun_color->get_pick_color() * sun_energy->get_value(); + sun_direction_material->set_shader_param("sun_color", Vector3(color.r, color.g, color.b)); } void Node3DEditor::_preview_settings_changed() { @@ -6559,7 +6562,7 @@ void Node3DEditor::_preview_settings_changed() { { // preview sun Transform3D t; - t.basis = sun_rotation; + t.basis = Basis(Vector3(sun_rotation.x, sun_rotation.y, 0)); preview_sun->set_transform(t); sun_direction->update(); preview_sun->set_param(Light3D::PARAM_ENERGY, sun_energy->get_value()); @@ -6581,11 +6584,20 @@ void Node3DEditor::_preview_settings_changed() { environment->set_tonemapper(environ_tonemap_button->is_pressed() ? Environment::TONE_MAPPER_FILMIC : Environment::TONE_MAPPER_LINEAR); } } + void Node3DEditor::_load_default_preview_settings() { sun_environ_updating = true; - sun_rotation = Basis(Vector3(0, 1, 0), Math_PI * 3.0 / 4) * Basis(Vector3(1, 0, 0), -Math_PI / 4); + // These default rotations place the preview sun at an angular altitude + // of 60 degrees (must be negative) and an azimuth of 30 degrees clockwise + // from north (or 150 CCW from south), from north east, facing south west. + // On any not-tidally-locked planet, a sun would have an angular altitude + // of 60 degrees as the average of all points on the sphere at noon. + // The azimuth choice is arbitrary, but ideally shouldn't be on an axis. + sun_rotation = Vector2(-Math::deg2rad(60.0), Math::deg2rad(150.0)); + sun_angle_altitude->set_value(-Math::rad2deg(sun_rotation.x)); + sun_angle_azimuth->set_value(180.0 - Math::rad2deg(sun_rotation.y)); sun_direction->update(); environ_sky_color->set_pick_color(Color::hex(0x91b2ceff)); environ_ground_color->set_pick_color(Color::hex(0x1f1f21ff)); @@ -6628,6 +6640,9 @@ void Node3DEditor::_update_preview_environment() { } } + sun_angle_altitude->set_value(-Math::rad2deg(sun_rotation.x)); + sun_angle_azimuth->set_value(180.0 - Math::rad2deg(sun_rotation.y)); + bool disable_env = world_env_count > 0 || environ_button->is_pressed(); environ_button->set_disabled(world_env_count > 0); @@ -6656,17 +6671,21 @@ void Node3DEditor::_update_preview_environment() { void Node3DEditor::_sun_direction_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseMotion> mm = p_event; if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) { - float x = -mm->get_relative().y * 0.02 * EDSCALE; - float y = mm->get_relative().x * 0.02 * EDSCALE; - - Basis rot = Basis(Vector3(0, 1, 0), y) * Basis(Vector3(1, 0, 0), x); - - sun_rotation = rot * sun_rotation; - sun_rotation.orthonormalize(); + sun_rotation.x += mm->get_relative().y * (0.02 * EDSCALE); + sun_rotation.y -= mm->get_relative().x * (0.02 * EDSCALE); + sun_rotation.x = CLAMP(sun_rotation.x, -Math_TAU / 4, Math_TAU / 4); + sun_angle_altitude->set_value(-Math::rad2deg(sun_rotation.x)); + sun_angle_azimuth->set_value(180.0 - Math::rad2deg(sun_rotation.y)); _preview_settings_changed(); } } +void Node3DEditor::_sun_direction_angle_set() { + sun_rotation.x = Math::deg2rad(-sun_angle_altitude->get_value()); + sun_rotation.y = Math::deg2rad(180.0 - sun_angle_azimuth->get_value()); + _preview_settings_changed(); +} + Node3DEditor::Node3DEditor(EditorNode *p_editor) { gizmo.visible = true; gizmo.scale = 1.0; @@ -7104,6 +7123,35 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) { sun_direction_material->set_shader_param("sun_color", Vector3(1, 1, 1)); sun_direction->set_material(sun_direction_material); + HBoxContainer *sun_angle_hbox = memnew(HBoxContainer); + VBoxContainer *sun_angle_altitude_vbox = memnew(VBoxContainer); + Label *sun_angle_altitude_label = memnew(Label); + sun_angle_altitude_label->set_text(TTR("Angular Altitude")); + sun_angle_altitude_vbox->add_child(sun_angle_altitude_label); + sun_angle_altitude = memnew(EditorSpinSlider); + sun_angle_altitude->set_max(90); + sun_angle_altitude->set_min(-90); + sun_angle_altitude->set_step(0.1); + sun_angle_altitude->connect("value_changed", callable_mp(this, &Node3DEditor::_sun_direction_angle_set).unbind(1)); + sun_angle_altitude_vbox->add_child(sun_angle_altitude); + sun_angle_hbox->add_child(sun_angle_altitude_vbox); + VBoxContainer *sun_angle_azimuth_vbox = memnew(VBoxContainer); + sun_angle_azimuth_vbox->set_custom_minimum_size(Vector2(100, 0)); + Label *sun_angle_azimuth_label = memnew(Label); + sun_angle_azimuth_label->set_text(TTR("Azimuth")); + sun_angle_azimuth_vbox->add_child(sun_angle_azimuth_label); + sun_angle_azimuth = memnew(EditorSpinSlider); + sun_angle_azimuth->set_max(180); + sun_angle_azimuth->set_min(-180); + sun_angle_azimuth->set_step(0.1); + sun_angle_azimuth->set_allow_greater(true); + sun_angle_azimuth->set_allow_lesser(true); + sun_angle_azimuth->connect("value_changed", callable_mp(this, &Node3DEditor::_sun_direction_angle_set).unbind(1)); + sun_angle_azimuth_vbox->add_child(sun_angle_azimuth); + sun_angle_hbox->add_child(sun_angle_azimuth_vbox); + sun_angle_hbox->add_theme_constant_override("separation", 10); + sun_vb->add_child(sun_angle_hbox); + sun_color = memnew(ColorPickerButton); sun_color->set_edit_alpha(false); sun_vb->add_margin_child(TTR("Sun Color"), sun_color); @@ -7245,10 +7293,6 @@ void Node3DEditorPlugin::set_state(const Dictionary &p_state) { spatial_editor->set_state(p_state); } -void Node3DEditor::snap_cursor_to_plane(const Plane &p_plane) { - //cursor.pos=p_plane.project(cursor.pos); -} - Vector3 Node3DEditor::snap_point(Vector3 p_target, Vector3 p_start) const { if (is_snap_enabled()) { p_target.x = Math::snap_scalar(0.0, get_translate_snap(), p_target.x); @@ -7291,14 +7335,6 @@ float Node3DEditor::get_scale_snap() const { return snap_value; } -void Node3DEditorPlugin::_bind_methods() { - ClassDB::bind_method("snap_cursor_to_plane", &Node3DEditorPlugin::snap_cursor_to_plane); -} - -void Node3DEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) { - spatial_editor->snap_cursor_to_plane(p_plane); -} - struct _GizmoPluginPriorityComparator { bool operator()(const Ref<EditorNode3DGizmoPlugin> &p_a, const Ref<EditorNode3DGizmoPlugin> &p_b) const { if (p_a->get_priority() == p_b->get_priority()) { diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 161d6a38a9..6f03516409 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -764,6 +764,8 @@ private: VBoxContainer *sun_vb; Popup *sun_environ_popup; Control *sun_direction; + EditorSpinSlider *sun_angle_altitude; + EditorSpinSlider *sun_angle_azimuth; ColorPickerButton *sun_color; EditorSpinSlider *sun_energy; EditorSpinSlider *sun_max_distance; @@ -771,8 +773,9 @@ private: void _sun_direction_draw(); void _sun_direction_input(const Ref<InputEvent> &p_event); + void _sun_direction_angle_set(); - Basis sun_rotation; + Vector2 sun_rotation; Ref<Shader> sun_direction_shader; Ref<ShaderMaterial> sun_direction_material; @@ -817,7 +820,6 @@ protected: public: static Node3DEditor *get_singleton() { return singleton; } - void snap_cursor_to_plane(const Plane &p_plane); Vector3 snap_point(Vector3 p_target, Vector3 p_start = Vector3(0, 0, 0)) const; @@ -890,12 +892,7 @@ class Node3DEditorPlugin : public EditorPlugin { Node3DEditor *spatial_editor; EditorNode *editor; -protected: - static void _bind_methods(); - public: - void snap_cursor_to_plane(const Plane &p_plane); - Node3DEditor *get_spatial_editor() { return spatial_editor; } virtual String get_name() const override { return "3D"; } bool has_main_screen() const override { return true; } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 1f6da30547..3ec20ae68e 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1061,7 +1061,7 @@ void ScriptTextEditor::_edit_option(int p_op) { code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { - tx->toggle_fold_line(tx->cursor_get_line()); + tx->toggle_foldable_line(tx->cursor_get_line()); tx->update(); } break; case EDIT_FOLD_ALL_LINES: { @@ -1549,7 +1549,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { } bool has_color = (word_at_pos == "Color"); - bool foldable = tx->can_fold(row) || tx->is_folded(row); + bool foldable = tx->can_fold_line(row) || tx->is_line_folded(row); bool open_docs = false; bool goto_definition = false; diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index a5a3d624ec..af72f59c1c 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -103,17 +103,16 @@ void SpriteFramesEditor::_sheet_preview_draw() { } void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) { - Ref<InputEventMouseButton> mb = p_event; - + const Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) { - Size2i size = split_sheet_preview->get_size(); - int h = split_sheet_h->get_value(); - int v = split_sheet_v->get_value(); + const Size2i size = split_sheet_preview->get_size(); + const int h = split_sheet_h->get_value(); + const int v = split_sheet_v->get_value(); - int x = CLAMP(int(mb->get_position().x) * h / size.width, 0, h - 1); - int y = CLAMP(int(mb->get_position().y) * v / size.height, 0, v - 1); + const int x = CLAMP(int(mb->get_position().x) * h / size.width, 0, h - 1); + const int y = CLAMP(int(mb->get_position().y) * v / size.height, 0, v - 1); - int idx = h * y + x; + const int idx = h * y + x; if (mb->is_shift_pressed() && last_frame_selected >= 0) { //select multiple @@ -124,6 +123,9 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) { } for (int i = from; i <= to; i++) { + // Prevent double-toggling the same frame when moving the mouse when the mouse button is still held. + frames_toggled_by_mouse_hover.insert(idx); + if (mb->is_ctrl_pressed()) { frames_selected.erase(i); } else { @@ -131,6 +133,9 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) { } } } else { + // Prevent double-toggling the same frame when moving the mouse when the mouse button is still held. + frames_toggled_by_mouse_hover.insert(idx); + if (frames_selected.has(idx)) { frames_selected.erase(idx); } else { @@ -141,6 +146,39 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) { last_frame_selected = idx; split_sheet_preview->update(); } + + if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) { + frames_toggled_by_mouse_hover.clear(); + } + + const Ref<InputEventMouseMotion> mm = p_event; + if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) { + // Select by holding down the mouse button on frames. + const Size2i size = split_sheet_preview->get_size(); + const int h = split_sheet_h->get_value(); + const int v = split_sheet_v->get_value(); + + const int x = CLAMP(int(mm->get_position().x) * h / size.width, 0, h - 1); + const int y = CLAMP(int(mm->get_position().y) * v / size.height, 0, v - 1); + + const int idx = h * y + x; + + if (!frames_toggled_by_mouse_hover.has(idx)) { + // Only allow toggling each tile once per mouse hold. + // Otherwise, the selection would constantly "flicker" in and out when moving the mouse cursor. + // The mouse button must be released before it can be toggled again. + frames_toggled_by_mouse_hover.insert(idx); + + if (frames_selected.has(idx)) { + frames_selected.erase(idx); + } else { + frames_selected.insert(idx); + } + + last_frame_selected = idx; + split_sheet_preview->update(); + } + } } void SpriteFramesEditor::_sheet_scroll_input(const Ref<InputEvent> &p_event) { diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 77cdbb4af6..e6c59e3533 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -87,6 +87,7 @@ class SpriteFramesEditor : public HSplitContainer { Button *split_sheet_zoom_in; EditorFileDialog *file_split_sheet; Set<int> frames_selected; + Set<int> frames_toggled_by_mouse_hover; int last_frame_selected; float scale_ratio; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index dc7f85a790..621f843e6f 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -332,7 +332,7 @@ void TextEditor::_edit_option(int p_op) { code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { - tx->toggle_fold_line(tx->cursor_get_line()); + tx->toggle_foldable_line(tx->cursor_get_line()); tx->update(); } break; case EDIT_FOLD_ALL_LINES: { @@ -432,8 +432,8 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { tx->_get_mouse_pos(mb->get_global_position() - tx->get_global_position(), row, col); tx->set_right_click_moves_caret(EditorSettings::get_singleton()->get("text_editor/cursor/right_click_moves_caret")); - bool can_fold = tx->can_fold(row); - bool is_folded = tx->is_folded(row); + bool can_fold = tx->can_fold_line(row); + bool is_folded = tx->is_line_folded(row); if (tx->is_right_click_moving_caret()) { if (tx->is_selection_active()) { @@ -463,7 +463,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { if (k.is_valid() && k->is_pressed() && k->get_keycode() == KEY_MENU) { CodeEdit *tx = code_editor->get_text_editor(); int line = tx->cursor_get_line(); - _make_context_menu(tx->is_selection_active(), tx->can_fold(line), tx->is_folded(line), (get_global_transform().inverse() * tx->get_global_transform()).xform(tx->_get_cursor_pixel_pos())); + _make_context_menu(tx->is_selection_active(), tx->can_fold_line(line), tx->is_line_folded(line), (get_global_transform().inverse() * tx->get_global_transform()).xform(tx->_get_cursor_pixel_pos())); context_menu->grab_focus(); } } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 6607bf6cad..22b39c59f5 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1959,7 +1959,7 @@ VBoxContainer *ThemeTypeEditor::_create_item_list(Theme::DataType p_data_type) { LineEdit *item_add_edit = memnew(LineEdit); item_add_edit->set_h_size_flags(SIZE_EXPAND_FILL); item_add_hb->add_child(item_add_edit); - item_add_edit->connect("text_entered", callable_mp(this, &ThemeTypeEditor::_item_add_lineedit_cbk), varray(p_data_type, item_add_edit)); + item_add_edit->connect("text_submitted", callable_mp(this, &ThemeTypeEditor::_item_add_lineedit_cbk), varray(p_data_type, item_add_edit)); Button *item_add_button = memnew(Button); item_add_button->set_text(TTR("Add")); item_add_hb->add_child(item_add_button); @@ -2124,7 +2124,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_ item_name_edit->set_h_size_flags(SIZE_EXPAND_FILL); item_name_edit->set_text(p_item_name); item_name_container->add_child(item_name_edit); - item_name_edit->connect("text_entered", callable_mp(this, &ThemeTypeEditor::_item_rename_entered), varray(p_data_type, p_item_name, item_name_container)); + item_name_edit->connect("text_submitted", callable_mp(this, &ThemeTypeEditor::_item_rename_entered), varray(p_data_type, p_item_name, item_name_container)); item_name_edit->hide(); Button *item_rename_button = memnew(Button); @@ -2894,7 +2894,7 @@ ThemeTypeEditor::ThemeTypeEditor() { add_type_filter = memnew(LineEdit); add_type_vb->add_child(add_type_filter); add_type_filter->connect("text_changed", callable_mp(this, &ThemeTypeEditor::_add_type_filter_cbk)); - add_type_filter->connect("text_entered", callable_mp(this, &ThemeTypeEditor::_add_type_dialog_entered)); + add_type_filter->connect("text_submitted", callable_mp(this, &ThemeTypeEditor::_add_type_dialog_entered)); Label *add_type_options_label = memnew(Label); add_type_options_label->set_text(TTR("Node Types:")); add_type_vb->add_child(add_type_options_label); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 237cd83b84..e393f960bd 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -432,7 +432,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { register_uniform_name(p_id, uniform_name); uniform_name->set_text(uniform->get_uniform_name()); node->add_child(uniform_name); - uniform_name->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_changed), varray(p_id)); + uniform_name->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_changed), varray(p_id)); uniform_name->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_focus_out), varray(uniform_name, p_id)); if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") { @@ -666,7 +666,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); name_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); name_box->set_text(name_left); - name_box->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_input_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED); + name_box->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_input_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED); name_box->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_port_name_focus_out), varray(name_box, p_id, i, false), CONNECT_DEFERRED); Button *remove_btn = memnew(Button); @@ -707,7 +707,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); name_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); name_box->set_text(name_right); - name_box->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_output_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED); + name_box->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_output_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED); name_box->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_port_name_focus_out), varray(name_box, p_id, i, true), CONNECT_DEFERRED); OptionButton *type_box = memnew(OptionButton); @@ -1855,7 +1855,7 @@ void VisualShaderEditor::_comment_title_text_changed(const String &p_new_text) { comment_title_change_popup->set_size(Size2(-1, -1)); } -void VisualShaderEditor::_comment_title_text_entered(const String &p_new_text) { +void VisualShaderEditor::_comment_title_text_submitted(const String &p_new_text) { comment_title_change_popup->hide(); } @@ -3944,7 +3944,7 @@ VisualShaderEditor::VisualShaderEditor() { comment_title_change_edit = memnew(LineEdit); comment_title_change_edit->set_expand_to_text_length_enabled(true); comment_title_change_edit->connect("text_changed", callable_mp(this, &VisualShaderEditor::_comment_title_text_changed)); - comment_title_change_edit->connect("text_entered", callable_mp(this, &VisualShaderEditor::_comment_title_text_entered)); + comment_title_change_edit->connect("text_submitted", callable_mp(this, &VisualShaderEditor::_comment_title_text_submitted)); comment_title_change_popup->add_child(comment_title_change_edit); comment_title_change_edit->set_size(Size2(-1, -1)); comment_title_change_popup->set_size(Size2(-1, -1)); diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index fa98c6b780..4c7489a694 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -358,7 +358,7 @@ class VisualShaderEditor : public VBoxContainer { void _comment_title_popup_hide(); void _comment_title_popup_focus_out(); void _comment_title_text_changed(const String &p_new_text); - void _comment_title_text_entered(const String &p_new_text); + void _comment_title_text_submitted(const String &p_new_text); void _comment_desc_popup_show(const Point2 &p_position, int p_node_id); void _comment_desc_popup_hide(); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 7ca2d4d324..ec65694772 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -871,10 +871,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) { if (invalid_path) { export_project->get_ok_button()->set_disabled(true); - export_project->get_line_edit()->disconnect("text_entered", Callable(export_project, "_file_entered")); + export_project->get_line_edit()->disconnect("text_submitted", Callable(export_project, "_file_submitted")); } else { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered")); + export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted")); } } @@ -905,10 +905,10 @@ void ProjectExportDialog::_export_project() { // Ensure that signal is connected if previous attempt left it disconnected // with _validate_export_path. // FIXME: This is a hack, we should instead change EditorFileDialog to allow - // disabling validation by the "text_entered" signal. - if (!export_project->get_line_edit()->is_connected("text_entered", Callable(export_project, "_file_entered"))) { + // disabling validation by the "text_submitted" signal. + if (!export_project->get_line_edit()->is_connected("text_submitted", Callable(export_project, "_file_submitted"))) { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered")); + export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted")); } export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5490fbbbc7..fdd114bb1e 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1924,9 +1924,6 @@ void ProjectManager::_unhandled_key_input(const Ref<InputEvent> &p_ev) { case KEY_ENTER: { _open_selected_projects_ask(); } break; - case KEY_DELETE: { - _erase_project(); - } break; case KEY_HOME: { if (_project_list->get_project_count() > 0) { _project_list->select_project(0); @@ -2400,36 +2397,10 @@ ProjectManager::ProjectManager() { int display_scale = EditorSettings::get_singleton()->get("interface/editor/display_scale"); switch (display_scale) { - case 0: { + case 0: // Try applying a suitable display scale automatically. - // The code below is adapted in `editor/editor_settings.cpp` and `editor/editor_node.cpp`. - // Make sure to update those when modifying the code below. -#ifdef OSX_ENABLED - editor_set_scale(DisplayServer::get_singleton()->screen_get_max_scale()); -#else - const int screen = DisplayServer::get_singleton()->window_get_current_screen(); - // Use the smallest dimension to use a correct display scale on portait displays. - const int smallest_dimension = MIN(DisplayServer::get_singleton()->screen_get_size(screen).x, DisplayServer::get_singleton()->screen_get_size(screen).y); - float scale; - if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && smallest_dimension >= 1400) { - // hiDPI display. - scale = 2.0; - } else if (smallest_dimension >= 1700) { - // Likely a hiDPI display, but we aren't certain due to the returned DPI. - // Use an intermediate scale to handle this situation. - scale = 1.5; - } else if (smallest_dimension <= 800) { - // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. - // Icons won't look great, but this is better than having editor elements overflow from its window. - scale = 0.75; - } else { - scale = 1.0; - } - - editor_set_scale(scale); -#endif - } break; - + editor_set_scale(EditorSettings::get_singleton()->get_auto_display_scale()); + break; case 1: editor_set_scale(0.75); break; @@ -2558,16 +2529,19 @@ ProjectManager::ProjectManager() { Button *create = memnew(Button); create->set_text(TTR("New Project")); + create->set_shortcut(ED_SHORTCUT("project_manager/new_project", TTR("New Project"), KEY_MASK_CMD | KEY_N)); create->connect("pressed", callable_mp(this, &ProjectManager::_new_project)); tree_vb->add_child(create); Button *import = memnew(Button); import->set_text(TTR("Import")); + import->set_shortcut(ED_SHORTCUT("project_manager/import_project", TTR("Import Project"), KEY_MASK_CMD | KEY_I)); import->connect("pressed", callable_mp(this, &ProjectManager::_import_project)); tree_vb->add_child(import); Button *scan = memnew(Button); scan->set_text(TTR("Scan")); + scan->set_shortcut(ED_SHORTCUT("project_manager/scan_projects", TTR("Scan Projects"), KEY_MASK_CMD | KEY_S)); scan->connect("pressed", callable_mp(this, &ProjectManager::_scan_projects)); tree_vb->add_child(scan); @@ -2575,21 +2549,25 @@ ProjectManager::ProjectManager() { open_btn = memnew(Button); open_btn->set_text(TTR("Edit")); + open_btn->set_shortcut(ED_SHORTCUT("project_manager/edit_project", TTR("Edit Project"), KEY_MASK_CMD | KEY_E)); open_btn->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects_ask)); tree_vb->add_child(open_btn); run_btn = memnew(Button); run_btn->set_text(TTR("Run")); + run_btn->set_shortcut(ED_SHORTCUT("project_manager/run_project", TTR("Run Project"), KEY_MASK_CMD | KEY_R)); run_btn->connect("pressed", callable_mp(this, &ProjectManager::_run_project)); tree_vb->add_child(run_btn); rename_btn = memnew(Button); rename_btn->set_text(TTR("Rename")); + rename_btn->set_shortcut(ED_SHORTCUT("project_manager/rename_project", TTR("Rename Project"), KEY_F2)); rename_btn->connect("pressed", callable_mp(this, &ProjectManager::_rename_project)); tree_vb->add_child(rename_btn); erase_btn = memnew(Button); erase_btn->set_text(TTR("Remove")); + erase_btn->set_shortcut(ED_SHORTCUT("project_manager/remove_project", TTR("Remove Project"), KEY_DELETE)); erase_btn->connect("pressed", callable_mp(this, &ProjectManager::_erase_project)); tree_vb->add_child(erase_btn); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index c44f8d9a4b..ba3c9aafb4 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1781,7 +1781,7 @@ CustomPropertyEditor::CustomPropertyEditor() { value_hboxes[hbox_idx]->add_child(value_editor[i]); value_editor[i]->set_h_size_flags(Control::SIZE_EXPAND_FILL); value_editor[i]->hide(); - value_editor[i]->connect("text_entered", callable_mp(this, &CustomPropertyEditor::_modified)); + value_editor[i]->connect("text_submitted", callable_mp(this, &CustomPropertyEditor::_modified)); value_editor[i]->connect("focus_entered", callable_mp(this, &CustomPropertyEditor::_focus_enter)); value_editor[i]->connect("focus_exited", callable_mp(this, &CustomPropertyEditor::_focus_exit)); } diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 650decfd49..01743bccab 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -602,7 +602,7 @@ void ScriptCreateDialog::_path_changed(const String &p_path) { _update_dialog(); } -void ScriptCreateDialog::_path_entered(const String &p_path) { +void ScriptCreateDialog::_path_submitted(const String &p_path) { ok_pressed(); } @@ -731,13 +731,13 @@ void ScriptCreateDialog::_update_dialog() { get_ok_button()->set_disabled(!script_ok); - Callable entered_call = callable_mp(this, &ScriptCreateDialog::_path_entered); + Callable entered_call = callable_mp(this, &ScriptCreateDialog::_path_submitted); if (script_ok) { - if (!file_path->is_connected("text_entered", entered_call)) { - file_path->connect("text_entered", entered_call); + if (!file_path->is_connected("text_submitted", entered_call)) { + file_path->connect("text_submitted", entered_call); } - } else if (file_path->is_connected("text_entered", entered_call)) { - file_path->disconnect("text_entered", entered_call); + } else if (file_path->is_connected("text_submitted", entered_call)) { + file_path->disconnect("text_submitted", entered_call); } } diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index d6417b9d33..a020be0478 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -105,7 +105,7 @@ class ScriptCreateDialog : public ConfirmationDialog { void _path_hbox_sorted(); bool _can_be_built_in(); void _path_changed(const String &p_path = String()); - void _path_entered(const String &p_path = String()); + void _path_submitted(const String &p_path = String()); void _lang_changed(int l = 0); void _built_in_pressed(); bool _validate_parent(const String &p_string); diff --git a/main/main.cpp b/main/main.cpp index f1905fc47b..667aebebae 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -137,6 +137,7 @@ static int audio_driver_idx = -1; static bool single_window = false; static bool editor = false; static bool project_manager = false; +static bool cmdline_tool = false; static String locale; static bool show_help = false; static bool auto_quit = false; @@ -185,6 +186,10 @@ bool Main::is_project_manager() { return project_manager; } +bool Main::is_cmdline_tool() { + return cmdline_tool; +} + static String unescape_cmdline(const String &p_str) { return p_str.replace("%20", " "); } @@ -881,18 +886,25 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph auto_build_solutions = true; editor = true; + cmdline_tool = true; #ifdef DEBUG_METHODS_ENABLED } else if (I->get() == "--gdnative-generate-json-api" || I->get() == "--gdnative-generate-json-builtin-api") { // Register as an editor instance to use low-end fallback if relevant. editor = true; + cmdline_tool = true; // We still pass it to the main arguments since the argument handling itself is not done in this function main_args.push_back(I->get()); #endif } else if (I->get() == "--export" || I->get() == "--export-debug" || I->get() == "--export-pack") { // Export project - + // Actually handling is done in start(). editor = true; + cmdline_tool = true; + main_args.push_back(I->get()); + } else if (I->get() == "--doctool") { + // Actually handling is done in start(). + cmdline_tool = true; main_args.push_back(I->get()); #endif } else if (I->get() == "--path") { // set path of project to start or edit @@ -1125,8 +1137,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (!project_manager && !editor) { - // Determine if the project manager should be requested - project_manager = main_args.size() == 0 && !found_project; + // If we didn't find a project, we fall back to the project manager. + project_manager = !found_project && !cmdline_tool; } #endif @@ -1452,7 +1464,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { #endif #ifdef TOOLS_ENABLED - if (editor || project_manager) { + if (editor || project_manager || cmdline_tool) { EditorPaths::create(); } #endif @@ -1577,7 +1589,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { print_verbose("Using \"" + tablet_driver + "\" pen tablet driver..."); - /* Initialize Visual Server */ + /* Initialize Rendering Server */ rendering_server = memnew(RenderingServerDefault(OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD)); @@ -1828,13 +1840,13 @@ bool Main::start() { ERR_FAIL_COND_V(!_start_success, false); bool hasicon = false; - String doc_tool_path; String positional_arg; String game_path; String script; bool check_only = false; #ifdef TOOLS_ENABLED + String doc_tool_path; bool doc_base = true; String _export_preset; bool export_debug = false; @@ -1844,8 +1856,9 @@ bool Main::start() { main_timer_sync.init(OS::get_singleton()->get_ticks_usec()); List<String> args = OS::get_singleton()->get_cmdline_args(); - // parameters that do not have an argument to the right for (int i = 0; i < args.size(); i++) { + // First check parameters that do not have an argument to the right. + // Doctest Unit Testing Handler // Designed to override and pass arguments to the unit test handler. if (args[i] == "--check-only") { @@ -1875,7 +1888,7 @@ bool Main::start() { game_path = args[i]; } } - //parameters that have an argument to the right + // Then parameters that have an argument to the right. else if (i < (args.size() - 1)) { bool parsed_pair = true; if (args[i] == "-s" || args[i] == "--script") { @@ -1907,16 +1920,19 @@ bool Main::start() { if (parsed_pair) { i++; } - } else if (args[i] == "--doctool") { - // Handle case where no path is given to --doctool. + } +#ifdef TOOLS_ENABLED + // Handle case where no path is given to --doctool. + else if (args[i] == "--doctool") { doc_tool_path = "."; } +#endif } #ifdef TOOLS_ENABLED if (doc_tool_path != "") { - Engine::get_singleton()->set_editor_hint( - true); // Needed to instance editor-only classes for their default values + // Needed to instance editor-only classes for their default values + Engine::get_singleton()->set_editor_hint(true); { DirAccessRef da = DirAccess::open(doc_tool_path); @@ -1988,17 +2004,26 @@ bool Main::start() { return false; } - #endif if (script == "" && game_path == "" && String(GLOBAL_GET("application/run/main_scene")) != "") { game_path = GLOBAL_GET("application/run/main_scene"); } +#ifdef TOOLS_ENABLED + if (!editor && !project_manager && !cmdline_tool && script == "" && game_path == "") { + // If we end up here, it means we didn't manage to detect what we want to run. + // Let's throw an error gently. The code leading to this is pretty brittle so + // this might end up triggered by valid usage, in which case we'll have to + // fine-tune further. + ERR_FAIL_V_MSG(false, "Couldn't detect whether to run the editor, the project manager or a specific project. Aborting."); + } +#endif + MainLoop *main_loop = nullptr; if (editor) { main_loop = memnew(SceneTree); - }; + } String main_loop_type = GLOBAL_DEF("application/run/main_loop_type", "SceneTree"); if (script != "") { @@ -2360,14 +2385,13 @@ bool Main::start() { } #ifdef TOOLS_ENABLED - if (project_manager || (script == "" && game_path == "" && !editor)) { + if (project_manager) { Engine::get_singleton()->set_editor_hint(true); ProjectManager *pmanager = memnew(ProjectManager); ProgressDialog *progress_dialog = memnew(ProgressDialog); pmanager->add_child(progress_dialog); sml->get_root()->add_child(pmanager); DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_PROJECTMAN); - project_manager = true; } if (project_manager || editor) { diff --git a/main/main.h b/main/main.h index f4fff6b97e..84077137ba 100644 --- a/main/main.h +++ b/main/main.h @@ -45,6 +45,7 @@ class Main { public: static bool is_project_manager(); + static bool is_cmdline_tool(); static int test_entrypoint(int argc, char *argv[], bool &tests_need_run); static Error setup(const char *execpath, int argc, char *argv[], bool p_second_phase = true); static Error setup2(Thread::ID p_main_tid_override = 0); diff --git a/modules/csg/doc_classes/CSGBox3D.xml b/modules/csg/doc_classes/CSGBox3D.xml index b1d0454b76..5bb1c4e75b 100644 --- a/modules/csg/doc_classes/CSGBox3D.xml +++ b/modules/csg/doc_classes/CSGBox3D.xml @@ -14,7 +14,7 @@ <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the box. </member> - <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3( 2, 2, 2 )"> + <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(2, 2, 2)"> The box's width, height and depth. </member> </members> diff --git a/modules/csg/doc_classes/CSGPolygon3D.xml b/modules/csg/doc_classes/CSGPolygon3D.xml index c55fa0983e..4f29786779 100644 --- a/modules/csg/doc_classes/CSGPolygon3D.xml +++ b/modules/csg/doc_classes/CSGPolygon3D.xml @@ -38,7 +38,7 @@ <member name="path_rotation" type="int" setter="set_path_rotation" getter="get_path_rotation" enum="CSGPolygon3D.PathRotation"> The method by which each slice is rotated along the path when [member mode] is [constant MODE_PATH]. </member> - <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )"> + <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0)"> Point array that defines the shape that we'll extrude. </member> <member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="false"> diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 9491373013..94260e8c13 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -362,7 +362,10 @@ void NetworkedMultiplayerENet::poll() { // To myself and only myself incoming_packets.push_back(packet); } else if (!server_relay) { - // No other destination is allowed when server is not relaying + // When relaying is disabled, other destinations will only be processed by the server. + if (target == 0 || target < -1) { + incoming_packets.push_back(packet); + } continue; } else if (target == 0) { // Re-send to everyone but sender :| diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index e552f443cf..fa11132dd9 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -252,7 +252,7 @@ void GDNativeLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("set_symbol_prefix", "symbol_prefix"), &GDNativeLibrary::set_symbol_prefix); ClassDB::bind_method(D_METHOD("set_reloadable", "reloadable"), &GDNativeLibrary::set_reloadable); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "config_file", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile", 0), "set_config_file", "get_config_file"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "config_file", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile", PROPERTY_USAGE_NONE), "set_config_file", "get_config_file"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "load_once"), "set_load_once", "should_load_once"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "singleton"), "set_singleton", "is_singleton"); diff --git a/modules/gdnavigation/navigation_mesh_generator.cpp b/modules/gdnavigation/navigation_mesh_generator.cpp index d69c9114b9..b94f4b4c6c 100644 --- a/modules/gdnavigation/navigation_mesh_generator.cpp +++ b/modules/gdnavigation/navigation_mesh_generator.cpp @@ -255,7 +255,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform3D p_accumulated_transfor for (int i = 0; i < meshes.size(); i += 2) { Ref<Mesh> mesh = meshes[i + 1]; if (mesh.is_valid()) { - _add_mesh(mesh, p_accumulated_transform * xform * meshes[i], p_verticies, p_indices); + _add_mesh(mesh, p_accumulated_transform * xform * (Transform3D)meshes[i], p_verticies, p_indices); } } } diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 9b7b2b36b4..d83f77ed82 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -188,7 +188,9 @@ Array GDScriptWorkspace::symbol(const Dictionary &p_params) { E->get()->get_symbols().symbol_tree_as_list(E->key(), script_symbols); for (int i = 0; i < script_symbols.size(); ++i) { if (query.is_subsequence_ofi(script_symbols[i].name)) { - arr.push_back(script_symbols[i].to_json()); + lsp::DocumentedSymbolInformation symbol = script_symbols[i]; + symbol.location.uri = get_file_uri(symbol.location.uri); + arr.push_back(symbol.to_json()); } } } diff --git a/modules/gltf/doc_classes/GLTFAccessor.xml b/modules/gltf/doc_classes/GLTFAccessor.xml index a1f596f7dd..41a318ce19 100644 --- a/modules/gltf/doc_classes/GLTFAccessor.xml +++ b/modules/gltf/doc_classes/GLTFAccessor.xml @@ -17,9 +17,9 @@ </member> <member name="count" type="int" setter="set_count" getter="get_count" default="0"> </member> - <member name="max" type="PackedFloat64Array" setter="set_max" getter="get_max" default="PackedFloat64Array( )"> + <member name="max" type="PackedFloat64Array" setter="set_max" getter="get_max" default="PackedFloat64Array()"> </member> - <member name="min" type="PackedFloat64Array" setter="set_min" getter="get_min" default="PackedFloat64Array( )"> + <member name="min" type="PackedFloat64Array" setter="set_min" getter="get_min" default="PackedFloat64Array()"> </member> <member name="normalized" type="bool" setter="set_normalized" getter="get_normalized" default="false"> </member> diff --git a/modules/gltf/doc_classes/GLTFLight.xml b/modules/gltf/doc_classes/GLTFLight.xml index bfeaf9a86e..f51d287685 100644 --- a/modules/gltf/doc_classes/GLTFLight.xml +++ b/modules/gltf/doc_classes/GLTFLight.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(0, 0, 0, 1)"> </member> <member name="inner_cone_angle" type="float" setter="set_inner_cone_angle" getter="get_inner_cone_angle" default="0.0"> </member> diff --git a/modules/gltf/doc_classes/GLTFMesh.xml b/modules/gltf/doc_classes/GLTFMesh.xml index 55f79d2c55..fd7e4a169e 100644 --- a/modules/gltf/doc_classes/GLTFMesh.xml +++ b/modules/gltf/doc_classes/GLTFMesh.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="blend_weights" type="PackedFloat32Array" setter="set_blend_weights" getter="get_blend_weights" default="PackedFloat32Array( )"> + <member name="blend_weights" type="PackedFloat32Array" setter="set_blend_weights" getter="get_blend_weights" default="PackedFloat32Array()"> </member> <member name="mesh" type="EditorSceneImporterMesh" setter="set_mesh" getter="get_mesh"> </member> diff --git a/modules/gltf/doc_classes/GLTFNode.xml b/modules/gltf/doc_classes/GLTFNode.xml index 5d84d7088b..bfbb12df4d 100644 --- a/modules/gltf/doc_classes/GLTFNode.xml +++ b/modules/gltf/doc_classes/GLTFNode.xml @@ -11,7 +11,7 @@ <members> <member name="camera" type="int" setter="set_camera" getter="get_camera" default="-1"> </member> - <member name="children" type="PackedInt32Array" setter="set_children" getter="get_children" default="PackedInt32Array( )"> + <member name="children" type="PackedInt32Array" setter="set_children" getter="get_children" default="PackedInt32Array()"> </member> <member name="height" type="int" setter="set_height" getter="get_height" default="-1"> </member> @@ -23,17 +23,17 @@ </member> <member name="parent" type="int" setter="set_parent" getter="get_parent" default="-1"> </member> - <member name="rotation" type="Quaternion" setter="set_rotation" getter="get_rotation" default="Quaternion( 0, 0, 0, 1 )"> + <member name="rotation" type="Quaternion" setter="set_rotation" getter="get_rotation" default="Quaternion(0, 0, 0, 1)"> </member> - <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3( 1, 1, 1 )"> + <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> </member> <member name="skeleton" type="int" setter="set_skeleton" getter="get_skeleton" default="-1"> </member> <member name="skin" type="int" setter="set_skin" getter="get_skin" default="-1"> </member> - <member name="translation" type="Vector3" setter="set_translation" getter="get_translation" default="Vector3( 0, 0, 0 )"> + <member name="translation" type="Vector3" setter="set_translation" getter="get_translation" default="Vector3(0, 0, 0)"> </member> - <member name="xform" type="Transform3D" setter="set_xform" getter="get_xform" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> + <member name="xform" type="Transform3D" setter="set_xform" getter="get_xform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> </member> </members> <constants> diff --git a/modules/gltf/doc_classes/GLTFSkeleton.xml b/modules/gltf/doc_classes/GLTFSkeleton.xml index 9680c27705..40563c9ac6 100644 --- a/modules/gltf/doc_classes/GLTFSkeleton.xml +++ b/modules/gltf/doc_classes/GLTFSkeleton.xml @@ -57,9 +57,9 @@ </method> </methods> <members> - <member name="joints" type="PackedInt32Array" setter="set_joints" getter="get_joints" default="PackedInt32Array( )"> + <member name="joints" type="PackedInt32Array" setter="set_joints" getter="get_joints" default="PackedInt32Array()"> </member> - <member name="roots" type="PackedInt32Array" setter="set_roots" getter="get_roots" default="PackedInt32Array( )"> + <member name="roots" type="PackedInt32Array" setter="set_roots" getter="get_roots" default="PackedInt32Array()"> </member> </members> <constants> diff --git a/modules/gltf/doc_classes/GLTFSkin.xml b/modules/gltf/doc_classes/GLTFSkin.xml index 5a80c7097a..e20e127e52 100644 --- a/modules/gltf/doc_classes/GLTFSkin.xml +++ b/modules/gltf/doc_classes/GLTFSkin.xml @@ -53,13 +53,13 @@ <members> <member name="godot_skin" type="Skin" setter="set_godot_skin" getter="get_godot_skin"> </member> - <member name="joints" type="PackedInt32Array" setter="set_joints" getter="get_joints" default="PackedInt32Array( )"> + <member name="joints" type="PackedInt32Array" setter="set_joints" getter="get_joints" default="PackedInt32Array()"> </member> - <member name="joints_original" type="PackedInt32Array" setter="set_joints_original" getter="get_joints_original" default="PackedInt32Array( )"> + <member name="joints_original" type="PackedInt32Array" setter="set_joints_original" getter="get_joints_original" default="PackedInt32Array()"> </member> - <member name="non_joints" type="PackedInt32Array" setter="set_non_joints" getter="get_non_joints" default="PackedInt32Array( )"> + <member name="non_joints" type="PackedInt32Array" setter="set_non_joints" getter="get_non_joints" default="PackedInt32Array()"> </member> - <member name="roots" type="PackedInt32Array" setter="set_roots" getter="get_roots" default="PackedInt32Array( )"> + <member name="roots" type="PackedInt32Array" setter="set_roots" getter="get_roots" default="PackedInt32Array()"> </member> <member name="skeleton" type="int" setter="set_skeleton" getter="get_skeleton" default="-1"> </member> diff --git a/modules/gltf/doc_classes/GLTFSpecGloss.xml b/modules/gltf/doc_classes/GLTFSpecGloss.xml index 68cc7c845d..6e9c419649 100644 --- a/modules/gltf/doc_classes/GLTFSpecGloss.xml +++ b/modules/gltf/doc_classes/GLTFSpecGloss.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="diffuse_factor" type="Color" setter="set_diffuse_factor" getter="get_diffuse_factor" default="Color( 1, 1, 1, 1 )"> + <member name="diffuse_factor" type="Color" setter="set_diffuse_factor" getter="get_diffuse_factor" default="Color(1, 1, 1, 1)"> </member> <member name="diffuse_img" type="Image" setter="set_diffuse_img" getter="get_diffuse_img"> </member> @@ -17,7 +17,7 @@ </member> <member name="spec_gloss_img" type="Image" setter="set_spec_gloss_img" getter="get_spec_gloss_img"> </member> - <member name="specular_factor" type="Color" setter="set_specular_factor" getter="get_specular_factor" default="Color( 1, 1, 1, 1 )"> + <member name="specular_factor" type="Color" setter="set_specular_factor" getter="get_specular_factor" default="Color(1, 1, 1, 1)"> </member> </members> <constants> diff --git a/modules/gltf/doc_classes/GLTFState.xml b/modules/gltf/doc_classes/GLTFState.xml index 8255cd73d0..a7b5b7b43e 100644 --- a/modules/gltf/doc_classes/GLTFState.xml +++ b/modules/gltf/doc_classes/GLTFState.xml @@ -243,9 +243,9 @@ </method> </methods> <members> - <member name="buffers" type="Array" setter="set_buffers" getter="get_buffers" default="[ ]"> + <member name="buffers" type="Array" setter="set_buffers" getter="get_buffers" default="[]"> </member> - <member name="glb_data" type="PackedByteArray" setter="set_glb_data" getter="get_glb_data" default="PackedByteArray( )"> + <member name="glb_data" type="PackedByteArray" setter="set_glb_data" getter="get_glb_data" default="PackedByteArray()"> </member> <member name="json" type="Dictionary" setter="set_json" getter="get_json" default="{}"> </member> @@ -253,7 +253,7 @@ </member> <member name="minor_version" type="int" setter="set_minor_version" getter="get_minor_version" default="0"> </member> - <member name="root_nodes" type="Array" setter="set_root_nodes" getter="get_root_nodes" default="[ ]"> + <member name="root_nodes" type="Array" setter="set_root_nodes" getter="get_root_nodes" default="[]"> </member> <member name="scene_name" type="String" setter="set_scene_name" getter="get_scene_name" default=""""> </member> diff --git a/modules/gltf/doc_classes/PackedSceneGLTF.xml b/modules/gltf/doc_classes/PackedSceneGLTF.xml index a04c6ef0b6..a22111e9b7 100644 --- a/modules/gltf/doc_classes/PackedSceneGLTF.xml +++ b/modules/gltf/doc_classes/PackedSceneGLTF.xml @@ -51,7 +51,7 @@ </method> </methods> <members> - <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" override="true" default="{"conn_count": 0,"conns": PackedInt32Array( ),"editable_instances": [ ],"names": PackedStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PackedInt32Array( ),"variants": [ ],"version": 2}" /> + <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" override="true" default="{"conn_count": 0,"conns": PackedInt32Array(),"editable_instances": [],"names": PackedStringArray(),"node_count": 0,"node_paths": [],"nodes": PackedInt32Array(),"variants": [],"version": 2}" /> </members> <constants> </constants> diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index fb0a2c9953..a2c8e8eabf 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -203,7 +203,7 @@ The scale of the cell items. This does not affect the size of the grid cells themselves, only the items in them. This can be used to make cell items overlap their neighbors. </member> - <member name="cell_size" type="Vector3" setter="set_cell_size" getter="get_cell_size" default="Vector3( 2, 2, 2 )"> + <member name="cell_size" type="Vector3" setter="set_cell_size" getter="get_cell_size" default="Vector3(2, 2, 2)"> The dimensions of the grid's cells. This does not affect the size of the meshes. See [member cell_scale]. </member> diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index a47ed6652d..80551de1ba 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -62,12 +62,6 @@ void GridMapEditor::_menu_option(int p_option) { floor->set_value(floor->get_value() + 1); } break; - case MENU_OPTION_LOCK_VIEW: { - int index = options->get_popup()->get_item_index(MENU_OPTION_LOCK_VIEW); - lock_view = !options->get_popup()->is_item_checked(index); - - options->get_popup()->set_item_checked(index, lock_view); - } break; case MENU_OPTION_CLIP_DISABLED: case MENU_OPTION_CLIP_ABOVE: case MENU_OPTION_CLIP_BELOW: { @@ -1080,26 +1074,22 @@ void GridMapEditor::_notification(int p_what) { if (cgmt.operator->() != last_mesh_library) { update_palette(); } - - if (lock_view) { - EditorNode *editor = Object::cast_to<EditorNode>(get_tree()->get_root()->get_child(0)); - - Plane p; - p.normal[edit_axis] = 1.0; - p.d = edit_floor[edit_axis] * node->get_cell_size()[edit_axis]; - p = node->get_transform().xform(p); // plane to snap - - Node3DEditorPlugin *sep = Object::cast_to<Node3DEditorPlugin>(editor->get_editor_plugin_screen()); - if (sep) { - sep->snap_cursor_to_plane(p); - } - } } break; case NOTIFICATION_THEME_CHANGED: { options->set_icon(get_theme_icon("GridMap", "EditorIcons")); search_box->set_right_icon(get_theme_icon("Search", "EditorIcons")); } break; + + case NOTIFICATION_APPLICATION_FOCUS_OUT: { + if (input_action == INPUT_PAINT) { + // Simulate mouse released event to stop drawing when editor focus exists. + Ref<InputEventMouseButton> release; + release.instance(); + release->set_button_index(MOUSE_BUTTON_LEFT); + forward_spatial_input_event(nullptr, release); + } + } break; } } @@ -1187,8 +1177,6 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { spatial_editor_hb->hide(); options->set_text(TTR("Grid Map")); - options->get_popup()->add_check_item(TTR("Snap View"), MENU_OPTION_LOCK_VIEW); - options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Previous Floor"), MENU_OPTION_PREV_LEVEL, KEY_Q); options->get_popup()->add_item(TTR("Next Floor"), MENU_OPTION_NEXT_LEVEL, KEY_E); options->get_popup()->add_separator(); diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 0e29c88d26..4bc849e071 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -94,7 +94,6 @@ class GridMapEditor : public VBoxContainer { MeshLibrary *last_mesh_library; ClipMode clip_mode = CLIP_DISABLED; - bool lock_view = false; Transform3D grid_xform; Transform3D edit_grid_xform; Vector3::Axis edit_axis; diff --git a/modules/minimp3/doc_classes/AudioStreamMP3.xml b/modules/minimp3/doc_classes/AudioStreamMP3.xml index 92e777ca0f..5507329a18 100644 --- a/modules/minimp3/doc_classes/AudioStreamMP3.xml +++ b/modules/minimp3/doc_classes/AudioStreamMP3.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray( )"> + <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contains the audio data in bytes. </member> <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false"> diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 7e944ed4a5..620b031ddb 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -3058,17 +3058,17 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar } break; case Variant::AABB: { AABB aabb = p_val.operator ::AABB(); - r_iarg.default_argument = "new AABB(new Vector3" + aabb.position.operator String() + ", new Vector3" + aabb.position.operator String() + ")"; + r_iarg.default_argument = "new AABB(new Vector3" + aabb.position.operator String() + ", new Vector3" + aabb.size.operator String() + ")"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_VAL; } break; case Variant::RECT2: { Rect2 rect = p_val.operator Rect2(); - r_iarg.default_argument = "new Rect2(new Vector2" + rect.position.operator String() + ", new Vector2" + rect.position.operator String() + ")"; + r_iarg.default_argument = "new Rect2(new Vector2" + rect.position.operator String() + ", new Vector2" + rect.size.operator String() + ")"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_VAL; } break; case Variant::RECT2I: { Rect2i rect = p_val.operator Rect2i(); - r_iarg.default_argument = "new Rect2i(new Vector2i" + rect.position.operator String() + ", new Vector2i" + rect.position.operator String() + ")"; + r_iarg.default_argument = "new Rect2i(new Vector2i" + rect.position.operator String() + ", new Vector2i" + rect.size.operator String() + ")"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_VAL; } break; case Variant::COLOR: diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs index b087b4c200..817103994a 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs @@ -114,6 +114,23 @@ namespace Godot } /// <summary> + /// Returns the angle between this quaternion and `to`. + /// This is the magnitude of the angle you would need to rotate + /// by to get from one to the other. + /// + /// Note: This method has an abnormally high amount + /// of floating-point error, so methods such as + /// <see cref="Mathf.IsZeroApprox"/> will not work reliably. + /// </summary> + /// <param name="to">The other quaternion.</param> + /// <returns>The angle between the quaternions.</returns> + public real_t AngleTo(Quaternion to) + { + real_t dot = Dot(to); + return Mathf.Acos(Mathf.Clamp(dot * dot * 2 - 1, -1, 1)); + } + + /// <summary> /// Performs a cubic spherical interpolation between quaternions `preA`, /// this vector, `b`, and `postB`, by the given amount `t`. /// </summary> diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml index a12412a9cd..2ae7f8cad9 100644 --- a/modules/opensimplex/doc_classes/NoiseTexture.xml +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -31,7 +31,7 @@ <member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise"> The [OpenSimplexNoise] instance used to generate the noise. </member> - <member name="noise_offset" type="Vector2" setter="set_noise_offset" getter="get_noise_offset" default="Vector2( 0, 0 )"> + <member name="noise_offset" type="Vector2" setter="set_noise_offset" getter="get_noise_offset" default="Vector2(0, 0)"> An offset used to specify the noise space coordinate of the top left corner of the generated noise. This value is ignored if [member seamless] is enabled. </member> <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless" default="false"> diff --git a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml index 2fdbd61ee7..4d45e41cc3 100644 --- a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml +++ b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml @@ -31,7 +31,7 @@ </argument> <argument index="1" name="height" type="int"> </argument> - <argument index="2" name="noise_offset" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="noise_offset" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Generate a noise image in [constant Image.FORMAT_L8] format with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters. If [code]noise_offset[/code] is specified, then the offset value is used as the coordinates of the top-left corner of the generated noise. diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index cfe00f83ee..492519d3d9 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -51,7 +51,7 @@ <member name="names" type="Dictionary" setter="" getter="get_names" default="{}"> A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. </member> - <member name="strings" type="Array" setter="" getter="get_strings" default="[ ]"> + <member name="strings" type="Array" setter="" getter="get_strings" default="[]"> An [Array] of the match and its capturing groups. </member> <member name="subject" type="String" setter="" getter="get_subject" default=""""> diff --git a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml index 8a1bb62e24..94fdff5d43 100644 --- a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray( )"> + <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contains the audio data in bytes. </member> <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false"> diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 0798375a96..9d51bd86a2 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -39,7 +39,7 @@ </argument> <argument index="1" name="node" type="VisualScriptNode"> </argument> - <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)"> </argument> <description> Add a node to the VisualScript. diff --git a/modules/visual_script/doc_classes/VisualScriptComment.xml b/modules/visual_script/doc_classes/VisualScriptComment.xml index 243338ea52..02cec97b27 100644 --- a/modules/visual_script/doc_classes/VisualScriptComment.xml +++ b/modules/visual_script/doc_classes/VisualScriptComment.xml @@ -15,7 +15,7 @@ <member name="description" type="String" setter="set_description" getter="get_description" default=""""> The text inside the comment node. </member> - <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 150, 150 )"> + <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(150, 150)"> The comment node's size (in pixels). </member> <member name="title" type="String" setter="set_title" getter="get_title" default=""Comment""> diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionState.xml b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml index 9ed71bf10e..16c1629fe4 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunctionState.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml @@ -28,7 +28,7 @@ <method name="resume"> <return type="Variant"> </return> - <argument index="0" name="args" type="Array" default="[ ]"> + <argument index="0" name="args" type="Array" default="[]"> </argument> <description> </description> diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index 4a1e020bd4..79addc5828 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -469,10 +469,11 @@ void VisualScriptPropertySelector::_item_selected() { at_class = ClassDB::get_parent_class_nocheck(at_class); } - Map<String, DocData::ClassDoc>::Element *T = dd->class_list.find(class_type); + Vector<String> functions = name.rsplit("/", false); + at_class = functions.size() > 3 ? functions[functions.size() - 2] : class_type; + Map<String, DocData::ClassDoc>::Element *T = dd->class_list.find(at_class); if (T) { for (int i = 0; i < T->get().methods.size(); i++) { - Vector<String> functions = name.rsplit("/", false, 1); if (T->get().methods[i].name == functions[functions.size() - 1]) { text = DTR(T->get().methods[i].description); } diff --git a/modules/websocket/doc_classes/WebSocketClient.xml b/modules/websocket/doc_classes/WebSocketClient.xml index d362bcc10f..6af610c689 100644 --- a/modules/websocket/doc_classes/WebSocketClient.xml +++ b/modules/websocket/doc_classes/WebSocketClient.xml @@ -17,11 +17,11 @@ </return> <argument index="0" name="url" type="String"> </argument> - <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()"> </argument> <argument index="2" name="gd_mp_api" type="bool" default="false"> </argument> - <argument index="3" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="3" name="custom_headers" type="PackedStringArray" default="PackedStringArray()"> </argument> <description> Connects to the given URL requesting one of the given [code]protocols[/code] as sub-protocol. If the list empty (default), no sub-protocol will be requested. diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml index f7805209e2..78f2832770 100644 --- a/modules/websocket/doc_classes/WebSocketServer.xml +++ b/modules/websocket/doc_classes/WebSocketServer.xml @@ -63,7 +63,7 @@ </return> <argument index="0" name="port" type="int"> </argument> - <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray( )"> + <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()"> </argument> <argument index="2" name="gd_mp_api" type="bool" default="false"> </argument> diff --git a/modules/websocket/websocket_client.cpp b/modules/websocket/websocket_client.cpp index 1e9183ebfa..27f0f9af6b 100644 --- a/modules/websocket/websocket_client.cpp +++ b/modules/websocket/websocket_client.cpp @@ -123,12 +123,12 @@ void WebSocketClient::_bind_methods() { ClassDB::bind_method(D_METHOD("set_verify_ssl_enabled", "enabled"), &WebSocketClient::set_verify_ssl_enabled); ClassDB::bind_method(D_METHOD("is_verify_ssl_enabled"), &WebSocketClient::is_verify_ssl_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "verify_ssl", PROPERTY_HINT_NONE, "", 0), "set_verify_ssl_enabled", "is_verify_ssl_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "verify_ssl", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_verify_ssl_enabled", "is_verify_ssl_enabled"); ClassDB::bind_method(D_METHOD("get_trusted_ssl_certificate"), &WebSocketClient::get_trusted_ssl_certificate); ClassDB::bind_method(D_METHOD("set_trusted_ssl_certificate"), &WebSocketClient::set_trusted_ssl_certificate); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trusted_ssl_certificate", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", 0), "set_trusted_ssl_certificate", "get_trusted_ssl_certificate"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trusted_ssl_certificate", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", PROPERTY_USAGE_NONE), "set_trusted_ssl_certificate", "get_trusted_ssl_certificate"); ADD_SIGNAL(MethodInfo("data_received")); ADD_SIGNAL(MethodInfo("connection_established", PropertyInfo(Variant::STRING, "protocol"))); diff --git a/modules/websocket/websocket_server.cpp b/modules/websocket/websocket_server.cpp index 7cf68b835c..dfe4471659 100644 --- a/modules/websocket/websocket_server.cpp +++ b/modules/websocket/websocket_server.cpp @@ -55,15 +55,15 @@ void WebSocketServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_private_key"), &WebSocketServer::get_private_key); ClassDB::bind_method(D_METHOD("set_private_key"), &WebSocketServer::set_private_key); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "private_key", PROPERTY_HINT_RESOURCE_TYPE, "CryptoKey", 0), "set_private_key", "get_private_key"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "private_key", PROPERTY_HINT_RESOURCE_TYPE, "CryptoKey", PROPERTY_USAGE_NONE), "set_private_key", "get_private_key"); ClassDB::bind_method(D_METHOD("get_ssl_certificate"), &WebSocketServer::get_ssl_certificate); ClassDB::bind_method(D_METHOD("set_ssl_certificate"), &WebSocketServer::set_ssl_certificate); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "ssl_certificate", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", 0), "set_ssl_certificate", "get_ssl_certificate"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "ssl_certificate", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", PROPERTY_USAGE_NONE), "set_ssl_certificate", "get_ssl_certificate"); ClassDB::bind_method(D_METHOD("get_ca_chain"), &WebSocketServer::get_ca_chain); ClassDB::bind_method(D_METHOD("set_ca_chain"), &WebSocketServer::set_ca_chain); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "ca_chain", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", 0), "set_ca_chain", "get_ca_chain"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "ca_chain", PROPERTY_HINT_RESOURCE_TYPE, "X509Certificate", PROPERTY_USAGE_NONE), "set_ca_chain", "get_ca_chain"); ADD_SIGNAL(MethodInfo("client_close_request", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::INT, "code"), PropertyInfo(Variant::STRING, "reason"))); ADD_SIGNAL(MethodInfo("client_disconnected", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::BOOL, "was_clean_close"))); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 1b14aac3da..a7edc6e6e5 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1049,19 +1049,19 @@ public: // Capabilities const char **basic = uwp_capabilities; while (*basic) { - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic).camelcase_to_underscore(false)), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic)), false)); basic++; } const char **uap = uwp_uap_capabilities; while (*uap) { - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap).camelcase_to_underscore(false)), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap)), false)); uap++; } const char **device = uwp_device_capabilities; while (*device) { - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device).camelcase_to_underscore(false)), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device)), false)); device++; } } diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index ca4b8d72a1..926997a715 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -724,7 +724,7 @@ void Camera2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotating"), "set_rotating", "is_rotating"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "_set_current", "is_current"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom"), "set_zoom", "get_zoom"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", PROPERTY_USAGE_NONE), "set_custom_viewport", "get_custom_viewport"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_callback", "get_process_callback"); ADD_GROUP("Limit", "limit_"); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 049d121213..9d86ec88be 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -458,13 +458,13 @@ void Node2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "skew", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_skew", "get_skew"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "skew_degrees", PROPERTY_HINT_RANGE, "-89.9,89.9,0.1", PROPERTY_USAGE_EDITOR), "set_skew_degrees", "get_skew_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", 0), "set_transform", "get_transform"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_transform", "get_transform"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale"); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_position", "get_global_position"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_rotation", "get_global_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_rotation_degrees", "get_global_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_scale", "get_global_scale"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_transform", "get_global_transform"); ADD_GROUP("Ordering", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index"); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 4b72043a46..ce63b25ce0 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -856,7 +856,7 @@ void RigidBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Dynamic,Static,DynamicLocked,Kinematic"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", 0), "set_inertia", "get_inertia"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_NONE), "set_inertia", "get_inertia"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "custom_integrator"), "set_use_custom_integrator", "is_using_custom_integrator"); @@ -1352,6 +1352,10 @@ ObjectID KinematicCollision2D::get_collider_id() const { return result.collider_id; } +RID KinematicCollision2D::get_collider_rid() const { + return result.collider; +} + Object *KinematicCollision2D::get_collider_shape() const { Object *collider = get_collider(); if (collider) { @@ -1385,6 +1389,7 @@ void KinematicCollision2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_local_shape"), &KinematicCollision2D::get_local_shape); ClassDB::bind_method(D_METHOD("get_collider"), &KinematicCollision2D::get_collider); ClassDB::bind_method(D_METHOD("get_collider_id"), &KinematicCollision2D::get_collider_id); + ClassDB::bind_method(D_METHOD("get_collider_rid"), &KinematicCollision2D::get_collider_rid); ClassDB::bind_method(D_METHOD("get_collider_shape"), &KinematicCollision2D::get_collider_shape); ClassDB::bind_method(D_METHOD("get_collider_shape_index"), &KinematicCollision2D::get_collider_shape_index); ClassDB::bind_method(D_METHOD("get_collider_velocity"), &KinematicCollision2D::get_collider_velocity); @@ -1397,6 +1402,7 @@ void KinematicCollision2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "local_shape"), "", "get_local_shape"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider"), "", "get_collider"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_id"), "", "get_collider_id"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "collider_rid"), "", "get_collider_rid"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider_shape"), "", "get_collider_shape"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape_index"), "", "get_collider_shape_index"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "collider_velocity"), "", "get_collider_velocity"); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 423f792132..f084a247aa 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -357,6 +357,7 @@ public: Object *get_local_shape() const; Object *get_collider() const; ObjectID get_collider_id() const; + RID get_collider_rid() const; Object *get_collider_shape() const; int get_collider_shape_index() const; Vector2 get_collider_velocity() const; diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 21083e6a4b..1eec2a3833 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -658,7 +658,7 @@ void Polygon2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_offset"), "set_texture_offset", "get_texture_offset"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_scale"), "set_texture_scale", "get_texture_scale"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_texture_rotation_degrees", "get_texture_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation", PROPERTY_HINT_NONE, "", 0), "set_texture_rotation", "get_texture_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_texture_rotation", "get_texture_rotation"); ADD_GROUP("Skeleton", ""); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton2D"), "set_skeleton", "get_skeleton"); diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visible_on_screen_notifier_2d.cpp index a73d60ada5..25237edacf 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visible_on_screen_notifier_2d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* visibility_notifier_2d.cpp */ +/* visible_on_screen_notifier_2d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "visibility_notifier_2d.h" +#include "visible_on_screen_notifier_2d.h" #include "core/config/engine.h" #include "gpu_particles_2d.h" @@ -39,16 +39,16 @@ #include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED -Rect2 VisibilityNotifier2D::_edit_get_rect() const { +Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const { return rect; } -bool VisibilityNotifier2D::_edit_use_rect() const { +bool VisibleOnScreenNotifier2D::_edit_use_rect() const { return true; } #endif -void VisibilityNotifier2D::_visibility_enter() { +void VisibleOnScreenNotifier2D::_visibility_enter() { if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) { return; } @@ -57,7 +57,7 @@ void VisibilityNotifier2D::_visibility_enter() { emit_signal(SceneStringNames::get_singleton()->screen_entered); _screen_enter(); } -void VisibilityNotifier2D::_visibility_exit() { +void VisibleOnScreenNotifier2D::_visibility_exit() { if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) { return; } @@ -67,23 +67,23 @@ void VisibilityNotifier2D::_visibility_exit() { _screen_exit(); } -void VisibilityNotifier2D::set_rect(const Rect2 &p_rect) { +void VisibleOnScreenNotifier2D::set_rect(const Rect2 &p_rect) { rect = p_rect; if (is_inside_tree()) { - RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibilityNotifier2D::_visibility_enter), callable_mp(this, &VisibilityNotifier2D::_visibility_exit)); + RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_exit)); } } -Rect2 VisibilityNotifier2D::get_rect() const { +Rect2 VisibleOnScreenNotifier2D::get_rect() const { return rect; } -void VisibilityNotifier2D::_notification(int p_what) { +void VisibleOnScreenNotifier2D::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { //get_world_2d()-> on_screen = false; - RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibilityNotifier2D::_visibility_enter), callable_mp(this, &VisibilityNotifier2D::_visibility_exit)); + RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_exit)); } break; case NOTIFICATION_DRAW: { if (Engine::get_singleton()->is_editor_hint()) { @@ -97,14 +97,14 @@ void VisibilityNotifier2D::_notification(int p_what) { } } -bool VisibilityNotifier2D::is_on_screen() const { +bool VisibleOnScreenNotifier2D::is_on_screen() const { return on_screen; } -void VisibilityNotifier2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_rect", "rect"), &VisibilityNotifier2D::set_rect); - ClassDB::bind_method(D_METHOD("get_rect"), &VisibilityNotifier2D::get_rect); - ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibilityNotifier2D::is_on_screen); +void VisibleOnScreenNotifier2D::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_rect", "rect"), &VisibleOnScreenNotifier2D::set_rect); + ClassDB::bind_method(D_METHOD("get_rect"), &VisibleOnScreenNotifier2D::get_rect); + ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibleOnScreenNotifier2D::is_on_screen); ADD_PROPERTY(PropertyInfo(Variant::RECT2, "rect"), "set_rect", "get_rect"); @@ -112,31 +112,31 @@ void VisibilityNotifier2D::_bind_methods() { ADD_SIGNAL(MethodInfo("screen_exited")); } -VisibilityNotifier2D::VisibilityNotifier2D() { +VisibleOnScreenNotifier2D::VisibleOnScreenNotifier2D() { rect = Rect2(-10, -10, 20, 20); } ////////////////////////////////////// -void VisibilityEnabler2D::_screen_enter() { +void VisibleOnScreenEnabler2D::_screen_enter() { _update_enable_mode(true); } -void VisibilityEnabler2D::_screen_exit() { +void VisibleOnScreenEnabler2D::_screen_exit() { _update_enable_mode(false); } -void VisibilityEnabler2D::set_enable_mode(EnableMode p_mode) { +void VisibleOnScreenEnabler2D::set_enable_mode(EnableMode p_mode) { enable_mode = p_mode; if (is_inside_tree()) { _update_enable_mode(is_on_screen()); } } -VisibilityEnabler2D::EnableMode VisibilityEnabler2D::get_enable_mode() { +VisibleOnScreenEnabler2D::EnableMode VisibleOnScreenEnabler2D::get_enable_mode() { return enable_mode; } -void VisibilityEnabler2D::set_enable_node_path(NodePath p_path) { +void VisibleOnScreenEnabler2D::set_enable_node_path(NodePath p_path) { if (enable_node_path == p_path) { return; } @@ -150,11 +150,11 @@ void VisibilityEnabler2D::set_enable_node_path(NodePath p_path) { } } } -NodePath VisibilityEnabler2D::get_enable_node_path() { +NodePath VisibleOnScreenEnabler2D::get_enable_node_path() { return enable_node_path; } -void VisibilityEnabler2D::_update_enable_mode(bool p_enable) { +void VisibleOnScreenEnabler2D::_update_enable_mode(bool p_enable) { Node *node = static_cast<Node *>(ObjectDB::get_instance(node_id)); if (node) { if (p_enable) { @@ -174,7 +174,7 @@ void VisibilityEnabler2D::_update_enable_mode(bool p_enable) { } } } -void VisibilityEnabler2D::_notification(int p_what) { +void VisibleOnScreenEnabler2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { if (Engine::get_singleton()->is_editor_hint()) { return; @@ -193,12 +193,12 @@ void VisibilityEnabler2D::_notification(int p_what) { } } -void VisibilityEnabler2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibilityEnabler2D::set_enable_mode); - ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibilityEnabler2D::get_enable_mode); +void VisibleOnScreenEnabler2D::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibleOnScreenEnabler2D::set_enable_mode); + ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibleOnScreenEnabler2D::get_enable_mode); - ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibilityEnabler2D::set_enable_node_path); - ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibilityEnabler2D::get_enable_node_path); + ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibleOnScreenEnabler2D::set_enable_node_path); + ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibleOnScreenEnabler2D::get_enable_node_path); ADD_GROUP("Enabling", "enable_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "enable_mode", PROPERTY_HINT_ENUM, "Inherit,Always,WhenPaused"), "set_enable_mode", "get_enable_mode"); @@ -209,5 +209,5 @@ void VisibilityEnabler2D::_bind_methods() { BIND_ENUM_CONSTANT(ENABLE_MODE_WHEN_PAUSED); } -VisibilityEnabler2D::VisibilityEnabler2D() { +VisibleOnScreenEnabler2D::VisibleOnScreenEnabler2D() { } diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visible_on_screen_notifier_2d.h index 8cb0989787..9c236a138f 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visible_on_screen_notifier_2d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* visibility_notifier_2d.h */ +/* visible_on_screen_notifier_2d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,14 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef VISIBILITY_NOTIFIER_2D_H -#define VISIBILITY_NOTIFIER_2D_H +#ifndef VISIBLE_ON_SCREEN_NOTIFIER_2D_H +#define VISIBLE_ON_SCREEN_NOTIFIER_2D_H #include "scene/2d/node_2d.h" class Viewport; -class VisibilityNotifier2D : public Node2D { - GDCLASS(VisibilityNotifier2D, Node2D); +class VisibleOnScreenNotifier2D : public Node2D { + GDCLASS(VisibleOnScreenNotifier2D, Node2D); Set<Viewport *> viewports; @@ -64,11 +64,11 @@ public: bool is_on_screen() const; - VisibilityNotifier2D(); + VisibleOnScreenNotifier2D(); }; -class VisibilityEnabler2D : public VisibilityNotifier2D { - GDCLASS(VisibilityEnabler2D, VisibilityNotifier2D); +class VisibleOnScreenEnabler2D : public VisibleOnScreenNotifier2D { + GDCLASS(VisibleOnScreenEnabler2D, VisibleOnScreenNotifier2D); public: enum EnableMode { @@ -97,9 +97,9 @@ public: void set_enable_node_path(NodePath p_path); NodePath get_enable_node_path(); - VisibilityEnabler2D(); + VisibleOnScreenEnabler2D(); }; -VARIANT_ENUM_CAST(VisibilityEnabler2D::EnableMode); +VARIANT_ENUM_CAST(VisibleOnScreenEnabler2D::EnableMode); #endif // VISIBILITY_NOTIFIER_2D_H diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index cad4330c17..9640043031 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -404,10 +404,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { break; } - List<Camera3D *> cameras; - world_3d->get_camera_list(&cameras); - - for (List<Camera3D *>::Element *E = cameras.front(); E; E = E->next()) { + for (const Set<Camera3D *>::Element *E = world_3d->get_cameras().front(); E; E = E->next()) { Camera3D *camera = E->get(); Viewport *vp = camera->get_viewport(); if (!vp->is_audio_listener()) { diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 6b8851b4f8..62bbebe6e7 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -93,10 +93,6 @@ void Camera3D::_update_camera() { } get_viewport()->_camera_transform_changed_notify(); - - if (get_world_3d().is_valid()) { - get_world_3d()->_update_camera(this); - } } void Camera3D::_notification(int p_what) { diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index e96b8ee1f9..f78a2ff14e 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -813,10 +813,10 @@ void Node3D::_bind_methods() { //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM3D,"transform/global",PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR ), "set_global_transform", "get_global_transform") ; ADD_GROUP("Transform", ""); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "global_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_transform", "get_global_transform"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_position", "get_position"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation", PROPERTY_HINT_NONE, "", 0), "set_rotation", "get_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_rotation", "get_rotation"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "top_level"), "set_as_top_level", "is_set_as_top_level"); ADD_GROUP("Matrix", ""); @@ -824,7 +824,7 @@ void Node3D::_bind_methods() { ADD_GROUP("Visibility", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "visible"), "set_visible", "is_visible"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "visibility_parent", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "GeometryInstance3D"), "set_visibility_parent", "get_visibility_parent"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "Node3DGizmo", 0), "set_gizmo", "get_gizmo"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "Node3DGizmo", PROPERTY_USAGE_NONE), "set_gizmo", "get_gizmo"); ADD_SIGNAL(MethodInfo("visibility_changed")); } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 25c7c3d798..28a0c72fe3 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1337,6 +1337,10 @@ ObjectID KinematicCollision3D::get_collider_id() const { return result.collider_id; } +RID KinematicCollision3D::get_collider_rid() const { + return result.collider; +} + Object *KinematicCollision3D::get_collider_shape() const { Object *collider = get_collider(); if (collider) { @@ -1370,6 +1374,7 @@ void KinematicCollision3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_local_shape"), &KinematicCollision3D::get_local_shape); ClassDB::bind_method(D_METHOD("get_collider"), &KinematicCollision3D::get_collider); ClassDB::bind_method(D_METHOD("get_collider_id"), &KinematicCollision3D::get_collider_id); + ClassDB::bind_method(D_METHOD("get_collider_rid"), &KinematicCollision3D::get_collider_rid); ClassDB::bind_method(D_METHOD("get_collider_shape"), &KinematicCollision3D::get_collider_shape); ClassDB::bind_method(D_METHOD("get_collider_shape_index"), &KinematicCollision3D::get_collider_shape_index); ClassDB::bind_method(D_METHOD("get_collider_velocity"), &KinematicCollision3D::get_collider_velocity); @@ -1382,6 +1387,7 @@ void KinematicCollision3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "local_shape"), "", "get_local_shape"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider"), "", "get_collider"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_id"), "", "get_collider_id"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "collider_rid"), "", "get_collider_rid"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider_shape"), "", "get_collider_shape"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape_index"), "", "get_collider_shape_index"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "collider_velocity"), "", "get_collider_velocity"); @@ -2187,7 +2193,7 @@ void PhysicalBone3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "joint_type", PROPERTY_HINT_ENUM, "None,PinJoint,ConeJoint,HingeJoint,SliderJoint,6DOFJoint"), "set_joint_type", "get_joint_type"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "joint_offset"), "set_joint_offset", "get_joint_offset"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "joint_rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_joint_rotation_degrees", "get_joint_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "joint_rotation", PROPERTY_HINT_NONE, "", 0), "set_joint_rotation", "get_joint_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "joint_rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_joint_rotation", "get_joint_rotation"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "body_offset"), "set_body_offset", "get_body_offset"); diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h index 8df3635be0..7d7adf1624 100644 --- a/scene/3d/physics_body_3d.h +++ b/scene/3d/physics_body_3d.h @@ -358,6 +358,7 @@ public: Object *get_local_shape() const; Object *get_collider() const; ObjectID get_collider_id() const; + RID get_collider_rid() const; Object *get_collider_shape() const; int get_collider_shape_index() const; Vector3 get_collider_velocity() const; diff --git a/scene/3d/visibility_notifier_3d.cpp b/scene/3d/visibility_notifier_3d.cpp deleted file mode 100644 index b230cb2fd7..0000000000 --- a/scene/3d/visibility_notifier_3d.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/*************************************************************************/ -/* visibility_notifier_3d.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "visibility_notifier_3d.h" - -#include "core/config/engine.h" -#include "scene/3d/camera_3d.h" -#include "scene/3d/physics_body_3d.h" -#include "scene/animation/animation_player.h" -#include "scene/scene_string_names.h" - -void VisibilityNotifier3D::_enter_camera(Camera3D *p_camera) { - ERR_FAIL_COND(cameras.has(p_camera)); - cameras.insert(p_camera); - if (cameras.size() == 1) { - emit_signal(SceneStringNames::get_singleton()->screen_entered); - _screen_enter(); - } - - emit_signal(SceneStringNames::get_singleton()->camera_entered, p_camera); -} - -void VisibilityNotifier3D::_exit_camera(Camera3D *p_camera) { - ERR_FAIL_COND(!cameras.has(p_camera)); - cameras.erase(p_camera); - - emit_signal(SceneStringNames::get_singleton()->camera_exited, p_camera); - if (cameras.size() == 0) { - emit_signal(SceneStringNames::get_singleton()->screen_exited); - - _screen_exit(); - } -} - -void VisibilityNotifier3D::set_aabb(const AABB &p_aabb) { - if (aabb == p_aabb) { - return; - } - aabb = p_aabb; - - if (is_inside_world()) { - get_world_3d()->_update_notifier(this, get_global_transform().xform(aabb)); - } - - update_gizmo(); -} - -AABB VisibilityNotifier3D::get_aabb() const { - return aabb; -} - -void VisibilityNotifier3D::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_WORLD: { - world = get_world_3d(); - ERR_FAIL_COND(!world.is_valid()); - world->_register_notifier(this, get_global_transform().xform(aabb)); - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { - world->_update_notifier(this, get_global_transform().xform(aabb)); - } break; - case NOTIFICATION_EXIT_WORLD: { - ERR_FAIL_COND(!world.is_valid()); - world->_remove_notifier(this); - } break; - } -} - -bool VisibilityNotifier3D::is_on_screen() const { - return cameras.size() != 0; -} - -void VisibilityNotifier3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_aabb", "rect"), &VisibilityNotifier3D::set_aabb); - ClassDB::bind_method(D_METHOD("get_aabb"), &VisibilityNotifier3D::get_aabb); - ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibilityNotifier3D::is_on_screen); - - ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb"); - - ADD_SIGNAL(MethodInfo("camera_entered", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"))); - ADD_SIGNAL(MethodInfo("camera_exited", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"))); - ADD_SIGNAL(MethodInfo("screen_entered")); - ADD_SIGNAL(MethodInfo("screen_exited")); -} - -VisibilityNotifier3D::VisibilityNotifier3D() { - set_notify_transform(true); -} - -////////////////////////////////////// - -void VisibilityEnabler3D::_screen_enter() { - for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) { - _change_node_state(E->key(), true); - } - - visible = true; -} - -void VisibilityEnabler3D::_screen_exit() { - for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) { - _change_node_state(E->key(), false); - } - - visible = false; -} - -void VisibilityEnabler3D::_find_nodes(Node *p_node) { - bool add = false; - Variant meta; - - { - RigidBody3D *rb = Object::cast_to<RigidBody3D>(p_node); - if (rb && ((rb->get_mode() == RigidBody3D::MODE_DYNAMIC || rb->get_mode() == RigidBody3D::MODE_DYNAMIC_LOCKED))) { - add = true; - meta = rb->get_mode(); - } - } - - { - AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(p_node); - if (ap) { - add = true; - } - } - - if (add) { - p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &VisibilityEnabler3D::_node_removed), varray(p_node), CONNECT_ONESHOT); - nodes[p_node] = meta; - _change_node_state(p_node, false); - } - - for (int i = 0; i < p_node->get_child_count(); i++) { - Node *c = p_node->get_child(i); - if (c->get_filename() != String()) { - continue; //skip, instance - } - - _find_nodes(c); - } -} - -void VisibilityEnabler3D::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - if (Engine::get_singleton()->is_editor_hint()) { - return; - } - - Node *from = this; - //find where current scene starts - while (from->get_parent() && from->get_filename() == String()) { - from = from->get_parent(); - } - - _find_nodes(from); - } - - if (p_what == NOTIFICATION_EXIT_TREE) { - if (Engine::get_singleton()->is_editor_hint()) { - return; - } - - for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) { - if (!visible) { - _change_node_state(E->key(), true); - } - E->key()->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &VisibilityEnabler3D::_node_removed)); - } - - nodes.clear(); - } -} - -void VisibilityEnabler3D::_change_node_state(Node *p_node, bool p_enabled) { - ERR_FAIL_COND(!nodes.has(p_node)); - - if (enabler[ENABLER_FREEZE_BODIES]) { - RigidBody3D *rb = Object::cast_to<RigidBody3D>(p_node); - if (rb) { - rb->set_sleeping(!p_enabled); - } - } - - if (enabler[ENABLER_PAUSE_ANIMATIONS]) { - AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(p_node); - - if (ap) { - ap->set_active(p_enabled); - } - } -} - -void VisibilityEnabler3D::_node_removed(Node *p_node) { - if (!visible) { - _change_node_state(p_node, true); - } - nodes.erase(p_node); -} - -void VisibilityEnabler3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_enabler", "enabler", "enabled"), &VisibilityEnabler3D::set_enabler); - ClassDB::bind_method(D_METHOD("is_enabler_enabled", "enabler"), &VisibilityEnabler3D::is_enabler_enabled); - - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_animations"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_ANIMATIONS); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "freeze_bodies"), "set_enabler", "is_enabler_enabled", ENABLER_FREEZE_BODIES); - - BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATIONS); - BIND_ENUM_CONSTANT(ENABLER_FREEZE_BODIES); - BIND_ENUM_CONSTANT(ENABLER_MAX); -} - -void VisibilityEnabler3D::set_enabler(Enabler p_enabler, bool p_enable) { - ERR_FAIL_INDEX(p_enabler, ENABLER_MAX); - enabler[p_enabler] = p_enable; -} - -bool VisibilityEnabler3D::is_enabler_enabled(Enabler p_enabler) const { - ERR_FAIL_INDEX_V(p_enabler, ENABLER_MAX, false); - return enabler[p_enabler]; -} - -VisibilityEnabler3D::VisibilityEnabler3D() { - for (int i = 0; i < ENABLER_MAX; i++) { - enabler[i] = true; - } -} diff --git a/scene/3d/visible_on_screen_notifier_3d.cpp b/scene/3d/visible_on_screen_notifier_3d.cpp new file mode 100644 index 0000000000..682bcec449 --- /dev/null +++ b/scene/3d/visible_on_screen_notifier_3d.cpp @@ -0,0 +1,203 @@ +/*************************************************************************/ +/* visible_on_screen_notifier_3d.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "visible_on_screen_notifier_3d.h" + +#include "core/config/engine.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/physics_body_3d.h" +#include "scene/animation/animation_player.h" +#include "scene/scene_string_names.h" + +void VisibleOnScreenNotifier3D::_visibility_enter() { + if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) { + return; + } + + on_screen = true; + emit_signal(SceneStringNames::get_singleton()->screen_entered); + _screen_enter(); +} +void VisibleOnScreenNotifier3D::_visibility_exit() { + if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) { + return; + } + + on_screen = false; + emit_signal(SceneStringNames::get_singleton()->screen_exited); + _screen_exit(); +} + +void VisibleOnScreenNotifier3D::set_aabb(const AABB &p_aabb) { + if (aabb == p_aabb) { + return; + } + aabb = p_aabb; + + RS::get_singleton()->visibility_notifier_set_aabb(get_base(), aabb); + + update_gizmo(); +} + +AABB VisibleOnScreenNotifier3D::get_aabb() const { + return aabb; +} + +bool VisibleOnScreenNotifier3D::is_on_screen() const { + return on_screen; +} + +void VisibleOnScreenNotifier3D::_notification(int p_what) { + if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_EXIT_TREE) { + on_screen = false; + } +} + +void VisibleOnScreenNotifier3D::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_aabb", "rect"), &VisibleOnScreenNotifier3D::set_aabb); + ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibleOnScreenNotifier3D::is_on_screen); + + ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb"); + + ADD_SIGNAL(MethodInfo("screen_entered")); + ADD_SIGNAL(MethodInfo("screen_exited")); +} + +Vector<Face3> VisibleOnScreenNotifier3D::get_faces(uint32_t p_usage_flags) const { + return Vector<Face3>(); +} + +VisibleOnScreenNotifier3D::VisibleOnScreenNotifier3D() { + RID notifier = RS::get_singleton()->visibility_notifier_create(); + RS::get_singleton()->visibility_notifier_set_aabb(notifier, aabb); + RS::get_singleton()->visibility_notifier_set_callbacks(notifier, callable_mp(this, &VisibleOnScreenNotifier3D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier3D::_visibility_exit)); + set_base(notifier); +} +VisibleOnScreenNotifier3D::~VisibleOnScreenNotifier3D() { + RID base = get_base(); + set_base(RID()); + RS::get_singleton()->free(base); +} + +////////////////////////////////////// + +void VisibleOnScreenEnabler3D::_screen_enter() { + _update_enable_mode(true); +} + +void VisibleOnScreenEnabler3D::_screen_exit() { + _update_enable_mode(false); +} + +void VisibleOnScreenEnabler3D::set_enable_mode(EnableMode p_mode) { + enable_mode = p_mode; + if (is_inside_tree()) { + _update_enable_mode(is_on_screen()); + } +} +VisibleOnScreenEnabler3D::EnableMode VisibleOnScreenEnabler3D::get_enable_mode() { + return enable_mode; +} + +void VisibleOnScreenEnabler3D::set_enable_node_path(NodePath p_path) { + if (enable_node_path == p_path) { + return; + } + enable_node_path = p_path; + if (is_inside_tree()) { + node_id = ObjectID(); + Node *node = get_node(enable_node_path); + if (node) { + node_id = node->get_instance_id(); + _update_enable_mode(is_on_screen()); + } + } +} +NodePath VisibleOnScreenEnabler3D::get_enable_node_path() { + return enable_node_path; +} + +void VisibleOnScreenEnabler3D::_update_enable_mode(bool p_enable) { + Node *node = static_cast<Node *>(ObjectDB::get_instance(node_id)); + if (node) { + if (p_enable) { + switch (enable_mode) { + case ENABLE_MODE_INHERIT: { + node->set_process_mode(PROCESS_MODE_INHERIT); + } break; + case ENABLE_MODE_ALWAYS: { + node->set_process_mode(PROCESS_MODE_ALWAYS); + } break; + case ENABLE_MODE_WHEN_PAUSED: { + node->set_process_mode(PROCESS_MODE_WHEN_PAUSED); + } break; + } + } else { + node->set_process_mode(PROCESS_MODE_DISABLED); + } + } +} +void VisibleOnScreenEnabler3D::_notification(int p_what) { + if (p_what == NOTIFICATION_ENTER_TREE) { + if (Engine::get_singleton()->is_editor_hint()) { + return; + } + + node_id = ObjectID(); + Node *node = get_node(enable_node_path); + if (node) { + node_id = node->get_instance_id(); + node->set_process_mode(PROCESS_MODE_DISABLED); + } + } + + if (p_what == NOTIFICATION_EXIT_TREE) { + node_id = ObjectID(); + } +} + +void VisibleOnScreenEnabler3D::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibleOnScreenEnabler3D::set_enable_mode); + ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibleOnScreenEnabler3D::get_enable_mode); + + ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibleOnScreenEnabler3D::set_enable_node_path); + ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibleOnScreenEnabler3D::get_enable_node_path); + + ADD_GROUP("Enabling", "enable_"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "enable_mode", PROPERTY_HINT_ENUM, "Inherit,Always,WhenPaused"), "set_enable_mode", "get_enable_mode"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "enable_node_path"), "set_enable_node_path", "get_enable_node_path"); + + BIND_ENUM_CONSTANT(ENABLE_MODE_INHERIT); + BIND_ENUM_CONSTANT(ENABLE_MODE_ALWAYS); + BIND_ENUM_CONSTANT(ENABLE_MODE_WHEN_PAUSED); +} + +VisibleOnScreenEnabler3D::VisibleOnScreenEnabler3D() { +} diff --git a/scene/3d/visibility_notifier_3d.h b/scene/3d/visible_on_screen_notifier_3d.h index 9f7705067f..fb7137c4f0 100644 --- a/scene/3d/visibility_notifier_3d.h +++ b/scene/3d/visible_on_screen_notifier_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* visibility_notifier_3d.h */ +/* visible_on_screen_notifier_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,74 +28,74 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef VISIBILITY_NOTIFIER_H -#define VISIBILITY_NOTIFIER_H +#ifndef VISIBLE_ON_SCREEN_NOTIFIER_3D_H +#define VISIBLE_ON_SCREEN_NOTIFIER_3D_H -#include "scene/3d/node_3d.h" +#include "scene/3d/visual_instance_3d.h" class World3D; class Camera3D; -class VisibilityNotifier3D : public Node3D { - GDCLASS(VisibilityNotifier3D, Node3D); - - Ref<World3D> world; - Set<Camera3D *> cameras; +class VisibleOnScreenNotifier3D : public VisualInstance3D { + GDCLASS(VisibleOnScreenNotifier3D, VisualInstance3D); AABB aabb = AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2)); +private: + bool on_screen = false; + void _visibility_enter(); + void _visibility_exit(); + protected: virtual void _screen_enter() {} virtual void _screen_exit() {} void _notification(int p_what); static void _bind_methods(); - friend struct SpatialIndexer; - - void _enter_camera(Camera3D *p_camera); - void _exit_camera(Camera3D *p_camera); public: void set_aabb(const AABB &p_aabb); - AABB get_aabb() const; + virtual AABB get_aabb() const override; bool is_on_screen() const; - VisibilityNotifier3D(); + virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const override; + + VisibleOnScreenNotifier3D(); + ~VisibleOnScreenNotifier3D(); }; -class VisibilityEnabler3D : public VisibilityNotifier3D { - GDCLASS(VisibilityEnabler3D, VisibilityNotifier3D); +class VisibleOnScreenEnabler3D : public VisibleOnScreenNotifier3D { + GDCLASS(VisibleOnScreenEnabler3D, VisibleOnScreenNotifier3D); public: - enum Enabler { - ENABLER_PAUSE_ANIMATIONS, - ENABLER_FREEZE_BODIES, - ENABLER_MAX + enum EnableMode { + ENABLE_MODE_INHERIT, + ENABLE_MODE_ALWAYS, + ENABLE_MODE_WHEN_PAUSED, }; protected: + ObjectID node_id; virtual void _screen_enter() override; virtual void _screen_exit() override; - bool visible = false; - - void _find_nodes(Node *p_node); - - Map<Node *, Variant> nodes; - void _node_removed(Node *p_node); - bool enabler[ENABLER_MAX]; - - void _change_node_state(Node *p_node, bool p_enabled); + EnableMode enable_mode = ENABLE_MODE_INHERIT; + NodePath enable_node_path = NodePath(".."); void _notification(int p_what); static void _bind_methods(); + void _update_enable_mode(bool p_enable); + public: - void set_enabler(Enabler p_enabler, bool p_enable); - bool is_enabler_enabled(Enabler p_enabler) const; + void set_enable_mode(EnableMode p_mode); + EnableMode get_enable_mode(); + + void set_enable_node_path(NodePath p_path); + NodePath get_enable_node_path(); - VisibilityEnabler3D(); + VisibleOnScreenEnabler3D(); }; -VARIANT_ENUM_CAST(VisibilityEnabler3D::Enabler); +VARIANT_ENUM_CAST(VisibleOnScreenEnabler3D::EnableMode); #endif // VISIBILITY_NOTIFIER_H diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 2d565fc47a..e3748a4ae1 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1657,16 +1657,16 @@ void AnimationPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_node"), "set_root", "get_root"); ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "current_animation", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ANIMATE_AS_TRIGGER), "set_current_animation", "get_current_animation"); - ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "assigned_animation", PROPERTY_HINT_NONE, "", 0), "set_assigned_animation", "get_assigned_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "assigned_animation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_assigned_animation", "get_assigned_animation"); ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "autoplay", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_autoplay", "get_autoplay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reset_on_save", PROPERTY_HINT_NONE, ""), "set_reset_on_save_enabled", "is_reset_on_save_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_length", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_length"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_position", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_position"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_length", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_current_animation_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_current_animation_position"); ADD_GROUP("Playback Options", "playback_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_process_callback", "get_process_callback"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_default_blend_time", "get_default_blend_time"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playback_active", PROPERTY_HINT_NONE, "", 0), "set_active", "is_active"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playback_active", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_active", "is_active"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::INT, "method_call_mode", PROPERTY_HINT_ENUM, "Deferred,Immediate"), "set_method_call_mode", "get_method_call_mode"); diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index bf6a877384..5b720945b8 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -218,6 +218,11 @@ void CodeEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { Ref<InputEventMouseButton> mb = p_gui_input; if (mb.is_valid()) { + /* Ignore mouse clicks in IME input mode. */ + if (has_ime_text()) { + return; + } + if (code_completion_active && code_completion_rect.has_point(mb->get_position())) { if (!mb->is_pressed()) { return; @@ -248,6 +253,30 @@ void CodeEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } cancel_code_completion(); set_code_hint(""); + + if (mb->is_pressed()) { + Vector2i mpos = mb->get_position(); + if (is_layout_rtl()) { + mpos.x = get_size().x - mpos.x; + } + + int line, col; + _get_mouse_pos(Point2i(mpos.x, mpos.y), line, col); + + if (mb->get_button_index() == MOUSE_BUTTON_LEFT) { + if (is_line_folded(line)) { + int wrap_index = get_line_wrap_index_at_col(line, col); + if (wrap_index == times_line_wraps(line)) { + int eol_icon_width = cache.folded_eol_icon->get_width(); + int left_margin = get_total_gutter_width() + eol_icon_width + get_line_width(line, wrap_index) - get_h_scroll(); + if (mpos.x > left_margin && mpos.x <= left_margin + eol_icon_width + 3) { + unfold_line(line); + return; + } + } + } + } + } } Ref<InputEventKey> k = p_gui_input; @@ -356,6 +385,16 @@ void CodeEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { set_code_hint(""); } + /* Override input to unfold lines where needed. */ + if (!is_readonly()) { + if (k->is_action("ui_text_newline_above", true) || k->is_action("ui_text_newline_blank", true) || k->is_action("ui_text_newline", true)) { + unfold_line(cursor_get_line()); + } + if (cursor_get_line() > 0 && k->is_action("ui_text_backspace", true)) { + unfold_line(cursor_get_line() - 1); + } + } + /* Remove shift otherwise actions will not match. */ k = k->duplicate(); k->set_shift_pressed(false); @@ -380,6 +419,21 @@ Control::CursorShape CodeEdit::get_cursor_shape(const Point2 &p_pos) const { if ((code_completion_active && code_completion_rect.has_point(p_pos)) || (is_readonly() && (!is_selecting_enabled() || get_line_count() == 0))) { return CURSOR_ARROW; } + + int line, col; + _get_mouse_pos(p_pos, line, col); + + if (is_line_folded(line)) { + int wrap_index = get_line_wrap_index_at_col(line, col); + if (wrap_index == times_line_wraps(line)) { + int eol_icon_width = cache.folded_eol_icon->get_width(); + int left_margin = get_total_gutter_width() + eol_icon_width + get_line_width(line, wrap_index) - get_h_scroll(); + if (p_pos.x > left_margin && p_pos.x <= left_margin + eol_icon_width + 3) { + return CURSOR_POINTING_HAND; + } + } + } + return TextEdit::get_cursor_shape(p_pos); } @@ -581,7 +635,7 @@ bool CodeEdit::is_drawing_fold_gutter() const { } void CodeEdit::_fold_gutter_draw_callback(int p_line, int p_gutter, Rect2 p_region) { - if (!can_fold(p_line) && !is_folded(p_line)) { + if (!can_fold_line(p_line) && !is_line_folded(p_line)) { set_line_gutter_clickable(p_line, fold_gutter, false); return; } @@ -593,13 +647,193 @@ void CodeEdit::_fold_gutter_draw_callback(int p_line, int p_gutter, Rect2 p_regi p_region.position += Point2(horizontal_padding, vertical_padding); p_region.size -= Point2(horizontal_padding, vertical_padding) * 2; - if (can_fold(p_line)) { + if (can_fold_line(p_line)) { can_fold_icon->draw_rect(get_canvas_item(), p_region, false, folding_color); return; } folded_icon->draw_rect(get_canvas_item(), p_region, false, folding_color); } +/* Line Folding */ +void CodeEdit::set_line_folding_enabled(bool p_enabled) { + line_folding_enabled = p_enabled; + set_hiding_enabled(p_enabled); +} + +bool CodeEdit::is_line_folding_enabled() const { + return line_folding_enabled; +} + +bool CodeEdit::can_fold_line(int p_line) const { + ERR_FAIL_INDEX_V(p_line, get_line_count(), false); + if (!line_folding_enabled) { + return false; + } + + if (p_line + 1 >= get_line_count() || get_line(p_line).strip_edges().size() == 0) { + return false; + } + + if (is_line_hidden(p_line) || is_line_folded(p_line)) { + return false; + } + + /* Check for full multiline line or block strings / comments. */ + int in_comment = is_in_comment(p_line); + int in_string = (in_comment == -1) ? is_in_string(p_line) : -1; + if (in_string != -1 || in_comment != -1) { + if (get_delimiter_start_position(p_line, get_line(p_line).size() - 1).y != p_line) { + return false; + } + + int delimter_end_line = get_delimiter_end_position(p_line, get_line(p_line).size() - 1).y; + /* No end line, therefore we have a multiline region over the rest of the file. */ + if (delimter_end_line == -1) { + return true; + } + /* End line is the same therefore we have a block. */ + if (delimter_end_line == p_line) { + /* Check we are the start of the block. */ + if (p_line - 1 >= 0) { + if ((in_string != -1 && is_in_string(p_line - 1) != -1) || (in_comment != -1 && is_in_comment(p_line - 1) != -1)) { + return false; + } + } + /* Check it continues for at least one line. */ + return ((in_string != -1 && is_in_string(p_line + 1) != -1) || (in_comment != -1 && is_in_comment(p_line + 1) != -1)); + } + return ((in_string != -1 && is_in_string(delimter_end_line) != -1) || (in_comment != -1 && is_in_comment(delimter_end_line) != -1)); + } + + /* Otherwise check indent levels. */ + int start_indent = get_indent_level(p_line); + for (int i = p_line + 1; i < get_line_count(); i++) { + if (is_in_string(i) != -1 || is_in_comment(i) != -1 || get_line(i).strip_edges().size() == 0) { + continue; + } + return (get_indent_level(i) > start_indent); + } + return false; +} + +void CodeEdit::fold_line(int p_line) { + ERR_FAIL_INDEX(p_line, get_line_count()); + if (!is_line_folding_enabled() || !can_fold_line(p_line)) { + return; + } + + /* Find the last line to be hidden. */ + int end_line = get_line_count(); + + int in_comment = is_in_comment(p_line); + int in_string = (in_comment == -1) ? is_in_string(p_line) : -1; + if (in_string != -1 || in_comment != -1) { + end_line = get_delimiter_end_position(p_line, get_line(p_line).size() - 1).y; + /* End line is the same therefore we have a block. */ + if (end_line == p_line) { + for (int i = p_line + 1; i < get_line_count(); i++) { + if ((in_string != -1 && is_in_string(i) == -1) || (in_comment != -1 && is_in_comment(i) == -1)) { + end_line = i - 1; + break; + } + } + } + } else { + int start_indent = get_indent_level(p_line); + for (int i = p_line + 1; i < get_line_count(); i++) { + if (get_line(p_line).strip_edges().size() == 0 || is_in_string(i) != -1 || is_in_comment(i) != -1) { + end_line = i; + continue; + } + + if (get_indent_level(i) <= start_indent && get_line(i).strip_edges().size() != 0) { + end_line = i - 1; + break; + } + } + } + + for (int i = p_line + 1; i <= end_line; i++) { + set_line_as_hidden(i, true); + } + + /* Fix selection. */ + if (is_selection_active()) { + if (is_line_hidden(get_selection_from_line()) && is_line_hidden(get_selection_to_line())) { + deselect(); + } else if (is_line_hidden(get_selection_from_line())) { + select(p_line, 9999, get_selection_to_line(), get_selection_to_column()); + } else if (is_line_hidden(get_selection_to_line())) { + select(get_selection_from_line(), get_selection_from_column(), p_line, 9999); + } + } + + /* Reset caret. */ + if (is_line_hidden(cursor_get_line())) { + cursor_set_line(p_line, false, false); + cursor_set_column(get_line(p_line).length(), false); + } + update(); +} + +void CodeEdit::unfold_line(int p_line) { + ERR_FAIL_INDEX(p_line, get_line_count()); + if (!is_line_folded(p_line) && !is_line_hidden(p_line)) { + return; + } + + int fold_start = p_line; + for (; fold_start > 0; fold_start--) { + if (is_line_folded(fold_start)) { + break; + } + } + fold_start = is_line_folded(fold_start) ? fold_start : p_line; + + for (int i = fold_start + 1; i < get_line_count(); i++) { + if (!is_line_hidden(i)) { + break; + } + set_line_as_hidden(i, false); + } + update(); +} + +void CodeEdit::fold_all_lines() { + for (int i = 0; i < get_line_count(); i++) { + fold_line(i); + } + update(); +} + +void CodeEdit::unfold_all_lines() { + unhide_all_lines(); +} + +void CodeEdit::toggle_foldable_line(int p_line) { + ERR_FAIL_INDEX(p_line, get_line_count()); + if (is_line_folded(p_line)) { + unfold_line(p_line); + return; + } + fold_line(p_line); +} + +bool CodeEdit::is_line_folded(int p_line) const { + ERR_FAIL_INDEX_V(p_line, get_line_count(), false); + return p_line + 1 < get_line_count() && !is_line_hidden(p_line) && is_line_hidden(p_line + 1); +} + +TypedArray<int> CodeEdit::get_folded_lines() const { + TypedArray<int> folded_lines; + for (int i = 0; i < get_line_count(); i++) { + if (is_line_folded(i)) { + folded_lines.push_back(i); + } + } + return folded_lines; +} + /* Delimiters */ // Strings void CodeEdit::add_string_delimiter(const String &p_start_key, const String &p_end_key, bool p_line_only) { @@ -1094,6 +1328,21 @@ void CodeEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_draw_fold_gutter", "enable"), &CodeEdit::set_draw_fold_gutter); ClassDB::bind_method(D_METHOD("is_drawing_fold_gutter"), &CodeEdit::is_drawing_fold_gutter); + /* Line folding */ + ClassDB::bind_method(D_METHOD("set_line_folding_enabled", "enabled"), &CodeEdit::set_line_folding_enabled); + ClassDB::bind_method(D_METHOD("is_line_folding_enabled"), &CodeEdit::is_line_folding_enabled); + + ClassDB::bind_method(D_METHOD("can_fold_line", "line"), &CodeEdit::can_fold_line); + + ClassDB::bind_method(D_METHOD("fold_line", "line"), &CodeEdit::fold_line); + ClassDB::bind_method(D_METHOD("unfold_line", "line"), &CodeEdit::unfold_line); + ClassDB::bind_method(D_METHOD("fold_all_lines"), &CodeEdit::fold_all_lines); + ClassDB::bind_method(D_METHOD("unfold_all_lines"), &CodeEdit::unfold_all_lines); + ClassDB::bind_method(D_METHOD("toggle_foldable_line", "line"), &CodeEdit::toggle_foldable_line); + + ClassDB::bind_method(D_METHOD("is_line_folded", "line"), &CodeEdit::is_line_folded); + ClassDB::bind_method(D_METHOD("get_folded_lines"), &CodeEdit::get_folded_lines); + /* Delimiters */ // Strings ClassDB::bind_method(D_METHOD("add_string_delimiter", "start_key", "end_key", "line_only"), &CodeEdit::add_string_delimiter, DEFVAL(false)); @@ -1175,6 +1424,8 @@ void CodeEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_fold_gutter"), "set_draw_fold_gutter", "is_drawing_fold_gutter"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "line_folding"), "set_line_folding_enabled", "is_line_folding_enabled"); + ADD_GROUP("Delimiters", "delimiter_"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "delimiter_strings"), "set_string_delimiters", "get_string_delimiters"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "delimiter_comments"), "set_comment_delimiters", "get_comment_delimiters"); @@ -1205,9 +1456,9 @@ void CodeEdit::_gutter_clicked(int p_line, int p_gutter) { } if (p_gutter == fold_gutter) { - if (is_folded(p_line)) { + if (is_line_folded(p_line)) { unfold_line(p_line); - } else if (can_fold(p_line)) { + } else if (can_fold_line(p_line)) { fold_line(p_line); } return; diff --git a/scene/gui/code_edit.h b/scene/gui/code_edit.h index 6305eacf83..52b3f52a03 100644 --- a/scene/gui/code_edit.h +++ b/scene/gui/code_edit.h @@ -98,6 +98,9 @@ private: void _gutter_clicked(int p_line, int p_gutter); void _update_gutter_indexes(); + /* Line Folding */ + bool line_folding_enabled = true; + /* Delimiters */ enum DelimiterType { TYPE_STRING, @@ -241,6 +244,21 @@ public: void set_draw_fold_gutter(bool p_draw); bool is_drawing_fold_gutter() const; + /* Line Folding */ + void set_line_folding_enabled(bool p_enabled); + bool is_line_folding_enabled() const; + + bool can_fold_line(int p_line) const; + + void fold_line(int p_line); + void unfold_line(int p_line); + void fold_all_lines(); + void unfold_all_lines(); + void toggle_foldable_line(int p_line); + + bool is_line_folded(int p_line) const; + TypedArray<int> get_folded_lines() const; + /* Delimiters */ void add_string_delimiter(const String &p_start_key, const String &p_end_key, bool p_line_only = false); void remove_string_delimiter(const String &p_start_key); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index c0b4563615..f394b9e3a5 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -289,7 +289,7 @@ void ColorPicker::_value_changed(double) { emit_signal("color_changed", color); } -void ColorPicker::_html_entered(const String &p_html) { +void ColorPicker::_html_submitted(const String &p_html) { if (updating || text_is_constructor || !c_text->is_visible()) { return; } @@ -1041,7 +1041,7 @@ void ColorPicker::_html_focus_exit() { if (c_text->get_menu()->is_visible()) { return; } - _html_entered(c_text->get_text()); + _html_submitted(c_text->get_text()); _focus_exit(); } @@ -1204,7 +1204,7 @@ ColorPicker::ColorPicker() : hhb->add_child(c_text); c_text->set_h_size_flags(SIZE_EXPAND_FILL); - c_text->connect("text_entered", callable_mp(this, &ColorPicker::_html_entered)); + c_text->connect("text_submitted", callable_mp(this, &ColorPicker::_html_submitted)); c_text->connect("focus_entered", callable_mp(this, &ColorPicker::_focus_enter)); c_text->connect("focus_exited", callable_mp(this, &ColorPicker::_html_focus_exit)); diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 14113467d0..3bd2ff9375 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -104,7 +104,7 @@ private: float v = 0.0; Color last_hsv; - void _html_entered(const String &p_html); + void _html_submitted(const String &p_html); void _value_changed(double); void _update_controls(); void _update_color(bool p_update_sliders = true); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index c84627c21e..64a3f1ca77 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2807,7 +2807,7 @@ void Control::_bind_methods() { ADD_GROUP("Rect", "rect_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_position", "get_position"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_global_position", PROPERTY_HINT_NONE, "", 0), "_set_global_position", "get_global_position"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_global_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_global_position", "get_global_position"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_min_size"), "set_custom_minimum_size", "get_custom_minimum_size"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rect_rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation"); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 7cae091c57..f63ae7569f 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -97,7 +97,7 @@ void AcceptDialog::_notification(int p_what) { } } -void AcceptDialog::_text_entered(const String &p_text) { +void AcceptDialog::_text_submitted(const String &p_text) { _ok_pressed(); } @@ -159,7 +159,7 @@ void AcceptDialog::register_text_enter(Control *p_line_edit) { ERR_FAIL_NULL(p_line_edit); LineEdit *line_edit = Object::cast_to<LineEdit>(p_line_edit); if (line_edit) { - line_edit->connect("text_entered", callable_mp(this, &AcceptDialog::_text_entered)); + line_edit->connect("text_submitted", callable_mp(this, &AcceptDialog::_text_submitted)); } } diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 69035001c0..d389806fff 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -69,7 +69,7 @@ protected: virtual void custom_action(const String &) {} // Not private since used by derived classes signal. - void _text_entered(const String &p_text); + void _text_submitted(const String &p_text); void _ok_pressed(); void _cancel_pressed(); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 806039d7ac..f8cee6daec 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -116,7 +116,7 @@ void FileDialog::_unhandled_input(const Ref<InputEvent> &p_event) { invalidate(); } break; case KEY_BACKSPACE: { - _dir_entered(".."); + _dir_submitted(".."); } break; default: { handled = false; @@ -156,7 +156,7 @@ void FileDialog::update_dir() { deselect_all(); } -void FileDialog::_dir_entered(String p_dir) { +void FileDialog::_dir_submitted(String p_dir) { dir_access->change_dir(p_dir); file->set_text(""); invalidate(); @@ -164,7 +164,7 @@ void FileDialog::_dir_entered(String p_dir) { _push_history(); } -void FileDialog::_file_entered(const String &p_file) { +void FileDialog::_file_submitted(const String &p_file) { _action_pressed(); } @@ -1020,8 +1020,8 @@ FileDialog::FileDialog() { tree->connect("cell_selected", callable_mp(this, &FileDialog::_tree_selected), varray(), CONNECT_DEFERRED); tree->connect("item_activated", callable_mp(this, &FileDialog::_tree_item_activated), varray()); tree->connect("nothing_selected", callable_mp(this, &FileDialog::deselect_all)); - dir->connect("text_entered", callable_mp(this, &FileDialog::_dir_entered)); - file->connect("text_entered", callable_mp(this, &FileDialog::_file_entered)); + dir->connect("text_submitted", callable_mp(this, &FileDialog::_dir_submitted)); + file->connect("text_submitted", callable_mp(this, &FileDialog::_file_submitted)); filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 55774b488c..7fbafc4bb4 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -118,8 +118,8 @@ private: void _select_drive(int p_idx); void _tree_item_activated(); - void _dir_entered(String p_dir); - void _file_entered(const String &p_file); + void _dir_submitted(String p_dir); + void _file_submitted(const String &p_file); void _action_pressed(); void _save_confirm_pressed(); void _cancel_pressed(); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 1e444e439d..5ef89e38f0 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -40,18 +40,8 @@ #include "editor/editor_scale.h" #endif -#define ZOOM_SCALE 1.2 - -// Allow dezooming 8 times from the default zoom level. -// At low zoom levels, text is unreadable due to its small size and poor filtering, -// but this is still useful for previewing purposes. -#define MIN_ZOOM (1 / Math::pow(ZOOM_SCALE, 8)) - -// Allow zooming 4 times from the default zoom level. -#define MAX_ZOOM (1 * Math::pow(ZOOM_SCALE, 4)) - -#define MINIMAP_OFFSET 12 -#define MINIMAP_PADDING 5 +constexpr int MINIMAP_OFFSET = 12; +constexpr int MINIMAP_PADDING = 5; bool GraphEditFilter::has_point(const Point2 &p_point) const { return ge->_filter_input(p_point); @@ -1077,8 +1067,9 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { Ref<InputEventMouseMotion> mm = p_ev; if (mm.is_valid() && (mm->get_button_mask() & MOUSE_BUTTON_MASK_MIDDLE || (mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) { - h_scroll->set_value(h_scroll->get_value() - mm->get_relative().x); - v_scroll->set_value(v_scroll->get_value() - mm->get_relative().y); + Vector2i relative = Input::get_singleton()->warp_mouse_motion(mm, get_global_rect()); + h_scroll->set_value(h_scroll->get_value() - relative.x); + v_scroll->set_value(v_scroll->get_value() - relative.y); } if (mm.is_valid() && dragging) { @@ -1327,18 +1318,20 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { minimap->update(); } - if (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP && Input::get_singleton()->is_key_pressed(KEY_CTRL)) { - set_zoom_custom(zoom * ZOOM_SCALE, b->get_position()); - } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && Input::get_singleton()->is_key_pressed(KEY_CTRL)) { - set_zoom_custom(zoom / ZOOM_SCALE, b->get_position()); - } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { - v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8); - } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { - v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * b->get_factor() / 8); - } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_RIGHT || (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && Input::get_singleton()->is_key_pressed(KEY_SHIFT))) { - h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * b->get_factor() / 8); - } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_LEFT || (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP && Input::get_singleton()->is_key_pressed(KEY_SHIFT))) { - h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * b->get_factor() / 8); + int scroll_direction = (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN) - (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP); + if (scroll_direction != 0) { + if (b->is_ctrl_pressed()) { + if (b->is_shift_pressed()) { + // Horizontal scrolling. + h_scroll->set_value(h_scroll->get_value() + (h_scroll->get_page() * b->get_factor() / 8) * scroll_direction); + } else { + // Vertical scrolling. + v_scroll->set_value(v_scroll->get_value() + (v_scroll->get_page() * b->get_factor() / 8) * scroll_direction); + } + } else { + // Zooming. + set_zoom_custom(scroll_direction < 0 ? zoom * zoom_step : zoom / zoom_step, b->get_position()); + } } } @@ -1397,19 +1390,19 @@ void GraphEdit::set_zoom(float p_zoom) { } void GraphEdit::set_zoom_custom(float p_zoom, const Vector2 &p_center) { - p_zoom = CLAMP(p_zoom, MIN_ZOOM, MAX_ZOOM); + p_zoom = CLAMP(p_zoom, zoom_min, zoom_max); if (zoom == p_zoom) { return; } - zoom_minus->set_disabled(zoom == MIN_ZOOM); - zoom_plus->set_disabled(zoom == MAX_ZOOM); - Vector2 sbofs = (Vector2(h_scroll->get_value(), v_scroll->get_value()) + p_center) / zoom; zoom = p_zoom; top_layer->update(); + zoom_minus->set_disabled(zoom == zoom_min); + zoom_plus->set_disabled(zoom == zoom_max); + _update_scroll(); minimap->update(); connections_layer->update(); @@ -1420,6 +1413,7 @@ void GraphEdit::set_zoom_custom(float p_zoom, const Vector2 &p_center) { v_scroll->set_value(ofs.y); } + _update_zoom_label(); update(); } @@ -1427,6 +1421,61 @@ float GraphEdit::get_zoom() const { return zoom; } +void GraphEdit::set_zoom_step(float p_zoom_step) { + p_zoom_step = abs(p_zoom_step); + if (zoom_step == p_zoom_step) { + return; + } + + zoom_step = p_zoom_step; +} + +float GraphEdit::get_zoom_step() const { + return zoom_step; +} + +void GraphEdit::set_zoom_min(float p_zoom_min) { + ERR_FAIL_COND_MSG(p_zoom_min > zoom_max, "Cannot set min zoom level greater than max zoom level."); + + if (zoom_min == p_zoom_min) { + return; + } + + zoom_min = p_zoom_min; + set_zoom(zoom); +} + +float GraphEdit::get_zoom_min() const { + return zoom_min; +} + +void GraphEdit::set_zoom_max(float p_zoom_max) { + ERR_FAIL_COND_MSG(p_zoom_max < zoom_min, "Cannot set max zoom level lesser than min zoom level."); + + if (zoom_max == p_zoom_max) { + return; + } + + zoom_max = p_zoom_max; + set_zoom(zoom); +} + +float GraphEdit::get_zoom_max() const { + return zoom_max; +} + +void GraphEdit::set_show_zoom_label(bool p_enable) { + if (zoom_label->is_visible() == p_enable) { + return; + } + + zoom_label->set_visible(p_enable); +} + +bool GraphEdit::is_showing_zoom_label() const { + return zoom_label->is_visible(); +} + void GraphEdit::set_right_disconnects(bool p_enable) { right_disconnects = p_enable; } @@ -1467,7 +1516,7 @@ Array GraphEdit::_get_connection_list() const { } void GraphEdit::_zoom_minus() { - set_zoom(zoom / ZOOM_SCALE); + set_zoom(zoom / zoom_step); } void GraphEdit::_zoom_reset() { @@ -1475,7 +1524,13 @@ void GraphEdit::_zoom_reset() { } void GraphEdit::_zoom_plus() { - set_zoom(zoom * ZOOM_SCALE); + set_zoom(zoom * zoom_step); +} + +void GraphEdit::_update_zoom_label() { + int zoom_percent = static_cast<int>(Math::round(zoom * 100)); + String zoom_text = itos(zoom_percent) + "%"; + zoom_label->set_text(zoom_text); } void GraphEdit::add_valid_connection_type(int p_type, int p_with_type) { @@ -1616,6 +1671,18 @@ void GraphEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_zoom", "zoom"), &GraphEdit::set_zoom); ClassDB::bind_method(D_METHOD("get_zoom"), &GraphEdit::get_zoom); + ClassDB::bind_method(D_METHOD("set_zoom_min", "zoom_min"), &GraphEdit::set_zoom_min); + ClassDB::bind_method(D_METHOD("get_zoom_min"), &GraphEdit::get_zoom_min); + + ClassDB::bind_method(D_METHOD("set_zoom_max", "zoom_max"), &GraphEdit::set_zoom_max); + ClassDB::bind_method(D_METHOD("get_zoom_max"), &GraphEdit::get_zoom_max); + + ClassDB::bind_method(D_METHOD("set_zoom_step", "zoom_step"), &GraphEdit::set_zoom_step); + ClassDB::bind_method(D_METHOD("get_zoom_step"), &GraphEdit::get_zoom_step); + + ClassDB::bind_method(D_METHOD("set_show_zoom_label", "enable"), &GraphEdit::set_show_zoom_label); + ClassDB::bind_method(D_METHOD("is_showing_zoom_label"), &GraphEdit::is_showing_zoom_label); + ClassDB::bind_method(D_METHOD("set_snap", "pixels"), &GraphEdit::set_snap); ClassDB::bind_method(D_METHOD("get_snap"), &GraphEdit::get_snap); @@ -1650,9 +1717,18 @@ void GraphEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scroll_offset"), "set_scroll_ofs", "get_scroll_ofs"); ADD_PROPERTY(PropertyInfo(Variant::INT, "snap_distance"), "set_snap", "get_snap"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_snap"), "set_use_snap", "is_using_snap"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom"), "set_zoom", "get_zoom"); + + ADD_GROUP("Connection Lines", "connection_lines"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "connection_lines_thickness"), "set_connection_lines_thickness", "get_connection_lines_thickness"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "connection_lines_antialiased"), "set_connection_lines_antialiased", "is_connection_lines_antialiased"); + + ADD_GROUP("Zoom", ""); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom"), "set_zoom", "get_zoom"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom_min"), "set_zoom_min", "get_zoom_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom_max"), "set_zoom_max", "get_zoom_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom_step"), "set_zoom_step", "get_zoom_step"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_zoom_label"), "set_show_zoom_label", "is_showing_zoom_label"); + ADD_GROUP("Minimap", "minimap"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "minimap_enabled"), "set_minimap_enabled", "is_minimap_enabled"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "minimap_size"), "set_minimap_size", "get_minimap_size"); @@ -1677,6 +1753,13 @@ void GraphEdit::_bind_methods() { GraphEdit::GraphEdit() { set_focus_mode(FOCUS_ALL); + // Allow dezooming 8 times from the default zoom level. + // At low zoom levels, text is unreadable due to its small size and poor filtering, + // but this is still useful for previewing and navigation. + zoom_min = (1 / Math::pow(zoom_step, 8)); + // Allow zooming 4 times from the default zoom level. + zoom_max = (1 * Math::pow(zoom_step, 4)); + top_layer = memnew(GraphEditFilter(this)); add_child(top_layer); top_layer->set_mouse_filter(MOUSE_FILTER_PASS); @@ -1713,6 +1796,18 @@ GraphEdit::GraphEdit() { top_layer->add_child(zoom_hb); zoom_hb->set_position(Vector2(10, 10)); + zoom_label = memnew(Label); + zoom_hb->add_child(zoom_label); + zoom_label->set_visible(false); + zoom_label->set_v_size_flags(Control::SIZE_SHRINK_CENTER); + zoom_label->set_align(Label::ALIGN_CENTER); +#ifdef TOOLS_ENABLED + zoom_label->set_custom_minimum_size(Size2(48, 0) * EDSCALE); +#else + zoom_label->set_custom_minimum_size(Size2(48, 0)); +#endif + _update_zoom_label(); + zoom_minus = memnew(Button); zoom_minus->set_flat(true); zoom_hb->add_child(zoom_minus); diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 8a51bcb11e..e8300f901c 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -34,6 +34,7 @@ #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/graph_node.h" +#include "scene/gui/label.h" #include "scene/gui/scroll_bar.h" #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" @@ -105,6 +106,7 @@ public: }; private: + Label *zoom_label; Button *zoom_minus; Button *zoom_reset; Button *zoom_plus; @@ -114,10 +116,6 @@ private: Button *minimap_button; - void _zoom_minus(); - void _zoom_reset(); - void _zoom_plus(); - HScrollBar *h_scroll; VScrollBar *v_scroll; @@ -144,6 +142,14 @@ private: Vector2 drag_accum; float zoom = 1.0; + float zoom_step = 1.2; + float zoom_min; + float zoom_max; + + void _zoom_minus(); + void _zoom_reset(); + void _zoom_plus(); + void _update_zoom_label(); bool box_selecting = false; bool box_selection_mode_additive = false; @@ -247,6 +253,18 @@ public: void set_zoom_custom(float p_zoom, const Vector2 &p_center); float get_zoom() const; + void set_zoom_min(float p_zoom_min); + float get_zoom_min() const; + + void set_zoom_max(float p_zoom_max); + float get_zoom_max() const; + + void set_zoom_step(float p_zoom_step); + float get_zoom_step() const; + + void set_show_zoom_label(bool p_enable); + bool is_showing_zoom_label() const; + void set_minimap_size(Vector2 p_size); Vector2 get_minimap_size() const; void set_minimap_opacity(float p_opacity); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index c2ed9c1a3c..089893e63b 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -357,9 +357,9 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { } } - // Default is ENTER, KP_ENTER. Cannot use ui_accept as default includes SPACE - if (k->is_action("ui_text_newline", true)) { - emit_signal("text_entered", text); + // Default is ENTER and KP_ENTER. Cannot use ui_accept as default includes SPACE + if (k->is_action("ui_text_submit", false)) { + emit_signal("text_submitted", text); if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) { DisplayServer::get_singleton()->virtual_keyboard_hide(); } @@ -2159,7 +2159,7 @@ void LineEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("text_changed", PropertyInfo(Variant::STRING, "new_text"))); ADD_SIGNAL(MethodInfo("text_change_rejected")); - ADD_SIGNAL(MethodInfo("text_entered", PropertyInfo(Variant::STRING, "new_text"))); + ADD_SIGNAL(MethodInfo("text_submitted", PropertyInfo(Variant::STRING, "new_text"))); BIND_ENUM_CONSTANT(ALIGN_LEFT); BIND_ENUM_CONSTANT(ALIGN_CENTER); diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index adc1ed67ca..4ea1e1eb9f 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -265,7 +265,7 @@ void Range::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "set_step", "get_step"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "page"), "set_page", "get_page"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "value"), "set_value", "get_value"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ratio", PROPERTY_HINT_RANGE, "0,1,0.01", 0), "set_as_ratio", "get_as_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ratio", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_NONE), "set_as_ratio", "get_as_ratio"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "exp_edit"), "set_exp_ratio", "is_ratio_exp"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rounded"), "set_use_rounded_values", "is_using_rounded_values"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_greater"), "set_allow_greater", "is_greater_allowed"); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index a2c3b4ed8a..987d05bf71 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -3452,7 +3452,30 @@ void RichTextLabel::set_selection_enabled(bool p_enabled) { } } -bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p_string, Item *p_from, Item *p_to) { +bool RichTextLabel::_search_table(ItemTable *p_table, List<Item *>::Element *p_from, const String &p_string, bool p_reverse_search) { + List<Item *>::Element *E = p_from; + while (E != nullptr) { + ERR_CONTINUE(E->get()->type != ITEM_FRAME); // Children should all be frames. + ItemFrame *frame = static_cast<ItemFrame *>(E->get()); + if (p_reverse_search) { + for (int i = frame->lines.size() - 1; i >= 0; i--) { + if (_search_line(frame, i, p_string, -1, p_reverse_search)) { + return true; + } + } + } else { + for (int i = 0; i < frame->lines.size(); i++) { + if (_search_line(frame, i, p_string, 0, p_reverse_search)) { + return true; + } + } + } + E = p_reverse_search ? E->prev() : E->next(); + } + return false; +} + +bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search) { ERR_FAIL_COND_V(p_frame == nullptr, false); ERR_FAIL_COND_V(p_line < 0 || p_line >= p_frame->lines.size(), false); @@ -3474,24 +3497,23 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p } break; case ITEM_TABLE: { ItemTable *table = static_cast<ItemTable *>(it); - int idx = 0; - for (List<Item *>::Element *E = table->subitems.front(); E; E = E->next()) { - ERR_CONTINUE(E->get()->type != ITEM_FRAME); // Children should all be frames. - ItemFrame *frame = static_cast<ItemFrame *>(E->get()); - - for (int i = 0; i < frame->lines.size(); i++) { - if (_search_line(frame, i, p_string, p_from, p_to)) { - return true; - } - } - idx++; + List<Item *>::Element *E = p_reverse_search ? table->subitems.back() : table->subitems.front(); + if (_search_table(table, E, p_string, p_reverse_search)) { + return true; } } break; default: break; } } - int sp = text.findn(p_string, 0); + + int sp = -1; + if (p_reverse_search) { + sp = text.rfindn(p_string, p_char_idx); + } else { + sp = text.findn(p_string, p_char_idx); + } + if (sp != -1) { selection.from_frame = p_frame; selection.from_line = p_line; @@ -3499,8 +3521,8 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p selection.from_char = sp; selection.to_frame = p_frame; selection.to_line = p_line; - selection.to_item = _get_item_at_pos(l.from, it_to, sp + p_string.length() - 1); - selection.to_char = sp + p_string.length() - 1; + selection.to_item = _get_item_at_pos(l.from, it_to, sp + p_string.length()); + selection.to_char = sp + p_string.length(); selection.active = true; return true; } @@ -3511,23 +3533,81 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p_search_previous) { ERR_FAIL_COND_V(!selection.enabled, false); + if (p_string.size() == 0) { + selection.active = false; + return false; + } + + int char_idx = p_search_previous ? -1 : 0; + int current_line = 0; + int ending_line = main->lines.size() - 1; if (p_from_selection && selection.active) { - for (int i = 0; i < main->lines.size(); i++) { - if (_search_line(main, i, p_string, selection.from_item, selection.to_item)) { - update(); - return true; - } + // First check to see if other results exist in current line + char_idx = p_search_previous ? selection.from_char - 1 : selection.to_char; + if (!(p_search_previous && char_idx < 0) && + _search_line(selection.from_frame, selection.from_line, p_string, char_idx, p_search_previous)) { + scroll_to_line(selection.from_frame->line + selection.from_line); + update(); + return true; } - } else { - for (int i = 0; i < main->lines.size(); i++) { - if (_search_line(main, i, p_string, nullptr, nullptr)) { - update(); - return true; + char_idx = p_search_previous ? -1 : 0; + + // Next, check to see if the current search result is in a table + if (selection.from_frame->parent != nullptr && selection.from_frame->parent->type == ITEM_TABLE) { + // Find last search result in table + ItemTable *parent_table = static_cast<ItemTable *>(selection.from_frame->parent); + List<Item *>::Element *parent_element = p_search_previous ? parent_table->subitems.back() : parent_table->subitems.front(); + + while (parent_element->get() != selection.from_frame) { + parent_element = p_search_previous ? parent_element->prev() : parent_element->next(); + ERR_FAIL_COND_V(parent_element == nullptr, false); + } + + // Search remainder of table + if (!(p_search_previous && parent_element == parent_table->subitems.front()) && + parent_element != parent_table->subitems.back()) { + parent_element = p_search_previous ? parent_element->prev() : parent_element->next(); // Don't want to search current item + ERR_FAIL_COND_V(parent_element == nullptr, false); + + // Search for next element + if (_search_table(parent_table, parent_element, p_string, p_search_previous)) { + scroll_to_line(selection.from_frame->line + selection.from_line); + update(); + return true; + } } } + + ending_line = selection.from_frame->line + selection.from_line; + current_line = p_search_previous ? ending_line - 1 : ending_line + 1; + } else if (p_search_previous) { + current_line = ending_line; + ending_line = 0; } - return false; + // Search remainder of the file + while (current_line != ending_line) { + // Wrap around + if (current_line < 0) { + current_line = main->lines.size() - 1; + } else if (current_line >= main->lines.size()) { + current_line = 0; + } + + if (_search_line(main, current_line, p_string, char_idx, p_search_previous)) { + scroll_to_line(current_line); + update(); + return true; + } + p_search_previous ? current_line-- : current_line++; + } + + if (p_from_selection && selection.active) { + // Check contents of selection + return _search_line(main, current_line, p_string, char_idx, p_search_previous); + } else { + return false; + } } String RichTextLabel::_get_line_text(ItemFrame *p_frame, int p_line, Selection p_selection) const { diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index e3e457d1f2..9cf94b0cd7 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -392,7 +392,8 @@ private: void _find_click(ItemFrame *p_frame, const Point2i &p_click, ItemFrame **r_click_frame = nullptr, int *r_click_line = nullptr, Item **r_click_item = nullptr, int *r_click_char = nullptr, bool *r_outside = nullptr); String _get_line_text(ItemFrame *p_frame, int p_line, Selection p_sel) const; - bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, Item *p_from, Item *p_to); + bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search); + bool _search_table(ItemTable *p_table, List<Item *>::Element *p_from, const String &p_string, bool p_reverse_search); void _shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, int *r_char_offset); void _resize_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width); diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 9dc2afdb2d..4ac73ae6b5 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -50,7 +50,7 @@ void SpinBox::_value_changed(double) { line_edit->set_text(value); } -void SpinBox::_text_entered(const String &p_string) { +void SpinBox::_text_submitted(const String &p_string) { Ref<Expression> expr; expr.instance(); @@ -172,7 +172,7 @@ void SpinBox::_line_edit_focus_exit() { return; } - _text_entered(line_edit->get_text()); + _text_submitted(line_edit->get_text()); } inline void SpinBox::_adjust_width_for_icon(const Ref<Texture2D> &icon) { @@ -251,7 +251,7 @@ bool SpinBox::is_editable() const { } void SpinBox::apply() { - _text_entered(line_edit->get_text()); + _text_submitted(line_edit->get_text()); } void SpinBox::_bind_methods() { @@ -283,7 +283,7 @@ SpinBox::SpinBox() { line_edit->set_align(LineEdit::ALIGN_LEFT); //connect("value_changed",this,"_value_changed"); - line_edit->connect("text_entered", callable_mp(this, &SpinBox::_text_entered), Vector<Variant>(), CONNECT_DEFERRED); + line_edit->connect("text_submitted", callable_mp(this, &SpinBox::_text_submitted), Vector<Variant>(), CONNECT_DEFERRED); line_edit->connect("focus_exited", callable_mp(this, &SpinBox::_line_edit_focus_exit), Vector<Variant>(), CONNECT_DEFERRED); line_edit->connect("gui_input", callable_mp(this, &SpinBox::_line_edit_input)); diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index e116adb64c..fb10379296 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -45,7 +45,7 @@ class SpinBox : public Range { void _range_click_timeout(); void _release_mouse(); - void _text_entered(const String &p_string); + void _text_submitted(const String &p_string); virtual void _value_changed(double) override; String prefix; String suffix; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 07ccad70b1..6f78d586f1 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -137,8 +137,11 @@ void TextEdit::Text::set_draw_control_chars(bool p_draw_control_chars) { draw_control_chars = p_draw_control_chars; } -int TextEdit::Text::get_line_width(int p_line) const { +int TextEdit::Text::get_line_width(int p_line, int p_wrap_index) const { ERR_FAIL_INDEX_V(p_line, text.size(), 0); + if (p_wrap_index != -1) { + return text[p_line].data_buf->get_line_width(p_wrap_index); + } return text[p_line].data_buf->get_size().x; } @@ -1354,7 +1357,8 @@ void TextEdit::_notification(int p_what) { } } - if (line_wrap_index == line_wrap_amount && is_folded(line)) { + // is_line_folded + if (line_wrap_index == line_wrap_amount && line < text.size() - 1 && is_line_hidden(line + 1)) { int xofs = char_ofs + char_margin + ofs_x + (cache.folded_eol_icon->get_width() / 2); if (xofs >= xmargin_beg && xofs < xmargin_end) { int yofs = (text_height - cache.folded_eol_icon->get_height()) / 2 - ldata->get_line_ascent(line_wrap_index); @@ -1943,10 +1947,6 @@ void TextEdit::_new_line(bool p_split_current_line, bool p_above) { } } - if (is_folded(cursor.line)) { - unfold_line(cursor.line); - } - bool brace_indent = false; // No need to indent if we are going upwards. @@ -2361,10 +2361,6 @@ void TextEdit::_backspace(bool p_word, bool p_all_to_left) { cursor_set_line(line, false); cursor_set_column(column); } else { - // One character. - if (cursor.line > 0 && is_line_hidden(cursor.line - 1)) { - unfold_line(cursor.line - 1); - } backspace_at_cursor(); } } @@ -2692,15 +2688,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { left_margin += gutters[i].width; } - // Unfold on folded icon click. - if (is_folded(row)) { - left_margin += gutter_padding + text.get_line_width(row) - cursor.x_ofs; - if (mpos.x > left_margin && mpos.x <= left_margin + cache.folded_eol_icon->get_width() + 3) { - unfold_line(row); - return; - } - } - // minimap if (draw_minimap) { _update_minimap_click(); @@ -3703,10 +3690,6 @@ void TextEdit::center_viewport_to_cursor() { scrolling = false; minimap_clicked = false; - if (is_line_hidden(cursor.line)) { - unfold_line(cursor.line); - } - set_line_as_center_visible(cursor.line, get_cursor_wrap_index()); int visible_width = get_size().width - cache.style_normal->get_minimum_size().width - gutters_width - gutter_padding - cache.minimap_width; if (v_scroll->is_visible_in_tree()) { @@ -4124,15 +4107,6 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { if (draw_minimap && p_pos.x > xmargin_end - minimap_width && p_pos.x <= xmargin_end) { return CURSOR_ARROW; } - - // EOL fold icon. - if (is_folded(row)) { - gutter += gutter_padding + text.get_line_width(row) - cursor.x_ofs; - if (p_pos.x > gutter - 3 && p_pos.x <= gutter + cache.folded_eol_icon->get_width() + 3) { - return CURSOR_POINTING_HAND; - } - } - return get_default_cursor_shape(); } @@ -4318,6 +4292,10 @@ String TextEdit::get_line(int line) const { return text[line]; }; +bool TextEdit::has_ime_text() const { + return !ime_text.is_empty(); +} + void TextEdit::_clear() { clear_undo_history(); text.clear(); @@ -4404,7 +4382,7 @@ void TextEdit::_update_caches() { cache.selection_color = get_theme_color("selection_color"); cache.current_line_color = get_theme_color("current_line_color"); cache.line_length_guideline_color = get_theme_color("line_length_guideline_color"); - cache.code_folding_color = get_theme_color("code_folding_color"); + cache.code_folding_color = get_theme_color("code_folding_color", "CodeEdit"); cache.brace_mismatch_color = get_theme_color("brace_mismatch_color"); cache.word_highlighted_color = get_theme_color("word_highlighted_color"); cache.search_result_color = get_theme_color("search_result_color"); @@ -4417,7 +4395,7 @@ void TextEdit::_update_caches() { #endif cache.tab_icon = get_theme_icon("tab"); cache.space_icon = get_theme_icon("space"); - cache.folded_eol_icon = get_theme_icon("GuiEllipsis", "EditorIcons"); + cache.folded_eol_icon = get_theme_icon("folded_eol_icon", "CodeEdit"); TextServer::Direction dir; if (text_direction == Control::TEXT_DIRECTION_INHERITED) { @@ -4526,6 +4504,10 @@ int TextEdit::get_gutter_width(int p_gutter) const { return gutters[p_gutter].width; } +int TextEdit::get_total_gutter_width() const { + return gutters_width + gutter_padding; +} + void TextEdit::set_gutter_draw(int p_gutter, bool p_draw) { ERR_FAIL_INDEX(p_gutter, gutters.size()); gutters.write[p_gutter].draw = p_draw; @@ -5107,14 +5089,6 @@ bool TextEdit::is_line_hidden(int p_line) const { return text.is_hidden(p_line); } -void TextEdit::fold_all_lines() { - for (int i = 0; i < text.size(); i++) { - fold_line(i); - } - _update_scrollbars(); - update(); -} - void TextEdit::unhide_all_lines() { for (int i = 0; i < text.size(); i++) { text.set_hidden(i, false); @@ -5262,151 +5236,14 @@ bool TextEdit::is_line_comment(int p_line) const { return false; } -bool TextEdit::can_fold(int p_line) const { - ERR_FAIL_INDEX_V(p_line, text.size(), false); - if (!is_hiding_enabled()) { - return false; - } - if (p_line + 1 >= text.size()) { - return false; - } - if (text[p_line].strip_edges().size() == 0) { - return false; - } - if (is_folded(p_line)) { - return false; - } - if (is_line_hidden(p_line)) { - return false; - } - if (is_line_comment(p_line)) { - return false; - } - - int start_indent = get_indent_level(p_line); - - for (int i = p_line + 1; i < text.size(); i++) { - if (text[i].strip_edges().size() == 0) { - continue; - } - int next_indent = get_indent_level(i); - if (is_line_comment(i)) { - continue; - } else if (next_indent > start_indent) { - return true; - } else { - return false; - } - } - - return false; -} - -bool TextEdit::is_folded(int p_line) const { - ERR_FAIL_INDEX_V(p_line, text.size(), false); - if (p_line + 1 >= text.size()) { - return false; - } - return !is_line_hidden(p_line) && is_line_hidden(p_line + 1); -} - -Vector<int> TextEdit::get_folded_lines() const { - Vector<int> folded_lines; - - for (int i = 0; i < text.size(); i++) { - if (is_folded(i)) { - folded_lines.push_back(i); - } - } - return folded_lines; -} - -void TextEdit::fold_line(int p_line) { - ERR_FAIL_INDEX(p_line, text.size()); - if (!is_hiding_enabled()) { - return; - } - if (!can_fold(p_line)) { - return; - } - - // Hide lines below this one. - int start_indent = get_indent_level(p_line); - int last_line = start_indent; - for (int i = p_line + 1; i < text.size(); i++) { - if (text[i].strip_edges().size() != 0) { - if (is_line_comment(i)) { - continue; - } else if (get_indent_level(i) > start_indent) { - last_line = i; - } else { - break; - } - } - } - for (int i = p_line + 1; i <= last_line; i++) { - set_line_as_hidden(i, true); - } - - // Fix selection. - if (is_selection_active()) { - if (is_line_hidden(selection.from_line) && is_line_hidden(selection.to_line)) { - deselect(); - } else if (is_line_hidden(selection.from_line)) { - select(p_line, 9999, selection.to_line, selection.to_column); - } else if (is_line_hidden(selection.to_line)) { - select(selection.from_line, selection.from_column, p_line, 9999); - } - } - - // Reset cursor. - if (is_line_hidden(cursor.line)) { - cursor_set_line(p_line, false, false); - cursor_set_column(get_line(p_line).length(), false); - } - _update_scrollbars(); - update(); -} - -void TextEdit::unfold_line(int p_line) { - ERR_FAIL_INDEX(p_line, text.size()); - - if (!is_folded(p_line) && !is_line_hidden(p_line)) { - return; - } - int fold_start; - for (fold_start = p_line; fold_start > 0; fold_start--) { - if (is_folded(fold_start)) { - break; - } - } - fold_start = is_folded(fold_start) ? fold_start : p_line; - - for (int i = fold_start + 1; i < text.size(); i++) { - if (is_line_hidden(i)) { - set_line_as_hidden(i, false); - } else { - break; - } - } - _update_scrollbars(); - update(); -} - -void TextEdit::toggle_fold_line(int p_line) { - ERR_FAIL_INDEX(p_line, text.size()); - - if (!is_folded(p_line)) { - fold_line(p_line); - } else { - unfold_line(p_line); - } -} - int TextEdit::get_line_count() const { return text.size(); } +int TextEdit::get_line_width(int p_line, int p_wrap_offset) const { + return text.get_line_width(p_line, p_wrap_offset); +} + void TextEdit::_do_text_op(const TextOperation &p_op, bool p_reverse) { ERR_FAIL_COND(p_op.type == TextOperation::TYPE_NONE); @@ -6270,18 +6107,6 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_draw_spaces"), &TextEdit::set_draw_spaces); ClassDB::bind_method(D_METHOD("is_drawing_spaces"), &TextEdit::is_drawing_spaces); - ClassDB::bind_method(D_METHOD("set_hiding_enabled", "enable"), &TextEdit::set_hiding_enabled); - ClassDB::bind_method(D_METHOD("is_hiding_enabled"), &TextEdit::is_hiding_enabled); - ClassDB::bind_method(D_METHOD("set_line_as_hidden", "line", "enable"), &TextEdit::set_line_as_hidden); - ClassDB::bind_method(D_METHOD("is_line_hidden", "line"), &TextEdit::is_line_hidden); - ClassDB::bind_method(D_METHOD("fold_all_lines"), &TextEdit::fold_all_lines); - ClassDB::bind_method(D_METHOD("unhide_all_lines"), &TextEdit::unhide_all_lines); - ClassDB::bind_method(D_METHOD("fold_line", "line"), &TextEdit::fold_line); - ClassDB::bind_method(D_METHOD("unfold_line", "line"), &TextEdit::unfold_line); - ClassDB::bind_method(D_METHOD("toggle_fold_line", "line"), &TextEdit::toggle_fold_line); - ClassDB::bind_method(D_METHOD("can_fold", "line"), &TextEdit::can_fold); - ClassDB::bind_method(D_METHOD("is_folded", "line"), &TextEdit::is_folded); - ClassDB::bind_method(D_METHOD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); ClassDB::bind_method(D_METHOD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); @@ -6365,7 +6190,6 @@ void TextEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_scrolling"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hiding_enabled"), "set_hiding_enabled", "is_hiding_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_enabled"), "set_wrap_enabled", "is_wrap_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_vertical"), "set_v_scroll", "get_v_scroll"); ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_horizontal"), "set_h_scroll", "get_h_scroll"); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index f963e664d1..c04d758abb 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -124,7 +124,7 @@ private: void set_draw_control_chars(bool p_draw_control_chars); int get_line_height(int p_line, int p_wrap_index) const; - int get_line_width(int p_line) const; + int get_line_width(int p_line, int p_wrap_index = -1) const; int get_max_width(bool p_exclude_hidden = false) const; void set_width(float p_width); @@ -349,11 +349,8 @@ private: void update_cursor_wrap_offset(); void _update_wrap_at(bool p_force = false); - bool line_wraps(int line) const; - int times_line_wraps(int line) const; Vector<String> get_wrap_rows_text(int p_line) const; int get_cursor_wrap_index() const; - int get_line_wrap_index_at_col(int p_line, int p_column) const; int get_char_count(); double get_scroll_pos_for_line(int p_line, int p_wrap_index = 0) const; @@ -514,6 +511,7 @@ public: void set_gutter_width(int p_gutter, int p_width); int get_gutter_width(int p_gutter) const; + int get_total_gutter_width() const; void set_gutter_draw(int p_gutter, bool p_draw); bool is_gutter_drawn(int p_gutter) const; @@ -622,24 +620,19 @@ public: void insert_text_at_cursor(const String &p_text); void insert_at(const String &p_text, int at); int get_line_count() const; + int get_line_width(int p_line, int p_wrap_offset = -1) const; + int get_line_wrap_index_at_col(int p_line, int p_column) const; void set_line_as_hidden(int p_line, bool p_hidden); bool is_line_hidden(int p_line) const; - void fold_all_lines(); void unhide_all_lines(); int num_lines_from(int p_line_from, int visible_amount) const; int num_lines_from_rows(int p_line_from, int p_wrap_index_from, int visible_amount, int &wrap_index) const; int get_last_unhidden_line() const; - bool can_fold(int p_line) const; - bool is_folded(int p_line) const; - Vector<int> get_folded_lines() const; - void fold_line(int p_line); - void unfold_line(int p_line); - void toggle_fold_line(int p_line); - String get_text(); String get_line(int line) const; + bool has_ime_text() const; void set_line(int line, String new_text); int get_row_height() const; void backspace_at_cursor(); @@ -701,6 +694,8 @@ public: void set_wrap_enabled(bool p_wrap_enabled); bool is_wrap_enabled() const; + bool line_wraps(int line) const; + int times_line_wraps(int line) const; void clear(); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f66cc13af5..26d881955b 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2451,10 +2451,10 @@ void Tree::_text_editor_modal_close() { return; } - _text_editor_enter(text_editor->get_text()); + _text_editor_submit(text_editor->get_text()); } -void Tree::_text_editor_enter(String p_text) { +void Tree::_text_editor_submit(String p_text) { popup_editor->hide(); if (!popup_edited_item) { @@ -4554,7 +4554,7 @@ Tree::Tree() { h_scroll->connect("value_changed", callable_mp(this, &Tree::_scroll_moved)); v_scroll->connect("value_changed", callable_mp(this, &Tree::_scroll_moved)); - text_editor->connect("text_entered", callable_mp(this, &Tree::_text_editor_enter)); + text_editor->connect("text_submitted", callable_mp(this, &Tree::_text_editor_submit)); popup_editor->connect("popup_hide", callable_mp(this, &Tree::_text_editor_modal_close)); popup_menu->connect("id_pressed", callable_mp(this, &Tree::popup_select)); value_editor->connect("value_changed", callable_mp(this, &Tree::value_editor_changed)); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 5176d01497..0571a605a5 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -449,7 +449,7 @@ private: int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item); void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = nullptr, bool *r_in_range = nullptr, bool p_force_deselect = false); int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_double_click, TreeItem *p_item, int p_button, const Ref<InputEventWithModifiers> &p_mod); - void _text_editor_enter(String p_text); + void _text_editor_submit(String p_text); void _text_editor_modal_close(); void value_editor_changed(double p_value); diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 0590ae2415..ed3c0b7a56 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -452,12 +452,12 @@ void VideoPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "VideoStream"), "set_stream", "get_stream"); //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), "set_loop", "has_loop") ; ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume", PROPERTY_HINT_EXP_RANGE, "0,15,0.01", 0), "set_volume", "get_volume"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume", PROPERTY_HINT_EXP_RANGE, "0,15,0.01", PROPERTY_USAGE_NONE), "set_volume", "get_volume"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "has_autoplay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused"), "set_paused", "is_paused"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand"), "set_expand", "has_expand"); ADD_PROPERTY(PropertyInfo(Variant::INT, "buffering_msec", PROPERTY_HINT_RANGE, "10,1000"), "set_buffering_msec", "get_buffering_msec"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stream_position", PROPERTY_HINT_RANGE, "0,1280000,0.1", 0), "set_stream_position", "get_stream_position"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stream_position", PROPERTY_HINT_RANGE, "0,1280000,0.1", PROPERTY_USAGE_NONE), "set_stream_position", "get_stream_position"); ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); } diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 181fe606c8..361f584a5d 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -876,6 +876,17 @@ void CanvasItem::draw_set_transform_matrix(const Transform2D &p_matrix) { RenderingServer::get_singleton()->canvas_item_add_set_transform(canvas_item, p_matrix); } +void CanvasItem::draw_animation_slice(double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset) { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + + RenderingServer::get_singleton()->canvas_item_add_animation_slice(canvas_item, p_animation_length, p_slice_begin, p_slice_end, p_offset); +} + +void CanvasItem::draw_end_animation() { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + + RenderingServer::get_singleton()->canvas_item_add_animation_slice(canvas_item, 1, 0, 2, 0); +} void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture) { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -1159,6 +1170,8 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_multimesh", "multimesh", "texture"), &CanvasItem::draw_multimesh); ClassDB::bind_method(D_METHOD("draw_set_transform", "position", "rotation", "scale"), &CanvasItem::draw_set_transform, DEFVAL(0.0), DEFVAL(Size2(1.0, 1.0))); ClassDB::bind_method(D_METHOD("draw_set_transform_matrix", "xform"), &CanvasItem::draw_set_transform_matrix); + ClassDB::bind_method(D_METHOD("draw_animation_slice", "animation_length", "slice_begin", "slice_end", "offset"), &CanvasItem::draw_animation_slice, DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_end_animation"), &CanvasItem::draw_end_animation); ClassDB::bind_method(D_METHOD("get_transform"), &CanvasItem::get_transform); ClassDB::bind_method(D_METHOD("get_global_transform"), &CanvasItem::get_global_transform); ClassDB::bind_method(D_METHOD("get_global_transform_with_canvas"), &CanvasItem::get_global_transform_with_canvas); @@ -1205,7 +1218,7 @@ void CanvasItem::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "self_modulate"), "set_self_modulate", "get_self_modulate"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_behind_parent"), "set_draw_behind_parent", "is_draw_behind_parent_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "top_level"), "set_as_top_level", "is_set_as_top_level"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_on_top", PROPERTY_HINT_NONE, "", 0), "_set_on_top", "_is_on_top"); //compatibility + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_on_top", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_on_top", "_is_on_top"); //compatibility ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_children"), "set_clip_children", "is_clipping_children"); ADD_PROPERTY(PropertyInfo(Variant::INT, "light_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_light_mask", "get_light_mask"); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 1c64cafab8..afdd18d76b 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -356,6 +356,8 @@ public: void draw_set_transform(const Point2 &p_offset, real_t p_rot = 0.0, const Size2 &p_scale = Size2(1.0, 1.0)); void draw_set_transform_matrix(const Transform2D &p_matrix); + void draw_animation_slice(double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset = 0); + void draw_end_animation(); static CanvasItem *get_current_item_drawn(); diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 85d7edd64b..f699e68715 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -303,7 +303,7 @@ void CanvasLayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform"); ADD_GROUP("", ""); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", PROPERTY_USAGE_NONE), "set_custom_viewport", "get_custom_viewport"); ADD_GROUP("Follow Viewport", "follow_viewport"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "follow_viewport_enable"), "set_follow_viewport", "is_following_viewport"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_lesser"), "set_follow_viewport_scale", "get_follow_viewport_scale"); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 622c271935..e1abea81ef 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2658,11 +2658,11 @@ void Node::_bind_methods() { ADD_SIGNAL(MethodInfo("tree_exiting")); ADD_SIGNAL(MethodInfo("tree_exited")); - ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", 0), "set_filename", "get_filename"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_name", "get_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_filename", "get_filename"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_owner", "get_owner"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", PROPERTY_USAGE_NONE), "", "get_multiplayer"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", PROPERTY_USAGE_NONE), "set_custom_multiplayer", "get_custom_multiplayer"); ADD_GROUP("Process", "process_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Inherit,Pausable,When Paused,Always,Disabled"), "set_process_mode", "get_process_mode"); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index e4ba93feec..001c857d4c 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -413,7 +413,6 @@ bool SceneTree::physics_process(float p_time) { _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack flush_transform_notifications(); - call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds"); root_lock--; _flush_delete_queue(); @@ -445,7 +444,6 @@ bool SceneTree::process(float p_time) { _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack flush_transform_notifications(); //transforms after world update, to avoid unnecessary enter/exit notifications - call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds"); root_lock--; @@ -1259,11 +1257,11 @@ void SceneTree::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused"), "set_pause", "is_paused"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "refuse_new_network_connections"), "set_refuse_new_network_connections", "is_refusing_new_network_connections"); ADD_PROPERTY_DEFAULT("refuse_new_network_connections", false); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_edited_scene_root", "get_edited_scene_root"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "current_scene", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_current_scene", "get_current_scene"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", 0), "set_network_peer", "get_network_peer"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "", "get_root"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_multiplayer", "get_multiplayer"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_edited_scene_root", "get_edited_scene_root"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "current_scene", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_current_scene", "get_current_scene"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", PROPERTY_USAGE_NONE), "set_network_peer", "get_network_peer"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "", "get_root"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", PROPERTY_USAGE_NONE), "set_multiplayer", "get_multiplayer"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "multiplayer_poll"), "set_multiplayer_poll_enabled", "is_multiplayer_poll_enabled"); ADD_SIGNAL(MethodInfo("tree_changed")); diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 4bc159f6aa..a5ceec9c8b 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -210,8 +210,8 @@ void Timer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused", PROPERTY_HINT_NONE, "", 0), "set_paused", "is_paused"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left", PROPERTY_HINT_NONE, "", 0), "", "get_time_left"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_paused", "is_paused"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_time_left"); BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 425fbf0d6a..84a6dbe889 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -183,14 +183,6 @@ public: ///////////////////////////////////// -void Viewport::update_worlds() { - if (!is_inside_tree()) { - return; - } - - find_world_3d()->_update(get_tree()->get_frame()); -} - void Viewport::_collision_object_input_event(CollisionObject3D *p_object, Camera3D *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) { Transform3D object_transform = p_object->get_global_transform(); Transform3D camera_transform = p_camera->get_global_transform(); @@ -3513,8 +3505,6 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("input", "event", "in_local_coords"), &Viewport::input, DEFVAL(false)); ClassDB::bind_method(D_METHOD("unhandled_input", "event", "in_local_coords"), &Viewport::unhandled_input, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("update_worlds"), &Viewport::update_worlds); - ClassDB::bind_method(D_METHOD("set_use_own_world_3d", "enable"), &Viewport::set_use_own_world_3d); ClassDB::bind_method(D_METHOD("is_using_own_world_3d"), &Viewport::is_using_own_world_3d); @@ -3586,7 +3576,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_xr"), "set_use_xr", "is_using_xr"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "own_world_3d"), "set_use_own_world_3d", "is_using_own_world_3d"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world_3d", PROPERTY_HINT_RESOURCE_TYPE, "World3D"), "set_world_3d", "get_world_3d"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world_2d", PROPERTY_HINT_RESOURCE_TYPE, "World2D", 0), "set_world_2d", "get_world_2d"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world_2d", PROPERTY_HINT_RESOURCE_TYPE, "World2D", PROPERTY_USAGE_NONE), "set_world_2d", "get_world_2d"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transparent_bg"), "set_transparent_background", "has_transparent_background"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "handle_input_locally"), "set_handle_input_locally", "is_handling_input_locally"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "snap_2d_transforms_to_pixel"), "set_snap_2d_transforms_to_pixel", "is_snap_2d_transforms_to_pixel_enabled"); @@ -3620,8 +3610,8 @@ void Viewport::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::INT, "shadow_atlas_quad_1", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv", 1); ADD_PROPERTYI(PropertyInfo(Variant::INT, "shadow_atlas_quad_2", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv", 2); ADD_PROPERTYI(PropertyInfo(Variant::INT, "shadow_atlas_quad_3", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv", 3); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "canvas_transform", PROPERTY_HINT_NONE, "", 0), "set_canvas_transform", "get_canvas_transform"); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_canvas_transform", PROPERTY_HINT_NONE, "", 0), "set_global_canvas_transform", "get_global_canvas_transform"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "canvas_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_canvas_transform", "get_canvas_transform"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_canvas_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_canvas_transform", "get_global_canvas_transform"); ADD_SIGNAL(MethodInfo("size_changed")); ADD_SIGNAL(MethodInfo("gui_focus_changed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 2d7f5101c2..d905e44a82 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -397,8 +397,6 @@ private: void _gui_input_event(Ref<InputEvent> p_event); - void update_worlds(); - _FORCE_INLINE_ Transform2D _get_input_pre_xform() const; Ref<InputEvent> _make_input_local(const Ref<InputEvent> &ev); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 332976a18d..2a97ae3acf 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -65,7 +65,7 @@ #include "scene/2d/sprite_2d.h" #include "scene/2d/tile_map.h" #include "scene/2d/touch_screen_button.h" -#include "scene/2d/visibility_notifier_2d.h" +#include "scene/2d/visible_on_screen_notifier_2d.h" #include "scene/animation/animation_blend_space_1d.h" #include "scene/animation/animation_blend_space_2d.h" #include "scene/animation/animation_blend_tree.h" @@ -229,7 +229,7 @@ #include "scene/3d/spring_arm_3d.h" #include "scene/3d/sprite_3d.h" #include "scene/3d/vehicle_body_3d.h" -#include "scene/3d/visibility_notifier_3d.h" +#include "scene/3d/visible_on_screen_notifier_3d.h" #include "scene/3d/voxel_gi.h" #include "scene/3d/world_environment.h" #include "scene/3d/xr_nodes.h" @@ -513,8 +513,8 @@ void register_scene_types() { ClassDB::register_class<Curve3D>(); ClassDB::register_class<Path3D>(); ClassDB::register_class<PathFollow3D>(); - ClassDB::register_class<VisibilityNotifier3D>(); - ClassDB::register_class<VisibilityEnabler3D>(); + ClassDB::register_class<VisibleOnScreenNotifier3D>(); + ClassDB::register_class<VisibleOnScreenEnabler3D>(); ClassDB::register_class<WorldEnvironment>(); ClassDB::register_class<RemoteTransform3D>(); @@ -655,8 +655,8 @@ void register_scene_types() { ClassDB::register_class<CollisionShape2D>(); ClassDB::register_class<CollisionPolygon2D>(); ClassDB::register_class<RayCast2D>(); - ClassDB::register_class<VisibilityNotifier2D>(); - ClassDB::register_class<VisibilityEnabler2D>(); + ClassDB::register_class<VisibleOnScreenNotifier2D>(); + ClassDB::register_class<VisibleOnScreenEnabler2D>(); ClassDB::register_class<Polygon2D>(); ClassDB::register_class<Skeleton2D>(); ClassDB::register_class<Bone2D>(); @@ -966,8 +966,8 @@ void register_scene_types() { ClassDB::add_compatibility_class("VehicleWheel", "VehicleWheel3D"); ClassDB::add_compatibility_class("ViewportContainer", "SubViewportContainer"); ClassDB::add_compatibility_class("Viewport", "SubViewport"); - ClassDB::add_compatibility_class("VisibilityEnabler", "VisibilityEnabler3D"); - ClassDB::add_compatibility_class("VisibilityNotifier", "VisibilityNotifier3D"); + ClassDB::add_compatibility_class("VisibilityEnabler", "VisibleOnScreenEnabler3D"); + ClassDB::add_compatibility_class("VisibilityNotifier", "VisibleOnScreenNotifier3D"); ClassDB::add_compatibility_class("VisualServer", "RenderingServer"); ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant"); ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc"); @@ -986,6 +986,8 @@ void register_scene_types() { ClassDB::add_compatibility_class("World", "World3D"); ClassDB::add_compatibility_class("StreamTexture", "StreamTexture2D"); ClassDB::add_compatibility_class("Light2D", "PointLight2D"); + ClassDB::add_compatibility_class("VisibilityNotifier2D", "VisibleOnScreenNotifier2D"); + ClassDB::add_compatibility_class("VisibilityNotifier3D", "VisibleOnScreenNotifier3D"); #endif /* DISABLE_DEPRECATED */ diff --git a/scene/resources/box_shape_3d.cpp b/scene/resources/box_shape_3d.cpp index 6e7adc0bd7..008914c5ee 100644 --- a/scene/resources/box_shape_3d.cpp +++ b/scene/resources/box_shape_3d.cpp @@ -56,6 +56,26 @@ void BoxShape3D::_update_shape() { Shape3D::_update_shape(); } +#ifndef DISABLE_DEPRECATED +bool BoxShape3D::_set(const StringName &p_name, const Variant &p_value) { + if (p_name == "extents") { // Compatibility with Godot 3.x. + // Convert to `size`, twice as big. + set_size((Vector3)p_value * 2); + return true; + } + return false; +} + +bool BoxShape3D::_get(const StringName &p_name, Variant &r_property) const { + if (p_name == "extents") { // Compatibility with Godot 3.x. + // Convert to `extents`, half as big. + r_property = size / 2; + return true; + } + return false; +} +#endif // DISABLE_DEPRECATED + void BoxShape3D::set_size(const Vector3 &p_size) { size = p_size; _update_shape(); diff --git a/scene/resources/box_shape_3d.h b/scene/resources/box_shape_3d.h index fce05d61ed..91978a0e6a 100644 --- a/scene/resources/box_shape_3d.h +++ b/scene/resources/box_shape_3d.h @@ -39,6 +39,10 @@ class BoxShape3D : public Shape3D { protected: static void _bind_methods(); +#ifndef DISABLE_DEPRECATED + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_property) const; +#endif // DISABLE_DEPRECATED virtual void _update_shape() override; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index b91a5c0b7f..a4228d48b4 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -445,7 +445,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("font_readonly_color", "TextEdit", Color(control_font_color.r, control_font_color.g, control_font_color.b, 0.5f)); theme->set_color("font_outline_color", "TextEdit", Color(1, 1, 1)); theme->set_color("selection_color", "TextEdit", control_selection_color); - theme->set_color("code_folding_color", "TextEdit", Color(0.8, 0.8, 0.8, 0.8)); theme->set_color("current_line_color", "TextEdit", Color(0.25, 0.25, 0.26, 0.8)); theme->set_color("caret_color", "TextEdit", control_font_color); theme->set_color("caret_background_color", "TextEdit", Color(0, 0, 0)); @@ -469,6 +468,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("executing_line", "CodeEdit", make_icon(arrow_right_png)); theme->set_icon("can_fold", "CodeEdit", make_icon(arrow_down_png)); theme->set_icon("folded", "CodeEdit", make_icon(arrow_right_png)); + theme->set_icon("folded_eol_icon", "CodeEdit", make_icon(ellipsis_png)); theme->set_font("font", "CodeEdit", Ref<Font>()); theme->set_font_size("font_size", "CodeEdit", -1); @@ -487,8 +487,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("bookmark_color", "CodeEdit", Color(0.5, 0.64, 1, 0.8)); theme->set_color("breakpoint_color", "CodeEdit", Color(0.9, 0.29, 0.3)); theme->set_color("executing_line_color", "CodeEdit", Color(0.98, 0.89, 0.27)); - theme->set_color("code_folding_color", "CodeEdit", Color(0.8, 0.8, 0.8, 0.8)); theme->set_color("current_line_color", "CodeEdit", Color(0.25, 0.25, 0.26, 0.8)); + theme->set_color("code_folding_color", "CodeEdit", Color(0.8, 0.8, 0.8, 0.8)); theme->set_color("caret_color", "CodeEdit", control_font_color); theme->set_color("caret_background_color", "CodeEdit", Color(0, 0, 0)); theme->set_color("brace_mismatch_color", "CodeEdit", Color(1, 0.2, 0.2)); diff --git a/scene/resources/default_theme/ellipsis.png b/scene/resources/default_theme/ellipsis.png Binary files differnew file mode 100644 index 0000000000..c949e2c95b --- /dev/null +++ b/scene/resources/default_theme/ellipsis.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index 190f2a03d9..7d747e3c9e 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -74,6 +74,10 @@ static const unsigned char dropdown_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x4, 0x0, 0x0, 0x0, 0x6e, 0x6, 0x76, 0x0, 0x0, 0x0, 0x0, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0x63, 0x60, 0x60, 0xf8, 0xc0, 0xcc, 0x0, 0x2, 0x60, 0x16, 0x98, 0x78, 0x67, 0x8, 0x81, 0x6f, 0x4d, 0xde, 0x9a, 0x0, 0x5, 0xde, 0x3a, 0x3d, 0xfc, 0x8f, 0x80, 0xaf, 0xba, 0x18, 0xde, 0x29, 0x2, 0x19, 0xbf, 0x61, 0x2, 0x6f, 0x62, 0x18, 0x3e, 0xb0, 0xbd, 0x97, 0x4, 0x32, 0xff, 0x80, 0xb9, 0xb1, 0x20, 0x93, 0xc0, 0x42, 0x8, 0x2e, 0x54, 0xe8, 0x9d, 0xdc, 0x9b, 0x54, 0x10, 0xb, 0x21, 0xc4, 0x4, 0x63, 0x1, 0x0, 0x86, 0x1f, 0x3b, 0x1e, 0x92, 0x22, 0x3f, 0x40, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; +static const unsigned char ellipsis_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0x8, 0x8, 0x6, 0x0, 0x0, 0x0, 0xc9, 0x11, 0xce, 0xcc, 0x0, 0x0, 0x0, 0x4, 0x73, 0x42, 0x49, 0x54, 0x8, 0x8, 0x8, 0x8, 0x7c, 0x8, 0x64, 0x88, 0x0, 0x0, 0x0, 0x78, 0x49, 0x44, 0x41, 0x54, 0x18, 0x95, 0x95, 0xd1, 0x31, 0xa, 0xc2, 0x50, 0x10, 0x4, 0xd0, 0xb7, 0x1f, 0xf, 0x60, 0x67, 0xa, 0xf, 0x12, 0x6f, 0x60, 0xe9, 0x51, 0x5, 0x3d, 0x44, 0xee, 0x61, 0xa1, 0xa5, 0xf6, 0x81, 0xb5, 0xc8, 0x47, 0x82, 0x84, 0x4f, 0xb2, 0xdd, 0xb0, 0x33, 0xb3, 0xb3, 0x4c, 0x40, 0x66, 0xee, 0x71, 0xc2, 0x1, 0x3b, 0xcb, 0x33, 0xe2, 0x85, 0x21, 0x22, 0xde, 0x51, 0x45, 0x97, 0x86, 0x60, 0xc9, 0xe0, 0x5a, 0xea, 0xa5, 0xb5, 0x22, 0x95, 0xdb, 0x97, 0x1a, 0xf, 0x6e, 0xb8, 0xcf, 0x8, 0x2d, 0xdc, 0x95, 0xd9, 0x22, 0xfe, 0x9c, 0x9b, 0x38, 0x32, 0xf3, 0x8c, 0xe3, 0x86, 0xa8, 0xf0, 0x28, 0x18, 0x4c, 0xf, 0xaf, 0x9d, 0x11, 0x43, 0xf0, 0xab, 0xa3, 0x47, 0xa7, 0x5d, 0xc7, 0xd3, 0x54, 0xc7, 0xe7, 0xb, 0xb9, 0xce, 0x1f, 0xc6, 0x2d, 0x99, 0x55, 0xc7, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + static const unsigned char error_icon_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 0x0, 0x0, 0x0, 0xe, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x18, 0x5, 0xa3, 0x0, 0x1, 0x0, 0x2, 0x10, 0x0, 0x1, 0x14, 0xc2, 0xc0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index dea5c4e7d3..8894f0bb11 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -349,10 +349,10 @@ void MultiMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_custom_data_array"), &MultiMesh::_set_custom_data_array); ClassDB::bind_method(D_METHOD("_get_custom_data_array"), &MultiMesh::_get_custom_data_array); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "transform_array", PROPERTY_HINT_NONE, "", 0), "_set_transform_array", "_get_transform_array"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "transform_2d_array", PROPERTY_HINT_NONE, "", 0), "_set_transform_2d_array", "_get_transform_2d_array"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "color_array", PROPERTY_HINT_NONE, "", 0), "_set_color_array", "_get_color_array"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "custom_data_array", PROPERTY_HINT_NONE, "", 0), "_set_custom_data_array", "_get_custom_data_array"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "transform_array", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_transform_array", "_get_transform_array"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "transform_2d_array", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_transform_2d_array", "_get_transform_2d_array"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "color_array", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_color_array", "_get_color_array"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "custom_data_array", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_custom_data_array", "_get_custom_data_array"); #endif BIND_ENUM_CONSTANT(TRANSFORM_2D); diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index dc4c6dc2d7..17ce0b34ac 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -37,6 +37,26 @@ void RectangleShape2D::_update_shape() { emit_changed(); } +#ifndef DISABLE_DEPRECATED +bool RectangleShape2D::_set(const StringName &p_name, const Variant &p_value) { + if (p_name == "extents") { // Compatibility with Godot 3.x. + // Convert to `size`, twice as big. + set_size((Vector2)p_value * 2); + return true; + } + return false; +} + +bool RectangleShape2D::_get(const StringName &p_name, Variant &r_property) const { + if (p_name == "extents") { // Compatibility with Godot 3.x. + // Convert to `extents`, half as big. + r_property = size / 2; + return true; + } + return false; +} +#endif // DISABLE_DEPRECATED + void RectangleShape2D::set_size(const Vector2 &p_size) { size = p_size; _update_shape(); diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h index 8d747c86af..f1e8be4c5b 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/rectangle_shape_2d.h @@ -41,6 +41,10 @@ class RectangleShape2D : public Shape2D { protected: static void _bind_methods(); +#ifndef DISABLE_DEPRECATED + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_property) const; +#endif // DISABLE_DEPRECATED public: void set_size(const Vector2 &p_size); diff --git a/scene/resources/sprite_frames.cpp b/scene/resources/sprite_frames.cpp index 90c702081b..df80084c5c 100644 --- a/scene/resources/sprite_frames.cpp +++ b/scene/resources/sprite_frames.cpp @@ -228,7 +228,7 @@ void SpriteFrames::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_frames"), &SpriteFrames::_set_frames); ClassDB::bind_method(D_METHOD("_get_frames"), &SpriteFrames::_get_frames); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "frames", PROPERTY_HINT_NONE, "", 0), "_set_frames", "_get_frames"); //compatibility + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "frames", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "_set_frames", "_get_frames"); //compatibility ClassDB::bind_method(D_METHOD("_set_animations"), &SpriteFrames::_set_animations); ClassDB::bind_method(D_METHOD("_get_animations"), &SpriteFrames::_get_animations); diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 064563d4b5..aa85c7116b 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1904,7 +1904,7 @@ void AnimatedTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("get_frame_delay", "frame"), &AnimatedTexture::get_frame_delay); ADD_PROPERTY(PropertyInfo(Variant::INT, "frames", PROPERTY_HINT_RANGE, "1," + itos(MAX_FRAMES), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_frames", "get_frames"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "current_frame", PROPERTY_HINT_NONE, "", 0), "set_current_frame", "get_current_frame"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "current_frame", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_current_frame", "get_current_frame"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pause"), "set_pause", "get_pause"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "oneshot"), "set_oneshot", "get_oneshot"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fps", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_fps", "get_fps"); diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 9a7a47f884..eceb42ee14 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -32,7 +32,7 @@ #include "core/config/project_settings.h" #include "scene/2d/camera_2d.h" -#include "scene/2d/visibility_notifier_2d.h" +#include "scene/2d/visible_on_screen_notifier_2d.h" #include "scene/main/window.h" #include "servers/navigation_server_2d.h" #include "servers/physics_server_2d.h" @@ -57,10 +57,10 @@ void World2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World2D::get_direct_space_state); - ADD_PROPERTY(PropertyInfo(Variant::RID, "canvas", PROPERTY_HINT_NONE, "", 0), "", "get_canvas"); - ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); - ADD_PROPERTY(PropertyInfo(Variant::RID, "navigation_map", PROPERTY_HINT_NONE, "", 0), "", "get_navigation_map"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState2D", 0), "", "get_direct_space_state"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "canvas", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_canvas"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_space"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "navigation_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_navigation_map"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState2D", PROPERTY_USAGE_NONE), "", "get_direct_space_state"); } PhysicsDirectSpaceState2D *World2D::get_direct_space_state() { diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index e31ac22351..65f89c8f64 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -35,7 +35,7 @@ #include "core/io/resource.h" #include "servers/physics_server_2d.h" -class VisibilityNotifier2D; +class VisibleOnScreenNotifier2D; class Viewport; struct SpatialIndexer2D; diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index e811cbf57a..42047f104f 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -33,210 +33,19 @@ #include "core/math/camera_matrix.h" #include "core/math/octree.h" #include "scene/3d/camera_3d.h" -#include "scene/3d/visibility_notifier_3d.h" +#include "scene/3d/visible_on_screen_notifier_3d.h" #include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" -struct SpatialIndexer { - Octree<VisibilityNotifier3D> octree; - - struct NotifierData { - AABB aabb; - OctreeElementID id; - }; - - Map<VisibilityNotifier3D *, NotifierData> notifiers; - struct CameraData { - Map<VisibilityNotifier3D *, uint64_t> notifiers; - }; - - Map<Camera3D *, CameraData> cameras; - - enum { - VISIBILITY_CULL_MAX = 32768 - }; - - Vector<VisibilityNotifier3D *> cull; - - bool changed; - uint64_t pass; - uint64_t last_frame; - - void _notifier_add(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { - ERR_FAIL_COND(notifiers.has(p_notifier)); - notifiers[p_notifier].aabb = p_rect; - notifiers[p_notifier].id = octree.create(p_notifier, p_rect); - changed = true; - } - - void _notifier_update(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { - Map<VisibilityNotifier3D *, NotifierData>::Element *E = notifiers.find(p_notifier); - ERR_FAIL_COND(!E); - if (E->get().aabb == p_rect) { - return; - } - - E->get().aabb = p_rect; - octree.move(E->get().id, E->get().aabb); - changed = true; - } - - void _notifier_remove(VisibilityNotifier3D *p_notifier) { - Map<VisibilityNotifier3D *, NotifierData>::Element *E = notifiers.find(p_notifier); - ERR_FAIL_COND(!E); - - octree.erase(E->get().id); - notifiers.erase(p_notifier); - - List<Camera3D *> removed; - for (Map<Camera3D *, CameraData>::Element *F = cameras.front(); F; F = F->next()) { - Map<VisibilityNotifier3D *, uint64_t>::Element *G = F->get().notifiers.find(p_notifier); - - if (G) { - F->get().notifiers.erase(G); - removed.push_back(F->key()); - } - } - - while (!removed.is_empty()) { - p_notifier->_exit_camera(removed.front()->get()); - removed.pop_front(); - } - - changed = true; - } - - void _add_camera(Camera3D *p_camera) { - ERR_FAIL_COND(cameras.has(p_camera)); - CameraData vd; - cameras[p_camera] = vd; - changed = true; - } - - void _update_camera(Camera3D *p_camera) { - Map<Camera3D *, CameraData>::Element *E = cameras.find(p_camera); - ERR_FAIL_COND(!E); - changed = true; - } - - void _remove_camera(Camera3D *p_camera) { - ERR_FAIL_COND(!cameras.has(p_camera)); - List<VisibilityNotifier3D *> removed; - for (Map<VisibilityNotifier3D *, uint64_t>::Element *E = cameras[p_camera].notifiers.front(); E; E = E->next()) { - removed.push_back(E->key()); - } - - while (!removed.is_empty()) { - removed.front()->get()->_exit_camera(p_camera); - removed.pop_front(); - } - - cameras.erase(p_camera); - } - - void _update(uint64_t p_frame) { - if (p_frame == last_frame) { - return; - } - last_frame = p_frame; - - if (!changed) { - return; - } - - for (Map<Camera3D *, CameraData>::Element *E = cameras.front(); E; E = E->next()) { - pass++; - - Camera3D *c = E->key(); - - Vector<Plane> planes = c->get_frustum(); - - int culled = octree.cull_convex(planes, cull.ptrw(), cull.size()); - - VisibilityNotifier3D **ptr = cull.ptrw(); - - List<VisibilityNotifier3D *> added; - List<VisibilityNotifier3D *> removed; - - for (int i = 0; i < culled; i++) { - //notifiers in frustum - - Map<VisibilityNotifier3D *, uint64_t>::Element *H = E->get().notifiers.find(ptr[i]); - if (!H) { - E->get().notifiers.insert(ptr[i], pass); - added.push_back(ptr[i]); - } else { - H->get() = pass; - } - } - - for (Map<VisibilityNotifier3D *, uint64_t>::Element *F = E->get().notifiers.front(); F; F = F->next()) { - if (F->get() != pass) { - removed.push_back(F->key()); - } - } - - while (!added.is_empty()) { - added.front()->get()->_enter_camera(E->key()); - added.pop_front(); - } - - while (!removed.is_empty()) { - E->get().notifiers.erase(removed.front()->get()); - removed.front()->get()->_exit_camera(E->key()); - removed.pop_front(); - } - } - changed = false; - } - - SpatialIndexer() { - pass = 0; - last_frame = 0; - changed = false; - cull.resize(VISIBILITY_CULL_MAX); - } -}; - void World3D::_register_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED - indexer->_add_camera(p_camera); -#endif -} - -void World3D::_update_camera(Camera3D *p_camera) { -#ifndef _3D_DISABLED - indexer->_update_camera(p_camera); + cameras.insert(p_camera); #endif } void World3D::_remove_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED - indexer->_remove_camera(p_camera); -#endif -} - -void World3D::_register_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { -#ifndef _3D_DISABLED - indexer->_notifier_add(p_notifier, p_rect); -#endif -} - -void World3D::_update_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { -#ifndef _3D_DISABLED - indexer->_notifier_update(p_notifier, p_rect); -#endif -} - -void World3D::_remove_notifier(VisibilityNotifier3D *p_notifier) { -#ifndef _3D_DISABLED - indexer->_notifier_remove(p_notifier); -#endif -} - -void World3D::_update(uint64_t p_frame) { -#ifndef _3D_DISABLED - indexer->_update(p_frame); + cameras.erase(p_camera); #endif } @@ -307,12 +116,6 @@ PhysicsDirectSpaceState3D *World3D::get_direct_space_state() { return PhysicsServer3D::get_singleton()->space_get_direct_state(space); } -void World3D::get_camera_list(List<Camera3D *> *r_cameras) { - for (Map<Camera3D *, SpatialIndexer::CameraData>::Element *E = indexer->cameras.front(); E; E = E->next()) { - r_cameras->push_back(E->key()); - } -} - void World3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_space"), &World3D::get_space); ClassDB::bind_method(D_METHOD("get_navigation_map"), &World3D::get_navigation_map); @@ -327,10 +130,10 @@ void World3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_fallback_environment", "get_fallback_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "camera_effects", PROPERTY_HINT_RESOURCE_TYPE, "CameraEffects"), "set_camera_effects", "get_camera_effects"); - ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); - ADD_PROPERTY(PropertyInfo(Variant::RID, "navigation_map", PROPERTY_HINT_NONE, "", 0), "", "get_navigation_map"); - ADD_PROPERTY(PropertyInfo(Variant::RID, "scenario", PROPERTY_HINT_NONE, "", 0), "", "get_scenario"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState3D", 0), "", "get_direct_space_state"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_space"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "navigation_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_navigation_map"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "scenario", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_scenario"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState3D", PROPERTY_USAGE_NONE), "", "get_direct_space_state"); } World3D::World3D() { @@ -349,20 +152,10 @@ World3D::World3D() { NavigationServer3D::get_singleton()->map_set_active(navigation_map, true); NavigationServer3D::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/3d/default_cell_size", 0.3)); NavigationServer3D::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/3d/default_edge_connection_margin", 0.3)); - -#ifdef _3D_DISABLED - indexer = nullptr; -#else - indexer = memnew(SpatialIndexer); -#endif } World3D::~World3D() { PhysicsServer3D::get_singleton()->free(space); RenderingServer::get_singleton()->free(scenario); NavigationServer3D::get_singleton()->free(navigation_map); - -#ifndef _3D_DISABLED - memdelete(indexer); -#endif } diff --git a/scene/resources/world_3d.h b/scene/resources/world_3d.h index 4e2717a2bb..2c5be35609 100644 --- a/scene/resources/world_3d.h +++ b/scene/resources/world_3d.h @@ -38,7 +38,7 @@ #include "servers/rendering_server.h" class Camera3D; -class VisibilityNotifier3D; +class VisibleOnScreenNotifier3D; struct SpatialIndexer; class World3D : public Resource { @@ -48,27 +48,21 @@ private: RID space; RID navigation_map; RID scenario; - SpatialIndexer *indexer; + Ref<Environment> environment; Ref<Environment> fallback_environment; Ref<CameraEffects> camera_effects; + Set<Camera3D *> cameras; + protected: static void _bind_methods(); friend class Camera3D; - friend class VisibilityNotifier3D; void _register_camera(Camera3D *p_camera); - void _update_camera(Camera3D *p_camera); void _remove_camera(Camera3D *p_camera); - void _register_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect); - void _update_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect); - void _remove_notifier(VisibilityNotifier3D *p_notifier); - friend class Viewport; - void _update(uint64_t p_frame); - public: RID get_space() const; RID get_navigation_map() const; @@ -83,7 +77,7 @@ public: void set_camera_effects(const Ref<CameraEffects> &p_camera_effects); Ref<CameraEffects> get_camera_effects() const; - void get_camera_list(List<Camera3D *> *r_cameras); + _FORCE_INLINE_ const Set<Camera3D *> &get_cameras() const { return cameras; } PhysicsDirectSpaceState3D *get_direct_space_state(); diff --git a/servers/rendering/rasterizer_dummy.h b/servers/rendering/rasterizer_dummy.h index b44088e822..d4c25b6253 100644 --- a/servers/rendering/rasterizer_dummy.h +++ b/servers/rendering/rasterizer_dummy.h @@ -621,9 +621,18 @@ public: bool particles_collision_is_heightfield(RID p_particles_collision) const override { return false; } RID particles_collision_get_heightfield_framebuffer(RID p_particles_collision) const override { return RID(); } - RID particles_collision_instance_create(RID p_collision) override { return RID(); }; - void particles_collision_instance_set_transform(RID p_collision_instance, const Transform3D &p_transform) override{}; - void particles_collision_instance_set_active(RID p_collision_instance, bool p_active) override{}; + RID particles_collision_instance_create(RID p_collision) override { return RID(); } + void particles_collision_instance_set_transform(RID p_collision_instance, const Transform3D &p_transform) override {} + void particles_collision_instance_set_active(RID p_collision_instance, bool p_active) override {} + + /* VISIBILITY NOTIFIER */ + virtual RID visibility_notifier_allocate() override { return RID(); } + virtual void visibility_notifier_initialize(RID p_notifier) override {} + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override {} + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override {} + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const override { return AABB(); } + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override {} /* GLOBAL VARIABLES */ diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index 5703737252..016a172f25 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -1003,6 +1003,18 @@ void RendererCanvasCull::canvas_item_add_clip_ignore(RID p_item, bool p_ignore) ci->ignore = p_ignore; } +void RendererCanvasCull::canvas_item_add_animation_slice(RID p_item, double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset) { + Item *canvas_item = canvas_item_owner.getornull(p_item); + ERR_FAIL_COND(!canvas_item); + + Item::CommandAnimationSlice *as = canvas_item->alloc_command<Item::CommandAnimationSlice>(); + ERR_FAIL_COND(!as); + as->animation_length = p_animation_length; + as->slice_begin = p_slice_begin; + as->slice_end = p_slice_end; + as->offset = p_offset; +} + void RendererCanvasCull::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) { Item *canvas_item = canvas_item_owner.getornull(p_item); ERR_FAIL_COND(!canvas_item); diff --git a/servers/rendering/renderer_canvas_cull.h b/servers/rendering/renderer_canvas_cull.h index 661216cad3..a51b419613 100644 --- a/servers/rendering/renderer_canvas_cull.h +++ b/servers/rendering/renderer_canvas_cull.h @@ -231,6 +231,8 @@ public: void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture); void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform); void canvas_item_add_clip_ignore(RID p_item, bool p_ignore); + void canvas_item_add_animation_slice(RID p_item, double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset); + void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); void canvas_item_set_z_index(RID p_item, int p_z); void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable); diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index 0266e137c0..c10b9db035 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -180,6 +180,7 @@ public: TYPE_PARTICLES, TYPE_TRANSFORM, TYPE_CLIP_IGNORE, + TYPE_ANIMATION_SLICE, }; Command *next; @@ -286,6 +287,17 @@ public: } }; + struct CommandAnimationSlice : public Command { + double animation_length = 0; + double slice_begin = 0; + double slice_end = 0; + double offset = 0; + + CommandAnimationSlice() { + type = TYPE_ANIMATION_SLICE; + } + }; + struct ViewportRender { RenderingServer *owner; void *udata; diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index 9d325fe69b..fe6d3be82e 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -464,8 +464,15 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RID last_texture; Size2 texpixel_size; + bool skipping = false; + const Item::Command *c = p_item->commands; while (c) { + if (skipping && c->type != Item::Command::TYPE_ANIMATION_SLICE) { + c = c->next; + continue; + } + push_constant.flags = base_flags | (push_constant.flags & (FLAGS_DEFAULT_NORMAL_MAP_USED | FLAGS_DEFAULT_SPECULAR_MAP_USED)); //reset on each command for sanity, keep canvastexture binding config switch (c->type) { @@ -879,6 +886,14 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend } } break; + case Item::Command::TYPE_ANIMATION_SLICE: { + const Item::CommandAnimationSlice *as = static_cast<const Item::CommandAnimationSlice *>(c); + double current_time = RendererCompositorRD::singleton->get_total_time(); + double local_time = Math::fposmod(current_time - as->offset, as->animation_length); + skipping = !(local_time >= as->slice_begin && local_time < as->slice_end); + + RenderingServerDefault::redraw_request(); // animation visible means redraw request + } break; } c = c->next; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 64be54115f..246b5f0e4c 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -5535,6 +5535,59 @@ void RendererStorageRD::particles_collision_instance_set_active(RID p_collision_ pci->active = p_active; } +/* VISIBILITY NOTIFIER */ + +RID RendererStorageRD::visibility_notifier_allocate() { + return visibility_notifier_owner.allocate_rid(); +} +void RendererStorageRD::visibility_notifier_initialize(RID p_notifier) { + visibility_notifier_owner.initialize_rid(p_notifier, VisibilityNotifier()); +} +void RendererStorageRD::visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) { + VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_notifier); + ERR_FAIL_COND(!vn); + vn->aabb = p_aabb; + vn->dependency.changed_notify(DEPENDENCY_CHANGED_AABB); +} +void RendererStorageRD::visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) { + VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_notifier); + ERR_FAIL_COND(!vn); + vn->enter_callback = p_enter_callbable; + vn->exit_callback = p_exit_callable; +} + +AABB RendererStorageRD::visibility_notifier_get_aabb(RID p_notifier) const { + const VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_notifier); + ERR_FAIL_COND_V(!vn, AABB()); + return vn->aabb; +} +void RendererStorageRD::visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) { + VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_notifier); + ERR_FAIL_COND(!vn); + + if (p_enter) { + if (!vn->enter_callback.is_null()) { + if (p_deferred) { + vn->enter_callback.call_deferred(nullptr, 0); + } else { + Variant r; + Callable::CallError ce; + vn->enter_callback.call(nullptr, 0, r, ce); + } + } + } else { + if (!vn->exit_callback.is_null()) { + if (p_deferred) { + vn->exit_callback.call_deferred(nullptr, 0); + } else { + Variant r; + Callable::CallError ce; + vn->exit_callback.call(nullptr, 0, r, ce); + } + } + } +} + /* SKELETON API */ RID RendererStorageRD::skeleton_allocate() { @@ -7590,6 +7643,9 @@ void RendererStorageRD::base_update_dependency(RID p_base, DependencyTracker *p_ } else if (particles_collision_owner.owns(p_base)) { ParticlesCollision *pc = particles_collision_owner.getornull(p_base); p_instance->update_dependency(&pc->dependency); + } else if (visibility_notifier_owner.owns(p_base)) { + VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_base); + p_instance->update_dependency(&vn->dependency); } } @@ -7628,6 +7684,9 @@ RS::InstanceType RendererStorageRD::get_base_type(RID p_rid) const { if (particles_collision_owner.owns(p_rid)) { return RS::INSTANCE_PARTICLES_COLLISION; } + if (visibility_notifier_owner.owns(p_rid)) { + return RS::INSTANCE_VISIBLITY_NOTIFIER; + } return RS::INSTANCE_NONE; } @@ -8704,6 +8763,10 @@ bool RendererStorageRD::free(RID p_rid) { } particles_collision->dependency.deleted_notify(p_rid); particles_collision_owner.free(p_rid); + } else if (visibility_notifier_owner.owns(p_rid)) { + VisibilityNotifier *vn = visibility_notifier_owner.getornull(p_rid); + vn->dependency.deleted_notify(p_rid); + visibility_notifier_owner.free(p_rid); } else if (particles_collision_instance_owner.owns(p_rid)) { particles_collision_instance_owner.free(p_rid); } else if (render_target_owner.owns(p_rid)) { diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.h b/servers/rendering/renderer_rd/renderer_storage_rd.h index 28a1044705..ab470cb3a6 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.h +++ b/servers/rendering/renderer_rd/renderer_storage_rd.h @@ -947,6 +947,17 @@ private: mutable RID_Owner<ParticlesCollisionInstance> particles_collision_instance_owner; + /* visibility_notifier */ + + struct VisibilityNotifier { + AABB aabb; + Callable enter_callback; + Callable exit_callback; + Dependency dependency; + }; + + mutable RID_Owner<VisibilityNotifier> visibility_notifier_owner; + /* Skeleton */ struct Skeleton { @@ -2253,6 +2264,14 @@ public: virtual bool particles_collision_is_heightfield(RID p_particles_collision) const; RID particles_collision_get_heightfield_framebuffer(RID p_particles_collision) const; + virtual RID visibility_notifier_allocate(); + virtual void visibility_notifier_initialize(RID p_notifier); + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb); + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable); + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const; + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred); + //used from 2D and 3D virtual RID particles_collision_instance_create(RID p_collision); virtual void particles_collision_instance_set_transform(RID p_collision_instance, const Transform3D &p_transform); diff --git a/servers/rendering/renderer_scene.h b/servers/rendering/renderer_scene.h index 3b25498ed8..d71425f465 100644 --- a/servers/rendering/renderer_scene.h +++ b/servers/rendering/renderer_scene.h @@ -207,6 +207,7 @@ public: virtual void update() = 0; virtual void render_probes() = 0; + virtual void update_visibility_notifiers() = 0; virtual bool free(RID p_rid) = 0; diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 2c66b22089..60c7dbf3b7 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -506,6 +506,9 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { InstanceParticlesCollisionData *collision = static_cast<InstanceParticlesCollisionData *>(instance->base_data); RSG::storage->free(collision->instance); } break; + case RS::INSTANCE_VISIBLITY_NOTIFIER: { + //none + } break; case RS::INSTANCE_REFLECTION_PROBE: { InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(instance->base_data); scene_render->free(reflection_probe->instance); @@ -615,6 +618,11 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { RSG::storage->particles_collision_instance_set_active(collision->instance, instance->visible); instance->base_data = collision; } break; + case RS::INSTANCE_VISIBLITY_NOTIFIER: { + InstanceVisibilityNotifierData *vnd = memnew(InstanceVisibilityNotifierData); + vnd->base = p_base; + instance->base_data = vnd; + } break; case RS::INSTANCE_REFLECTION_PROBE: { InstanceReflectionProbeData *reflection_probe = memnew(InstanceReflectionProbeData); reflection_probe->owner = instance; @@ -1549,6 +1557,9 @@ void RendererSceneCull::_update_instance(Instance *p_instance) { case RS::INSTANCE_VOXEL_GI: { idata.instance_data_rid = static_cast<InstanceVoxelGIData *>(p_instance->base_data)->probe_instance.get_id(); } break; + case RS::INSTANCE_VISIBLITY_NOTIFIER: { + idata.visibility_notifier = static_cast<InstanceVisibilityNotifierData *>(p_instance->base_data); + } break; default: { } } @@ -1758,6 +1769,9 @@ void RendererSceneCull::_update_instance_aabb(Instance *p_instance) { new_aabb = RSG::storage->particles_collision_get_aabb(p_instance->base); } break; + case RenderingServer::INSTANCE_VISIBLITY_NOTIFIER: { + new_aabb = RSG::storage->visibility_notifier_get_aabb(p_instance->base); + } break; case RenderingServer::INSTANCE_LIGHT: { new_aabb = RSG::storage->light_get_aabb(p_instance->base); @@ -2613,6 +2627,15 @@ void RendererSceneCull::_scene_cull(CullData &cull_data, InstanceCullResult &cul } else if (base_type == RS::INSTANCE_LIGHTMAP) { cull_result.lightmaps.push_back(RID::from_uint64(idata.instance_data_rid)); + } else if (base_type == RS::INSTANCE_VISIBLITY_NOTIFIER) { + InstanceVisibilityNotifierData *vnd = idata.visibility_notifier; + if (!vnd->list_element.in_list()) { + visible_notifier_list_lock.lock(); + visible_notifier_list.add(&vnd->list_element); + visible_notifier_list_lock.unlock(); + vnd->just_visible = true; + } + vnd->visible_in_frame = RSG::rasterizer->get_frame_number(); } else if (((1 << base_type) & RS::INSTANCE_GEOMETRY_MASK) && !(idata.flags & InstanceData::FLAG_CAST_SHADOWS_ONLY)) { bool keep = true; @@ -3849,6 +3872,28 @@ TypedArray<Image> RendererSceneCull::bake_render_uv2(RID p_base, const Vector<RI return scene_render->bake_render_uv2(p_base, p_material_overrides, p_image_size); } +void RendererSceneCull::update_visibility_notifiers() { + SelfList<InstanceVisibilityNotifierData> *E = visible_notifier_list.first(); + while (E) { + SelfList<InstanceVisibilityNotifierData> *N = E->next(); + + InstanceVisibilityNotifierData *visibility_notifier = E->self(); + if (visibility_notifier->just_visible) { + visibility_notifier->just_visible = false; + + RSG::storage->visibility_notifier_call(visibility_notifier->base, true, RSG::threaded); + } else { + if (visibility_notifier->visible_in_frame != RSG::rasterizer->get_frame_number()) { + visible_notifier_list.remove(E); + + RSG::storage->visibility_notifier_call(visibility_notifier->base, false, RSG::threaded); + } + } + + E = N; + } +} + /*******************************/ /* Passthrough to Scene Render */ /*******************************/ diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index bdfbea95a2..d9466d8b04 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -118,6 +118,8 @@ public: virtual void occluder_initialize(RID p_occluder); virtual void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices); + /* VISIBILITY NOTIFIER API */ + RendererSceneOcclusionCull *dummy_occlusion_culling; /* SCENARIO API */ @@ -243,6 +245,8 @@ public: } }; + struct InstanceVisibilityNotifierData; + struct InstanceData { // Store instance pointer as well as common instance processing information, // to make processing more cache friendly. @@ -271,6 +275,7 @@ public: union { uint64_t instance_data_rid; RendererSceneRender::GeometryInstance *instance_geometry; + InstanceVisibilityNotifierData *visibility_notifier; }; Instance *instance = nullptr; int32_t parent_array_index = -1; @@ -611,6 +616,18 @@ public: RID instance; }; + struct InstanceVisibilityNotifierData : public InstanceBaseData { + bool just_visible = false; + uint64_t visible_in_frame = 0; + RID base; + SelfList<InstanceVisibilityNotifierData> list_element; + InstanceVisibilityNotifierData() : + list_element(this) {} + }; + + SpinLock visible_notifier_list_lock; + SelfList<InstanceVisibilityNotifierData>::List visible_notifier_list; + struct InstanceLightData : public InstanceBaseData { RID instance; uint64_t last_version; @@ -1123,6 +1140,8 @@ public: void set_scene_render(RendererSceneRender *p_scene_render); + virtual void update_visibility_notifiers(); + RendererSceneCull(); virtual ~RendererSceneCull(); }; diff --git a/servers/rendering/renderer_storage.h b/servers/rendering/renderer_storage.h index e6b9ac15ff..f22c582f48 100644 --- a/servers/rendering/renderer_storage.h +++ b/servers/rendering/renderer_storage.h @@ -557,6 +557,14 @@ public: virtual bool particles_collision_is_heightfield(RID p_particles_collision) const = 0; virtual RID particles_collision_get_heightfield_framebuffer(RID p_particles_collision) const = 0; + virtual RID visibility_notifier_allocate() = 0; + virtual void visibility_notifier_initialize(RID p_notifier) = 0; + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) = 0; + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) = 0; + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const = 0; + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) = 0; + //used from 2D and 3D virtual RID particles_collision_instance_create(RID p_collision) = 0; virtual void particles_collision_instance_set_transform(RID p_collision_instance, const Transform3D &p_transform) = 0; diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 95aa05f6b3..629d212b69 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -118,6 +118,7 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { RSG::rasterizer->end_frame(p_swap_buffers); RSG::canvas->update_visibility_notifiers(); + RSG::scene->update_visibility_notifiers(); while (frame_drawn_callbacks.front()) { Object *obj = ObjectDB::get_instance(frame_drawn_callbacks.front()->get().object); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 73373c97bb..16e9f1fc77 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -529,6 +529,12 @@ public: FUNC1(particles_collision_height_field_update, RID) FUNC2(particles_collision_set_height_field_resolution, RID, ParticlesCollisionHeightfieldResolution) + /* VISIBILITY_NOTIFIER */ + + FUNCRIDSPLIT(visibility_notifier) + FUNC2(visibility_notifier_set_aabb, RID, const AABB &) + FUNC3(visibility_notifier_set_callbacks, RID, const Callable &, const Callable &) + #undef server_name #undef ServerName //from now on, calls forwarded to this singleton @@ -549,7 +555,7 @@ public: /* OCCLUDER */ FUNCRIDSPLIT(occluder) - FUNC3(occluder_set_mesh, RID, const PackedVector3Array &, const PackedInt32Array &); + FUNC3(occluder_set_mesh, RID, const PackedVector3Array &, const PackedInt32Array &) #undef server_name #undef ServerName @@ -807,6 +813,8 @@ public: FUNC3(canvas_item_add_particles, RID, RID, RID) FUNC2(canvas_item_add_set_transform, RID, const Transform2D &) FUNC2(canvas_item_add_clip_ignore, RID, bool) + FUNC5(canvas_item_add_animation_slice, RID, double, double, double, double) + FUNC2(canvas_item_set_sort_children_by_y, RID, bool) FUNC2(canvas_item_set_z_index, RID, int) FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool) diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 0cb765ef56..594e2d885c 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -722,6 +722,17 @@ public: virtual void particles_collision_set_height_field_resolution(RID p_particles_collision, ParticlesCollisionHeightfieldResolution p_resolution) = 0; //for SDF and vector field + /* VISIBILITY NOTIFIER API */ + + virtual RID visibility_notifier_create() = 0; + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) = 0; + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) = 0; + + /* OCCLUDER API */ + + virtual RID occluder_create() = 0; + virtual void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) = 0; + /* CAMERA API */ virtual RID camera_create() = 0; @@ -734,11 +745,6 @@ public: virtual void camera_set_camera_effects(RID p_camera, RID p_camera_effects) = 0; virtual void camera_set_use_vertical_aspect(RID p_camera, bool p_enable) = 0; - /* OCCLUDER API */ - - virtual RID occluder_create() = 0; - virtual void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) = 0; - /* VIEWPORT TARGET API */ enum CanvasItemTextureFilter { @@ -1148,6 +1154,7 @@ public: INSTANCE_VOXEL_GI, INSTANCE_LIGHTMAP, INSTANCE_OCCLUDER, + INSTANCE_VISIBLITY_NOTIFIER, INSTANCE_MAX, INSTANCE_GEOMETRY_MASK = (1 << INSTANCE_MESH) | (1 << INSTANCE_MULTIMESH) | (1 << INSTANCE_IMMEDIATE) | (1 << INSTANCE_PARTICLES) @@ -1287,6 +1294,7 @@ public: virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture) = 0; virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0; virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0; + virtual void canvas_item_add_animation_slice(RID p_item, double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset) = 0; virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) = 0; virtual void canvas_item_set_z_index(RID p_item, int p_z) = 0; virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) = 0; diff --git a/tests/test_config_file.h b/tests/test_config_file.h index 958341018b..33fd30ffa1 100644 --- a/tests/test_config_file.h +++ b/tests/test_config_file.h @@ -138,8 +138,8 @@ name="Unnamed Player" tagline="Waiting for Godot" -color=Color( 0, 0.5, 1, 1 ) -position=Vector2( 3, 4 ) +color=Color(0, 0.5, 1, 1) +position=Vector2(3, 4) [graphics] |