diff options
-rw-r--r-- | core/core_constants.cpp | 3 | ||||
-rw-r--r-- | core/string/translation.cpp | 1 | ||||
-rw-r--r-- | core/variant/variant_call.cpp | 3 | ||||
-rw-r--r-- | core/variant/variant_op.cpp | 5 | ||||
-rw-r--r-- | doc/classes/@GlobalScope.xml | 6 | ||||
-rw-r--r-- | doc/classes/RID.xml | 6 | ||||
-rw-r--r-- | doc/classes/String.xml | 16 | ||||
-rw-r--r-- | doc/classes/StringName.xml | 24 | ||||
-rw-r--r-- | doc/classes/TranslationServer.xml | 7 | ||||
-rw-r--r-- | doc/classes/int.xml | 7 |
10 files changed, 78 insertions, 0 deletions
diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 2f5fd05e6a..63e7323f7a 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -165,6 +165,9 @@ void register_global_constants() { BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_CENTER); BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BOTTOM); + BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_IMAGE_MASK); + BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TEXT_MASK); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SPECIAL); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ESCAPE); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, TAB); diff --git a/core/string/translation.cpp b/core/string/translation.cpp index 7cc41df9ef..eeac8b0acf 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -925,6 +925,7 @@ bool TranslationServer::is_placeholder(String &p_message, int p_index) const { void TranslationServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_locale", "locale"), &TranslationServer::set_locale); ClassDB::bind_method(D_METHOD("get_locale"), &TranslationServer::get_locale); + ClassDB::bind_method(D_METHOD("get_tool_locale"), &TranslationServer::get_tool_locale); ClassDB::bind_method(D_METHOD("compare_locales", "locale_a", "locale_b"), &TranslationServer::compare_locales); ClassDB::bind_method(D_METHOD("standardize_locale", "locale"), &TranslationServer::standardize_locale); diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 750f23902d..a5e89eec80 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1371,6 +1371,8 @@ static void _register_variant_builtin_methods() { bind_method(String, length, sarray(), varray()); bind_method(String, substr, sarray("from", "len"), varray(-1)); bind_method(String, get_slice, sarray("delimiter", "slice"), varray()); + bind_method(String, get_slicec, sarray("delimiter", "slice"), varray()); + bind_method(String, get_slice_count, sarray("delimiter"), varray()); bind_methodv(String, find, static_cast<int (String::*)(const String &, int) const>(&String::find), sarray("what", "from"), varray(0)); bind_method(String, count, sarray("what", "from", "to"), varray(0, 0)); bind_method(String, countn, sarray("what", "from", "to"), varray(0, 0)); @@ -1667,6 +1669,7 @@ static void _register_variant_builtin_methods() { /* RID */ + bind_method(RID, is_valid, sarray(), varray()); bind_method(RID, get_id, sarray(), varray()); /* NodePath */ diff --git a/core/variant/variant_op.cpp b/core/variant/variant_op.cpp index f35774204b..cd1ae9f41f 100644 --- a/core/variant/variant_op.cpp +++ b/core/variant/variant_op.cpp @@ -176,6 +176,7 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorAdd<double, double, int64_t>>(Variant::OP_ADD, Variant::FLOAT, Variant::INT); register_op<OperatorEvaluatorAdd<double, double, double>>(Variant::OP_ADD, Variant::FLOAT, Variant::FLOAT); register_op<OperatorEvaluatorAdd<String, String, String>>(Variant::OP_ADD, Variant::STRING, Variant::STRING); + register_op<OperatorEvaluatorAdd<String, char32_t, String>>(Variant::OP_ADD, Variant::INT, Variant::STRING); register_op<OperatorEvaluatorAdd<Vector2, Vector2, Vector2>>(Variant::OP_ADD, Variant::VECTOR2, Variant::VECTOR2); register_op<OperatorEvaluatorAdd<Vector2i, Vector2i, Vector2i>>(Variant::OP_ADD, Variant::VECTOR2I, Variant::VECTOR2I); register_op<OperatorEvaluatorAdd<Vector3, Vector3, Vector3>>(Variant::OP_ADD, Variant::VECTOR3, Variant::VECTOR3); @@ -622,6 +623,7 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorLess<double, int64_t>>(Variant::OP_LESS, Variant::FLOAT, Variant::INT); register_op<OperatorEvaluatorLess<double, double>>(Variant::OP_LESS, Variant::FLOAT, Variant::FLOAT); register_op<OperatorEvaluatorLess<String, String>>(Variant::OP_LESS, Variant::STRING, Variant::STRING); + register_op<OperatorEvaluatorLess<StringName, StringName>>(Variant::OP_LESS, Variant::STRING_NAME, Variant::STRING_NAME); register_op<OperatorEvaluatorLess<Vector2, Vector2>>(Variant::OP_LESS, Variant::VECTOR2, Variant::VECTOR2); register_op<OperatorEvaluatorLess<Vector2i, Vector2i>>(Variant::OP_LESS, Variant::VECTOR2I, Variant::VECTOR2I); register_op<OperatorEvaluatorLess<Vector3, Vector3>>(Variant::OP_LESS, Variant::VECTOR3, Variant::VECTOR3); @@ -634,6 +636,7 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorLessEqual<double, int64_t>>(Variant::OP_LESS_EQUAL, Variant::FLOAT, Variant::INT); register_op<OperatorEvaluatorLessEqual<double, double>>(Variant::OP_LESS_EQUAL, Variant::FLOAT, Variant::FLOAT); register_op<OperatorEvaluatorLessEqual<String, String>>(Variant::OP_LESS_EQUAL, Variant::STRING, Variant::STRING); + register_op<OperatorEvaluatorLessEqual<StringName, StringName>>(Variant::OP_LESS_EQUAL, Variant::STRING_NAME, Variant::STRING_NAME); register_op<OperatorEvaluatorLessEqual<Vector2, Vector2>>(Variant::OP_LESS_EQUAL, Variant::VECTOR2, Variant::VECTOR2); register_op<OperatorEvaluatorLessEqual<Vector2i, Vector2i>>(Variant::OP_LESS_EQUAL, Variant::VECTOR2I, Variant::VECTOR2I); register_op<OperatorEvaluatorLessEqual<Vector3, Vector3>>(Variant::OP_LESS_EQUAL, Variant::VECTOR3, Variant::VECTOR3); @@ -647,6 +650,7 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorGreater<double, int64_t>>(Variant::OP_GREATER, Variant::FLOAT, Variant::INT); register_op<OperatorEvaluatorGreater<double, double>>(Variant::OP_GREATER, Variant::FLOAT, Variant::FLOAT); register_op<OperatorEvaluatorGreater<String, String>>(Variant::OP_GREATER, Variant::STRING, Variant::STRING); + register_op<OperatorEvaluatorGreater<StringName, StringName>>(Variant::OP_GREATER, Variant::STRING_NAME, Variant::STRING_NAME); register_op<OperatorEvaluatorGreater<Vector2, Vector2>>(Variant::OP_GREATER, Variant::VECTOR2, Variant::VECTOR2); register_op<OperatorEvaluatorGreater<Vector2i, Vector2i>>(Variant::OP_GREATER, Variant::VECTOR2I, Variant::VECTOR2I); register_op<OperatorEvaluatorGreater<Vector3, Vector3>>(Variant::OP_GREATER, Variant::VECTOR3, Variant::VECTOR3); @@ -659,6 +663,7 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorGreaterEqual<double, int64_t>>(Variant::OP_GREATER_EQUAL, Variant::FLOAT, Variant::INT); register_op<OperatorEvaluatorGreaterEqual<double, double>>(Variant::OP_GREATER_EQUAL, Variant::FLOAT, Variant::FLOAT); register_op<OperatorEvaluatorGreaterEqual<String, String>>(Variant::OP_GREATER_EQUAL, Variant::STRING, Variant::STRING); + register_op<OperatorEvaluatorGreaterEqual<StringName, StringName>>(Variant::OP_GREATER_EQUAL, Variant::STRING_NAME, Variant::STRING_NAME); register_op<OperatorEvaluatorGreaterEqual<Vector2, Vector2>>(Variant::OP_GREATER_EQUAL, Variant::VECTOR2, Variant::VECTOR2); register_op<OperatorEvaluatorGreaterEqual<Vector2i, Vector2i>>(Variant::OP_GREATER_EQUAL, Variant::VECTOR2I, Variant::VECTOR2I); register_op<OperatorEvaluatorGreaterEqual<Vector3, Vector3>>(Variant::OP_GREATER_EQUAL, Variant::VECTOR3, Variant::VECTOR3); diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index d8c9ca08e8..4c0f89f14d 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1267,6 +1267,12 @@ <constant name="INLINE_ALIGNMENT_BOTTOM" value="14" enum="InlineAlignment"> Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code]. </constant> + <constant name="INLINE_ALIGNMENT_IMAGE_MASK" value="3" enum="InlineAlignment"> + A bit mask for [code]INLINE_ALIGNMENT_*_TO[/code] alignment constants. + </constant> + <constant name="INLINE_ALIGNMENT_TEXT_MASK" value="12" enum="InlineAlignment"> + A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants. + </constant> <constant name="KEY_SPECIAL" value="16777216" enum="Key"> Keycodes with this bit applied are non-printable. </constant> diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index 695b0933fa..990e82593e 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -30,6 +30,12 @@ Returns the ID of the referenced resource. </description> </method> + <method name="is_valid" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if [RID] is valid. + </description> + </method> </methods> <operators> <operator name="operator !="> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index eeb17c24c0..a6182f5dab 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -222,6 +222,22 @@ [/codeblock] </description> </method> + <method name="get_slice_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="delimiter" type="String" /> + <description> + Splits a string using a [code]delimiter[/code] and returns a number of slices. + </description> + </method> + <method name="get_slicec" qualifiers="const"> + <return type="String" /> + <argument index="0" name="delimiter" type="int" /> + <argument index="1" name="slice" type="int" /> + <description> + Splits a string using a Unicode character with code [code]delimiter[/code] and returns a substring at index [code]slice[/code]. Returns an empty string if the index doesn't exist. + This is a more performant alternative to [method split] for cases when you need only one element from the array at a fixed index. + </description> + </method> <method name="hash" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index b32665a09f..85c4d7593e 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -48,6 +48,18 @@ <description> </description> </operator> + <operator name="operator <"> + <return type="bool" /> + <argument index="0" name="right" type="StringName" /> + <description> + </description> + </operator> + <operator name="operator <="> + <return type="bool" /> + <argument index="0" name="right" type="StringName" /> + <description> + </description> + </operator> <operator name="operator =="> <return type="bool" /> <description> @@ -65,5 +77,17 @@ <description> </description> </operator> + <operator name="operator >"> + <return type="bool" /> + <argument index="0" name="right" type="StringName" /> + <description> + </description> + </operator> + <operator name="operator >="> + <return type="bool" /> + <argument index="0" name="right" type="StringName" /> + <description> + </description> + </operator> </operators> </class> diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index c90cb2987c..6ece42da6b 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -91,6 +91,13 @@ Returns readable script name for the [code]script[/code] code. </description> </method> + <method name="get_tool_locale"> + <return type="String" /> + <description> + Returns the current locale of the editor. + [b]Note:[/b] When called from an exported project returns the same value as [method get_locale]. + </description> + </method> <method name="get_translation_object"> <return type="Translation" /> <argument index="0" name="locale" type="String" /> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index d212fe42bf..006dc7eb29 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -177,6 +177,13 @@ </description> </operator> <operator name="operator +"> + <return type="String" /> + <argument index="0" name="right" type="String" /> + <description> + Adds Unicode character with code [int] to the [String]. + </description> + </operator> + <operator name="operator +"> <return type="float" /> <argument index="0" name="right" type="float" /> <description> |