diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 | ||||
-rw-r--r-- | doc/classes/GraphNode.xml | 7 | ||||
-rw-r--r-- | doc/classes/Transform.xml | 9 | ||||
-rw-r--r-- | doc/classes/Transform2D.xml | 7 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 27 | ||||
-rw-r--r-- | scene/gui/control.cpp | 18 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 11 |
10 files changed, 53 insertions, 34 deletions
diff --git a/.travis.yml b/.travis.yml index e7a13e3811..7350849d6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -128,7 +128,7 @@ before_script: script: - if [ "$STATIC_CHECKS" = "yes" ]; then - sh ./misc/travis/clang-format.sh; + sh ./misc/travis/clang-format.sh && doc/tools/makerst.py --dry-run doc/classes modules; else scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS && diff --git a/core/variant_call.cpp b/core/variant_call.cpp index f6ecc506a4..8aae2d8490 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1950,7 +1950,7 @@ void register_variant_methods() { ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, orthonormalized, varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, rotated, VECTOR3, "axis", REAL, "phi", varray()); ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, scaled, VECTOR3, "scale", varray()); - ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "ofs", varray()); + ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "offset", varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, looking_at, VECTOR3, "target", VECTOR3, "up", varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", REAL, "weight", varray()); ADDFUNC1R(TRANSFORM, BOOL, Transform, is_equal_approx, TRANSFORM, "transform", varray()); diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 8470a346ff..77b3eb1ca0 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -5,6 +5,7 @@ </brief_description> <description> A GraphNode is a container defined by a title. It can have one or more input and output slots, which can be enabled (shown) or disabled (not shown) and have different (incompatible) types. Colors can also be assigned to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input and output connections are left and right slots, but only enabled slots are counted as connections. + To add a slot to GraphNode, add any [Control]-derived child node to it. </description> <tutorials> </tutorials> @@ -169,6 +170,12 @@ <argument index="8" name="custom_right" type="Texture" default="null"> </argument> <description> + Sets properties of the slot with id [code]idx[/code]. + If [code]enable_left[/code]/[code]right[/code], a port will appear and the slot will be able to be connected from this side. + [code]type_left[/code]/[code]right[/code] is an arbitrary type of the port. Only ports with the same type values can be connected. + [code]color_left[/code]/[code]right[/code] is the tint of the port's icon on this side. + [code]custom_left[/code]/[code]right[/code] is a custom texture for this side's port. + [b]Note:[/b] this method only sets properties of the slot. To create the slot, add a [Control]-derived child to the GraphNode. </description> </method> </methods> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 4c4022b3b5..2e447ca1ba 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -126,7 +126,7 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Rotates the transform around given axis by phi. The axis must be a normalized vector. + Rotates the transform around the given axis by the given angle (in radians), using matrix multiplication. The axis must be a normalized vector. </description> </method> <method name="scaled"> @@ -135,16 +135,17 @@ <argument index="0" name="scale" type="Vector3"> </argument> <description> - Scales the transform by the specified 3D scaling factors. + Scales the transform by the given scale factor, using matrix multiplication. </description> </method> <method name="translated"> <return type="Transform"> </return> - <argument index="0" name="ofs" type="Vector3"> + <argument index="0" name="offset" type="Vector3"> </argument> <description> - Translates the transform by the specified offset. + Translates the transform by the given offset, relative to the transform's basis vectors. + Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> <method name="xform"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 6288bb074c..afc8b04dc7 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -128,7 +128,7 @@ <argument index="0" name="phi" type="float"> </argument> <description> - Rotates the transform by the given angle (in radians). + Rotates the transform by the given angle (in radians), using matrix multiplication. </description> </method> <method name="scaled"> @@ -137,7 +137,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> - Scales the transform by the given factor. + Scales the transform by the given scale factor, using matrix multiplication. </description> </method> <method name="translated"> @@ -146,7 +146,8 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> - Translates the transform by the given offset. + Translates the transform by the given offset, relative to the transform's basis vectors. + Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> <method name="xform"> diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 06608c658d..4e85fc93dd 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -1954,8 +1954,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado Color color = light_ptr->color * sign * energy * Math_PI; state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_COLOR, color); - Color shadow_color = light_ptr->shadow_color.to_linear(); - state.scene_shader.set_uniform(SceneShaderGLES2::SHADOW_COLOR, shadow_color); + state.scene_shader.set_uniform(SceneShaderGLES2::SHADOW_COLOR, light_ptr->shadow_color); //specific parameters diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index b261ca4712..ce31714e0c 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1494,6 +1494,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { error_label->add_color_override("color", get_color("error_color", "Editor")); error_hb->add_child(error_label); error_tr = memnew(TextureRect); + error_tr->set_v_size_flags(Control::SIZE_SHRINK_CENTER); error_hb->add_child(error_tr); description = NULL; diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index e84f84d788..c4b7e4887e 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -1377,23 +1377,26 @@ You can also use [code]yield[/code] to wait for a function to finish: [codeblock] func _ready(): - yield(do_something(), "completed") - yield(do_something_else(), "completed") - print("All functions are done!") + yield(countdown(), "completed") # waiting for the countdown() function to complete + print('Ready') - func do_something(): - print("Something is done!") - - func do_something_else(): - print("Something else is done!") + func countdown(): + yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready() + print(3) + yield(get_tree().create_timer(1.0), "timeout") + print(2) + yield(get_tree().create_timer(1.0), "timeout") + print(1) + yield(get_tree().create_timer(1.0), "timeout") # prints: - # Something is done! - # Something else is done! - # All functions are done! + # 3 + # 2 + # 1 + # Ready [/codeblock] When yielding on a function, the [code]completed[/code] signal will be emitted automatically when the function returns. It can, therefore, be used as the [code]signal[/code] parameter of the [code]yield[/code] method to resume. - If you are planning on calling the same function within a loop, you should consider using [code]yield(get_tree(), "idle_frame")[/code] also. + In order to yield on a function, the resulting function should also return a [code]GDScriptFunctionState[/code]. Notice [code]yield(get_tree(), "idle_frame")[/code] from the above example. </description> </method> </methods> diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 8b4d5d4980..ccc658b0aa 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2012,14 +2012,15 @@ Control *Control::find_next_valid_focus() const { if (!data.focus_next.is_empty()) { Node *n = get_node(data.focus_next); + Control *c; if (n) { - from = Object::cast_to<Control>(n); - ERR_FAIL_COND_V_MSG(!from, NULL, "Next focus node is not a control: " + n->get_name() + "."); + c = Object::cast_to<Control>(n); + ERR_FAIL_COND_V_MSG(!c, NULL, "Next focus node is not a control: " + n->get_name() + "."); } else { return NULL; } - if (from->is_visible() && from->get_focus_mode() != FOCUS_NONE) - return from; + if (c->is_visible() && c->get_focus_mode() != FOCUS_NONE) + return c; } // find next child @@ -2102,14 +2103,15 @@ Control *Control::find_prev_valid_focus() const { if (!data.focus_prev.is_empty()) { Node *n = get_node(data.focus_prev); + Control *c; if (n) { - from = Object::cast_to<Control>(n); - ERR_FAIL_COND_V_MSG(!from, NULL, "Previous focus node is not a control: " + n->get_name() + "."); + c = Object::cast_to<Control>(n); + ERR_FAIL_COND_V_MSG(!c, NULL, "Previous focus node is not a control: " + n->get_name() + "."); } else { return NULL; } - if (from->is_visible() && from->get_focus_mode() != FOCUS_NONE) - return from; + if (c->is_visible() && c->get_focus_mode() != FOCUS_NONE) + return c; } // find prev child diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index bf3ec9b05b..9bcacd6ee3 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5177,11 +5177,16 @@ void TextEdit::cut() { OS::get_singleton()->set_clipboard(clipboard); cursor_set_line(cursor.line); cursor_set_column(0); - _remove_text(cursor.line, 0, cursor.line, text[cursor.line].length()); - backspace_at_cursor(); + if (cursor.line == 0 && get_line_count() > 1) { + _remove_text(cursor.line, 0, cursor.line + 1, 0); + } else { + _remove_text(cursor.line, 0, cursor.line, text[cursor.line].length()); + backspace_at_cursor(); + cursor_set_line(cursor.line + 1); + } + update(); - cursor_set_line(cursor.line + 1); cut_copy_line = clipboard; } else { |