diff options
56 files changed, 244 insertions, 200 deletions
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml index 7e32db1bb8..2d3ebac78c 100644 --- a/doc/classes/AnimatedTexture.xml +++ b/doc/classes/AnimatedTexture.xml @@ -6,7 +6,7 @@ <description> [AnimatedTexture] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or [AnimatedSprite], it isn't a [Node], but has the advantage of being usable anywhere a [Texture] resource can be used, e.g. in a [TileSet]. The playback of the animation is controlled by the [member fps] property as well as each frame's optional delay (see [method set_frame_delay]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. - [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. + [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. Also, it doesn't support [AtlasTexture]. Each frame needs to be separate image. </description> <tutorials> </tutorials> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 7d5d8a2db1..b4288bbfaa 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -73,7 +73,7 @@ <argument index="6" name="optimize" type="bool" default="true"> </argument> <description> - Blend another animaiton node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition. + Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition. </description> </method> <method name="get_caption" qualifiers="virtual"> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index e510603281..5bb4a6e3c7 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -71,7 +71,7 @@ <argument index="0" name="animation" type="Animation"> </argument> <description> - Returns the name of [code]animation[/code] or empty string if not found. + Returns the name of [code]animation[/code] or an empty string if not found. </description> </method> <method name="get_animation" qualifiers="const"> @@ -112,6 +112,7 @@ <return type="PoolStringArray"> </return> <description> + Returns a list of the animation names that are currently queued to play. </description> </method> <method name="has_animation" qualifiers="const"> @@ -284,6 +285,7 @@ </signal> <signal name="caches_cleared"> <description> + Notifies when the caches have been cleared, either automatically, or manually via [method clear_caches]. </description> </signal> </signals> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 5b0a06a7fb..b270c7e279 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -4,8 +4,7 @@ Packs multiple small textures in a single, bigger one. Helps to optimize video memory costs and render calls. </brief_description> <description> - [Texture] resource aimed at managing big textures files that pack multiple smaller textures. Consists of a [Texture], a margin that defines the border width, - and a region that defines the actual area of the AtlasTexture. + [Texture] resource aimed at managing big textures files that pack multiple smaller textures. Consists of a [Texture], a margin that defines the border width, and a region that defines the actual area of the AtlasTexture. </description> <tutorials> </tutorials> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 16fb483249..aeeebdf00d 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -154,7 +154,7 @@ </member> <member name="offset_h" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0"> The horizontal offset of the camera, relative to the drag margins. - [b]Note:[/b] Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set inital offset. + [b]Note:[/b] Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset. </member> <member name="offset_v" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The vertical offset of the camera, relative to the drag margins. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 1eeef92ccc..05ffac803a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -22,7 +22,7 @@ </return> <description> Virtual method to be implemented by the user. Returns whether [method _gui_input] should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this [Control]. Similar to [member rect_clip_content], but doesn't affect visibility. - If not overriden, defaults to [code]false[/code]. + If not overridden, defaults to [code]false[/code]. </description> </method> <method name="_get_minimum_size" qualifiers="virtual"> @@ -30,7 +30,7 @@ </return> <description> Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). - If not overriden, defaults to [constant Vector2.ZERO]. + If not overridden, defaults to [constant Vector2.ZERO]. </description> </method> <method name="_gui_input" qualifiers="virtual"> @@ -395,7 +395,7 @@ <return type="void"> </return> <description> - Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control aquires focus. + Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus. [codeblock] func _process(delta): grab_click_focus() #when clicking another Control node, this node will be clicked instead @@ -503,7 +503,7 @@ </argument> <description> Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. - If not overriden, default behavior is checking if the point is within control's Rect. + If not overridden, default behavior is checking if the point is within control's Rect. [b]Node:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. </description> </method> @@ -564,7 +564,7 @@ <description> Sets the anchor identified by [code]margin[/code] constant from [enum Margin] enum to value [code]anchor[/code]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. If [code]keep_margin[/code] is [code]true[/code], margins aren't updated after this operation. - If [code]push_opposite_anchor[/code] is [code]true[/code] and the opposite anchor overlaps this anchor, the opposite one will have its value overriden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [code]push_opposite_anchor[/code] was [code]false[/code], the left anchor would get value 0.5. + If [code]push_opposite_anchor[/code] is [code]true[/code] and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [code]push_opposite_anchor[/code] was [code]false[/code], the left anchor would get value 0.5. </description> </method> <method name="set_anchor_and_margin"> diff --git a/doc/classes/EditorVCSInterface.xml b/doc/classes/EditorVCSInterface.xml index 2f58e6d54e..f67c1c9eb5 100644 --- a/doc/classes/EditorVCSInterface.xml +++ b/doc/classes/EditorVCSInterface.xml @@ -38,7 +38,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the VCS addon has been intialized, else returns [code]false[/code]. + Returns [code]true[/code] if the VCS addon has been initialized, else returns [code]false[/code]. </description> </method> <method name="get_modified_files_data"> @@ -65,7 +65,7 @@ <return type="String"> </return> <description> - Return the name of the VCS if the VCS has been intialized, else return an empty string. + Return the name of the VCS if the VCS has been initialized, else return an empty string. </description> </method> <method name="initialize"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 56cafa9bb6..d297bc98ae 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -415,7 +415,7 @@ <argument index="1" name="grayscale" type="bool" default="false"> </argument> <description> - Saves the image as an EXR file to [code]path[/code]. If grayscale is true and the image has only one channel, it will be saved explicitely as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. + Saves the image as an EXR file to [code]path[/code]. If grayscale is true and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. </description> </method> <method name="save_png" qualifiers="const"> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 7642c87636..afb3977849 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -223,7 +223,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons asigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. + Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. </description> </method> <method name="is_joy_button_pressed" qualifiers="const"> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index f191b08d96..ce7a6ef54c 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -51,7 +51,7 @@ The height of the 9-slice's top row. </member> <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. + 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="Texture" setter="set_texture" getter="get_texture"> The node's texture resource. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 097fa1f6e5..78fa69731d 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -171,6 +171,7 @@ <description> Duplicates the node, returning a new node. You can fine-tune the behavior using the [code]flags[/code] (see [enum DuplicateFlags]). + [b]Note:[/b] It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to [method Object._init] method). In that case, the node will be duplicated without a script. </description> </method> <method name="find_node" qualifiers="const"> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index abdbfa09f7..29c4680685 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -52,7 +52,7 @@ <argument index="0" name="point" type="Vector2"> </argument> <description> - Rotates the node so it points towards the [code]point[/code]. + Rotates the node so it points towards the [code]point[/code], which is expected to use global coordinates. </description> </method> <method name="move_local_x"> diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml index ba00438ea1..a139fa4664 100644 --- a/doc/classes/Physics2DServer.xml +++ b/doc/classes/Physics2DServer.xml @@ -822,7 +822,7 @@ <argument index="5" name="result" type="Physics2DTestMotionResult" default="null"> </argument> <description> - Returns whether a body can move from a given point in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in. + Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [Physics2DTestMotionResult] can be passed to return additional information in. </description> </method> <method name="capsule_shape_create"> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 3d6693da15..d917f7d7f8 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -233,7 +233,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manualy. + Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. </description> </method> <method name="get_item_metadata" qualifiers="const"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 86b874d8ee..b42a10b13b 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -722,7 +722,7 @@ Fix to improve physics jitter, specially on monitors where refresh rate is different than the physics FPS. </member> <member name="rendering/environment/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )"> - Default background clear color. Overriddable 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 VisualServer.set_default_clear_color]. + 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 VisualServer.set_default_clear_color]. </member> <member name="rendering/limits/buffers/blend_shape_max_buffer_size_kb" type="int" setter="" getter="" default="4096"> Max buffer size for blend shapes. Any blend shape bigger than this will not work. diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index b1e71ee924..8b17928f90 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -4,7 +4,7 @@ Skeleton for characters and animated objects. </brief_description> <description> - Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation]). Skeleton will support rag doll dynamics in the future. + Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation]). It can also use ragdoll physics. The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone. </description> diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 54bb7d3869..285cea7d0a 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3402,15 +3402,14 @@ void AnimationTrackEditor::_track_remove_request(int p_track) { int idx = p_track; if (idx >= 0 && idx < animation->get_track_count()) { - selection.clear(); - _clear_key_edit(); - //all will be updated after remove anyway, and triggering update here raises error on tracks already removed undo_redo->create_action(TTR("Remove Anim Track")); + undo_redo->add_do_method(this, "_clear_selection", false); undo_redo->add_do_method(animation.ptr(), "remove_track", idx); undo_redo->add_undo_method(animation.ptr(), "add_track", animation->track_get_type(idx), idx); undo_redo->add_undo_method(animation.ptr(), "track_set_path", idx, animation->track_get_path(idx)); - //todo interpolation + + // TODO interpolation. for (int i = 0; i < animation->track_get_key_count(idx); i++) { Variant v = animation->track_get_key_value(idx, i); @@ -3493,7 +3492,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { case Variant::QUAT: case Variant::PLANE: case Variant::COLOR: { - //good + // Valid. } break; default: { all_bezier = false; @@ -3956,7 +3955,9 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo bool created = false; if (p_id.track_idx < 0) { - if (p_create_beziers && (p_id.value.get_type() == Variant::VECTOR2 || + if (p_create_beziers && (p_id.value.get_type() == Variant::INT || + p_id.value.get_type() == Variant::REAL || + p_id.value.get_type() == Variant::VECTOR2 || p_id.value.get_type() == Variant::VECTOR3 || p_id.value.get_type() == Variant::QUAT || p_id.value.get_type() == Variant::COLOR || @@ -3979,10 +3980,10 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo Animation::UpdateMode update_mode = Animation::UPDATE_DISCRETE; if (p_id.type == Animation::TYPE_VALUE || p_id.type == Animation::TYPE_BEZIER) { - //wants a new tack + // Wants a new track. { - //hack + // Hack. NodePath np; animation->add_track(p_id.type); animation->track_set_path(animation->get_track_count() - 1, p_id.path); @@ -4036,7 +4037,7 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo Dictionary d; d["location"] = tr.origin; d["scale"] = tr.basis.get_scale(); - d["rotation"] = Quat(tr.basis); //.orthonormalized(); + d["rotation"] = Quat(tr.basis); value = d; } break; case Animation::TYPE_BEZIER: { @@ -4061,7 +4062,8 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo if (created) { - //just remove the track + // Just remove the track. + undo_redo->add_undo_method(this, "_clear_selection", false); undo_redo->add_undo_method(animation.ptr(), "remove_track", p_last_track); p_last_track++; } else { @@ -4665,6 +4667,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) { undo_redo->create_action(TTR("Add Track Key")); undo_redo->add_do_method(animation.ptr(), "track_insert_key", p_track, p_ofs, value); + undo_redo->add_undo_method(this, "_clear_selection_for_anim", animation); undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs); undo_redo->commit_action(); @@ -4872,11 +4875,16 @@ void AnimationTrackEditor::_clear_key_edit() { } } -void AnimationTrackEditor::_clear_selection() { +void AnimationTrackEditor::_clear_selection(bool p_update) { + selection.clear(); - for (int i = 0; i < track_edits.size(); i++) { - track_edits[i]->update(); + + if (p_update) { + for (int i = 0; i < track_edits.size(); i++) { + track_edits[i]->update(); + } } + _clear_key_edit(); } @@ -5547,7 +5555,6 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { undo_redo->add_do_method(this, "_clear_selection_for_anim", animation); undo_redo->add_undo_method(this, "_clear_selection_for_anim", animation); undo_redo->commit_action(); - //selection.clear(); _update_key_edit(); } } break; diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 4bc41ab188..830d5b52d3 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -387,7 +387,7 @@ class AnimationTrackEditor : public VBoxContainer { void _insert_key_from_track(float p_ofs, int p_track); void _add_method_key(const String &p_method); - void _clear_selection(); + void _clear_selection(bool p_update = false); void _clear_selection_for_anim(const Ref<Animation> &p_anim); void _select_at_anim(const Ref<Animation> &p_anim, int p_track, float p_pos); diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index 1bb49a4167..e38171eef9 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -616,7 +616,7 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String & if (colorarr.size() >= 3) { - // alpha strangely not allright? maybe it needs to be multiplied by value as a channel intensity + // alpha strangely not alright? maybe it needs to be multiplied by value as a channel intensity Color color(colorarr[0], colorarr[1], colorarr[2], 1.0); if (what == "diffuse") effect.diffuse.color = color; @@ -854,7 +854,7 @@ void Collada::_parse_light(XMLParser &parser) { COLLADA_PRINT("colorarr size: " + rtos(colorarr.size())); if (colorarr.size() >= 4) { - // alpha strangely not allright? maybe it needs to be multiplied by value as a channel intensity + // alpha strangely not alright? maybe it needs to be multiplied by value as a channel intensity Color color(colorarr[0], colorarr[1], colorarr[2], 1.0); light.color = color; } @@ -2297,7 +2297,7 @@ bool Collada::_optimize_skeletons(VisualScene *p_vscene, Node *p_node) { //replace parent by this... Node *parent = node->parent; - //i wonder if this is allright.. i think it is since created skeleton (first joint) is already animated by bone.. + //i wonder if this is alright.. i think it is since created skeleton (first joint) is already animated by bone.. node->id = parent->id; node->name = parent->name; node->xform_list = parent->xform_list; diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index c5b81c4685..cfc2ec11cf 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -529,7 +529,7 @@ void ConnectionsDock::_make_or_edit_connection() { // Pick up args here before "it" is deleted by update_tree. script_function_args = it->get_metadata(0).operator Dictionary()["args"]; for (int i = 0; i < cToMake.binds.size(); i++) { - script_function_args.append("extra_arg_" + itos(i)); + script_function_args.append("extra_arg_" + itos(i) + ":" + Variant::get_type_name(cToMake.binds[i].get_type())); } } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a76d34e122..8d5858a10d 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1046,9 +1046,9 @@ void EditorInspectorSection::_notification(int p_what) { if (foldable) { if (object->editor_is_section_unfolded(section)) { - arrow = get_icon("arrow_up", "Tree"); - } else { arrow = get_icon("arrow", "Tree"); + } else { + arrow = get_icon("arrow_collapsed", "Tree"); } } @@ -1087,9 +1087,9 @@ void EditorInspectorSection::_notification(int p_what) { if (foldable) { if (object->editor_is_section_unfolded(section)) { - arrow = get_icon("arrow_up", "Tree"); - } else { arrow = get_icon("arrow", "Tree"); + } else { + arrow = get_icon("arrow_collapsed", "Tree"); } } @@ -1103,13 +1103,12 @@ void EditorInspectorSection::_notification(int p_what) { draw_rect(Rect2(Vector2(), Vector2(get_size().width, h)), bg_color); - int hs = get_constant("hseparation", "Tree"); - + const int arrow_margin = 3; Color color = get_color("font_color", "Tree"); - draw_string(font, Point2(hs, font->get_ascent() + (h - font->get_height()) / 2).floor(), label, color, get_size().width); + draw_string(font, Point2(Math::round((16 + arrow_margin) * EDSCALE), font->get_ascent() + (h - font->get_height()) / 2).floor(), label, color, get_size().width); if (arrow.is_valid()) { - draw_texture(arrow, Point2(get_size().width - arrow->get_width(), (h - arrow->get_height()) / 2).floor()); + draw_texture(arrow, Point2(Math::round(arrow_margin * EDSCALE), (h - arrow->get_height()) / 2).floor()); } } } diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index b5cdc76115..5474f86c74 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -113,6 +113,10 @@ void EditorLog::add_message(const String &p_msg, MessageType p_type) { log->add_text(" "); tool_button->set_icon(icon); } break; + case MSG_TYPE_EDITOR: { + // Distinguish editor messages from messages printed by the project + log->push_color(get_color("font_color", "Editor") * Color(1, 1, 1, 0.6)); + } break; } log->add_text(p_msg); @@ -128,7 +132,7 @@ void EditorLog::set_tool_button(ToolButton *p_tool_button) { void EditorLog::_undo_redo_cbk(void *p_self, const String &p_name) { EditorLog *self = (EditorLog *)p_self; - self->add_message(p_name); + self->add_message(p_name, EditorLog::MSG_TYPE_EDITOR); } void EditorLog::_bind_methods() { diff --git a/editor/editor_log.h b/editor/editor_log.h index bb56bd34fe..10561b9c83 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -74,7 +74,8 @@ public: enum MessageType { MSG_TYPE_STD, MSG_TYPE_ERROR, - MSG_TYPE_WARNING + MSG_TYPE_WARNING, + MSG_TYPE_EDITOR }; void add_message(const String &p_msg, MessageType p_type = MSG_TYPE_STD); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a1998a1d7c..1d22de7679 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2212,27 +2212,27 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case EDIT_UNDO: { if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { - log->add_message("Can't UNDO while mouse buttons are pressed."); + log->add_message("Can't undo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo().get_current_action_name(); if (!editor_data.get_undo_redo().undo()) { - log->add_message("There is nothing to UNDO."); + log->add_message("Nothing to undo.", EditorLog::MSG_TYPE_EDITOR); } else if (action != "") { - log->add_message("UNDO: " + action); + log->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); } } } break; case EDIT_REDO: { if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { - log->add_message("Can't REDO while mouse buttons are pressed."); + log->add_message("Can't redo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { if (!editor_data.get_undo_redo().redo()) { - log->add_message("There is nothing to REDO."); + log->add_message("Nothing to redo.", EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo().get_current_action_name(); - log->add_message("REDO: " + action); + log->add_message("Redo: " + action, EditorLog::MSG_TYPE_EDITOR); } } } break; diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 5c15ebb1eb..77e9220b6d 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -116,7 +116,7 @@ void EditorResourcePreview::_preview_ready(const String &p_str, const Ref<Textur uint64_t modified_time = 0; if (p_str.begins_with("ID:")) { - hash = p_str.get_slicec(':', 2).to_int(); + hash = uint32_t(p_str.get_slicec(':', 2).to_int64()); path = "ID:" + p_str.get_slicec(':', 1); } else { modified_time = FileAccess::get_modified_time(path); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 823c0242a5..31b21a6273 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -685,7 +685,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Tree theme->set_icon("checked", "Tree", theme->get_icon("GuiChecked", "EditorIcons")); theme->set_icon("unchecked", "Tree", theme->get_icon("GuiUnchecked", "EditorIcons")); - theme->set_icon("arrow_up", "Tree", theme->get_icon("GuiTreeArrowUp", "EditorIcons")); theme->set_icon("arrow", "Tree", theme->get_icon("GuiTreeArrowDown", "EditorIcons")); theme->set_icon("arrow_collapsed", "Tree", theme->get_icon("GuiTreeArrowRight", "EditorIcons")); theme->set_icon("updown", "Tree", theme->get_icon("GuiTreeUpdown", "EditorIcons")); diff --git a/editor/icons/icon_arrow_up.svg b/editor/icons/icon_arrow_up.svg deleted file mode 100644 index 77a20e8c50..0000000000 --- a/editor/icons/icon_arrow_up.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path d="m2.9875 1044.4a1.0001 1.0001 0 0 0 1.7168 0.6972l2.293-2.2929v4.5859a1.0001 1.0001 0 1 0 2 0v-4.5859l2.293 2.2929a1.0001 1.0001 0 1 0 1.4141 -1.414l-3.9141-3.9141a1.0001 1.0001 0 0 0 -1.5859 0 1.0001 1.0001 0 0 0 -0.00391 0.01l-3.9102 3.9102a1.0001 1.0001 0 0 0 -0.30273 0.7168z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/> -</g> -</svg> diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index ecc631d045..18049e62b4 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -5186,7 +5186,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { // The maximum height an object can travel to be snapped const float max_snap_height = 20.0; - // Will be set to `true` if at least one node from the selection was sucessfully snapped + // Will be set to `true` if at least one node from the selection was successfully snapped bool snapped_to_floor = false; if (keys.size()) { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 4d349f06b7..21eebf9ca2 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -625,9 +625,12 @@ void TextureRegionEditor::_update_rect() { rect = node_sprite->get_region_rect(); else if (node_sprite_3d) rect = node_sprite_3d->get_region_rect(); - else if (node_ninepatch) + else if (node_ninepatch) { rect = node_ninepatch->get_region_rect(); - else if (obj_styleBox.is_valid()) + if (rect == Rect2()) { + rect = Rect2(Vector2(), node_ninepatch->get_texture()->get_size()); + } + } else if (obj_styleBox.is_valid()) rect = obj_styleBox->get_region_rect(); else if (atlas_tex.is_valid()) rect = atlas_tex->get_region(); diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index c059977487..e8cd7692b6 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -59,14 +59,6 @@ void VersionControlEditorPlugin::_selected_a_vcs(int p_id) { List<StringName> available_addons = get_available_vcs_names(); const StringName selected_vcs = set_up_choice->get_item_text(p_id); - - if (available_addons.find(selected_vcs) != NULL) { - - set_up_init_button->set_disabled(false); - } else { - - set_up_init_button->set_disabled(true); - } } void VersionControlEditorPlugin::_populate_available_vcs_names() { @@ -75,9 +67,6 @@ void VersionControlEditorPlugin::_populate_available_vcs_names() { if (!called) { - set_up_choice->add_item("Select an available VCS"); - - fetch_available_vcs_addon_names(); List<StringName> available_addons = get_available_vcs_names(); for (int i = 0; i < available_addons.size(); i++) { @@ -95,19 +84,22 @@ VersionControlEditorPlugin *VersionControlEditorPlugin::get_singleton() { void VersionControlEditorPlugin::popup_vcs_set_up_dialog(const Control *p_gui_base) { - Size2 popup_size = Size2(400, 100); - Size2 window_size = p_gui_base->get_viewport_rect().size; - popup_size.x = MIN(window_size.x * 0.5, popup_size.x); - popup_size.y = MIN(window_size.y * 0.5, popup_size.y); + fetch_available_vcs_addon_names(); + List<StringName> available_addons = get_available_vcs_names(); + if (available_addons.size() >= 1) { - if (get_is_vcs_intialized()) { + Size2 popup_size = Size2(400, 100); + Size2 window_size = p_gui_base->get_viewport_rect().size; + popup_size.x = MIN(window_size.x * 0.5, popup_size.x); + popup_size.y = MIN(window_size.y * 0.5, popup_size.y); - set_up_init_button->set_disabled(true); - } + _populate_available_vcs_names(); - _populate_available_vcs_names(); + set_up_dialog->popup_centered_clamped(popup_size * EDSCALE); + } else { - set_up_dialog->popup_centered_clamped(popup_size * EDSCALE); + EditorNode::get_singleton()->show_warning(TTR("No VCS addons are available."), TTR("Error")); + } } void VersionControlEditorPlugin::_initialize_vcs() { @@ -120,7 +112,7 @@ void VersionControlEditorPlugin::_initialize_vcs() { return; } - int id = set_up_choice->get_selected_id(); + const int id = set_up_choice->get_selected_id(); String selected_addon = set_up_choice->get_item_text(id); String path = ScriptServer::get_global_class_path(selected_addon); @@ -381,7 +373,19 @@ void VersionControlEditorPlugin::register_editor() { void VersionControlEditorPlugin::fetch_available_vcs_addon_names() { - ScriptServer::get_global_class_list(&available_addons); + List<StringName> global_classes; + ScriptServer::get_global_class_list(&global_classes); + + for (int i = 0; i != global_classes.size(); i++) { + + String path = ScriptServer::get_global_class_path(global_classes[i]); + Ref<Script> script = ResourceLoader::load(path); + + if (script->get_instance_base_type() == "EditorVCSInterface") { + + available_addons.push_back(global_classes[i]); + } + } } void VersionControlEditorPlugin::clear_stage_area() { @@ -427,7 +431,6 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { version_control_actions->add_child(set_up_dialog); set_up_ok_button = set_up_dialog->get_ok(); - set_up_ok_button->set_disabled(false); set_up_ok_button->set_text(TTR("Close")); set_up_vbc = memnew(VBoxContainer); @@ -454,7 +457,6 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_init_settings = NULL; set_up_init_button = memnew(Button); - set_up_init_button->set_disabled(true); set_up_init_button->set_text(TTR("Initialize")); set_up_init_button->connect("pressed", this, "_initialize_vcs"); set_up_vbc->add_child(set_up_init_button); @@ -564,7 +566,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_heading = memnew(Label); diff_heading->set_text(TTR("Status")); - diff_heading->set_tooltip(TTR("View file diffs before commiting them to the latest version")); + diff_heading->set_tooltip(TTR("View file diffs before committing them to the latest version")); diff_hbc->add_child(diff_heading); diff_file_name = memnew(Label); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 16f1575757..4e0eb260bc 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1504,7 +1504,7 @@ bool SceneTreeDock::_validate_no_foreign() { // When edited_scene inherits from another one the root Node will be the parent Scene, // we don't want to consider that Node a foreign one otherwise we would not be able to - // delete it + // delete it. if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene == E->get()) { continue; } @@ -1528,7 +1528,7 @@ void SceneTreeDock::_node_reparent(NodePath p_path, bool p_keep_global_xform) { List<Node *> selection = editor_selection->get_selected_node_list(); if (selection.empty()) - return; //nothing to reparent + return; // Nothing to reparent. Vector<Node *> nodes; @@ -1544,18 +1544,30 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V Node *new_parent = p_new_parent; ERR_FAIL_COND(!new_parent); + if (p_nodes.size() == 0) + return; // Nothing to reparent. + + bool same_parent = true; + for (int ni = 0; ni < p_nodes.size(); ni++) { + + if (p_nodes[ni] == p_new_parent) + return; // Attempt to reparent to itself. + + if (p_nodes[ni]->get_parent() != p_new_parent) + same_parent = false; + } + + if (same_parent) + return; // No new parent changes. + Node *validate = new_parent; while (validate) { - ERR_FAIL_COND_MSG(p_nodes.find(validate) != -1, "Selection changed at some point.. can't reparent."); + ERR_FAIL_COND_MSG(p_nodes.find(validate) != -1, "Selection changed at some point. Can't reparent."); validate = validate->get_parent(); } - //ok all valid - - if (p_nodes.size() == 0) - return; //nothing to reparent - //sort by tree order, so re-adding is easy + // Sort by tree order, so re-adding is easy. p_nodes.sort_custom<Node::Comparator>(); editor_data->get_undo_redo().create_action(TTR("Reparent Node")); @@ -1567,7 +1579,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V for (int ni = 0; ni < p_nodes.size(); ni++) { - //no undo for now, sorry + // No undo implemented for this yet. Node *node = p_nodes[ni]; fill_path_renames(node, new_parent, &path_renames); @@ -1577,14 +1589,11 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V node->get_owned_by(node->get_owner(), &owned); Array owners; for (List<Node *>::Element *E = owned.front(); E; E = E->next()) { - owners.push_back(E->get()); } - if (new_parent == node->get_parent() && node->get_index() < p_position_in_parent + ni) { - //if child will generate a gap when moved, adjust - inc--; - } + if (new_parent == node->get_parent() && node->get_index() < p_position_in_parent + ni) + inc--; // If the child will generate a gap when moved, adjust. editor_data->get_undo_redo().add_do_method(node->get_parent(), "remove_child", node); editor_data->get_undo_redo().add_do_method(new_parent, "add_child", node); @@ -1596,17 +1605,17 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V String old_name = former_names[ni]; String new_name = new_parent->validate_child_name(node); - // name was modified, fix the path renames + // Name was modified, fix the path renames. if (old_name.casecmp_to(new_name) != 0) { - // Fix the to name to have the new name + // Fix the to name to have the new name. NodePath old_new_name = path_renames[ni].second; NodePath new_path; Vector<StringName> unfixed_new_names = old_new_name.get_names(); Vector<StringName> fixed_new_names; - // Get last name and replace with fixed new name + // Get last name and replace with fixed new name. for (int a = 0; a < (unfixed_new_names.size() - 1); a++) { fixed_new_names.push_back(unfixed_new_names[a]); } @@ -1640,8 +1649,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V inc++; } - //add and move in a second step.. (so old order is preserved) - + // Add and move in a second step (so old order is preserved). for (int ni = 0; ni < p_nodes.size(); ni++) { Node *node = p_nodes[ni]; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index d4a74c83ea..26ca3726f5 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1190,7 +1190,7 @@ void ScriptEditorDebugger::_notification(int p_what) { if (connection.is_null()) break; - EditorNode::get_log()->add_message("** Debug Process Started **"); + EditorNode::get_log()->add_message("--- Debugging process started ---", EditorLog::MSG_TYPE_EDITOR); ppeer->set_stream_peer(connection); @@ -1200,7 +1200,7 @@ void ScriptEditorDebugger::_notification(int p_what) { dobreak->set_disabled(false); tabs->set_current_tab(0); - _set_reason_text(TTR("Child Process Connected"), MESSAGE_SUCCESS); + _set_reason_text(TTR("Child process connected."), MESSAGE_SUCCESS); profiler->clear(); inspect_scene_tree->clear(); @@ -1388,7 +1388,7 @@ void ScriptEditorDebugger::stop() { ppeer->set_stream_peer(Ref<StreamPeer>()); if (connection.is_valid()) { - EditorNode::get_log()->add_message("** Debug Process Stopped **"); + EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR); connection.unref(); reason->set_text(""); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index b4643231d7..c9c1f9c3e0 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -110,7 +110,7 @@ void EditorSettingsDialog::_filter_shortcuts(const String &p_filter) { } void EditorSettingsDialog::_undo_redo_callback(void *p_self, const String &p_name) { - EditorNode::get_log()->add_message(p_name); + EditorNode::get_log()->add_message(p_name, EditorLog::MSG_TYPE_EDITOR); } void EditorSettingsDialog::_notification(int p_what) { @@ -151,7 +151,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { if (ED_IS_SHORTCUT("editor/undo", p_event)) { String action = undo_redo->get_current_action_name(); if (action != "") - EditorNode::get_log()->add_message("UNDO: " + action); + EditorNode::get_log()->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); undo_redo->undo(); handled = true; } @@ -159,7 +159,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { undo_redo->redo(); String action = undo_redo->get_current_action_name(); if (action != "") - EditorNode::get_log()->add_message("REDO: " + action); + EditorNode::get_log()->add_message("Redo: " + action, EditorLog::MSG_TYPE_EDITOR); handled = true; } diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 4c5371769f..27f3b28b49 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -783,9 +783,10 @@ Vector3 EditorSpatialGizmo::get_handle_pos(int p_idx) const { LightSpatialGizmoPlugin::LightSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/light", Color(1, 1, 0.2)); + Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/light", Color(1, 1, 0.7)); - create_material("lines", gizmo_color); + create_material("lines_primary", gizmo_color); + create_material("lines_secondary", gizmo_color * Color(1, 1, 1, 0.35)); create_material("lines_billboard", gizmo_color, true); create_icon_material("light_directional_icon", SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight", "EditorIcons")); @@ -937,7 +938,7 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (Object::cast_to<DirectionalLight>(light)) { - Ref<Material> material = get_material("lines", p_gizmo); + Ref<Material> material = get_material("lines_primary", p_gizmo); Ref<Material> icon = get_material("light_directional_icon", p_gizmo); const int arrow_points = 7; @@ -975,31 +976,39 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (Object::cast_to<OmniLight>(light)) { - Ref<Material> material = get_material("lines_billboard", p_gizmo); - Ref<Material> icon = get_material("light_omni_icon", p_gizmo); + // Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation + const Ref<Material> lines_material = get_material("lines_secondary", p_gizmo); + const Ref<Material> lines_billboard_material = get_material("lines_billboard", p_gizmo); + const Ref<Material> icon = get_material("light_omni_icon", p_gizmo); OmniLight *on = Object::cast_to<OmniLight>(light); - - float r = on->get_param(Light::PARAM_RANGE); - + const float r = on->get_param(Light::PARAM_RANGE); Vector<Vector3> points; + Vector<Vector3> points_billboard; - for (int i = 0; i <= 360; i++) { + for (int i = 0; i < 120; i++) { - float ra = Math::deg2rad((float)i); - float rb = Math::deg2rad((float)i + 1); - Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * r; - Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * r; + // Create a circle + const float ra = Math::deg2rad((float)(i * 3)); + const float rb = Math::deg2rad((float)((i + 1) * 3)); + const Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * r; + const Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * r; - /*points.push_back(Vector3(a.x,0,a.y)); - points.push_back(Vector3(b.x,0,b.y)); - points.push_back(Vector3(0,a.x,a.y)); - points.push_back(Vector3(0,b.x,b.y));*/ + // Draw axis-aligned circles + points.push_back(Vector3(a.x, 0, a.y)); + points.push_back(Vector3(b.x, 0, b.y)); + points.push_back(Vector3(0, a.x, a.y)); + points.push_back(Vector3(0, b.x, b.y)); points.push_back(Vector3(a.x, a.y, 0)); points.push_back(Vector3(b.x, b.y, 0)); + + // Draw a billboarded circle + points_billboard.push_back(Vector3(a.x, a.y, 0)); + points_billboard.push_back(Vector3(b.x, b.y, 0)); } - p_gizmo->add_lines(points, material, true); + p_gizmo->add_lines(points, lines_material, true); + p_gizmo->add_lines(points_billboard, lines_billboard_material, true); p_gizmo->add_unscaled_billboard(icon, 0.05); Vector<Vector3> handles; @@ -1009,40 +1018,44 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (Object::cast_to<SpotLight>(light)) { - Ref<Material> material = get_material("lines", p_gizmo); - Ref<Material> icon = get_material("light_spot_icon", p_gizmo); + const Ref<Material> material_primary = get_material("lines_primary", p_gizmo); + const Ref<Material> material_secondary = get_material("lines_secondary", p_gizmo); + const Ref<Material> icon = get_material("light_spot_icon", p_gizmo); - Vector<Vector3> points; + Vector<Vector3> points_primary; + Vector<Vector3> points_secondary; SpotLight *sl = Object::cast_to<SpotLight>(light); float r = sl->get_param(Light::PARAM_RANGE); float w = r * Math::sin(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE))); float d = r * Math::cos(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE))); - for (int i = 0; i < 360; i++) { - - float ra = Math::deg2rad((float)i); - float rb = Math::deg2rad((float)i + 1); - Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * w; - Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * w; + for (int i = 0; i < 120; i++) { - points.push_back(Vector3(a.x, a.y, -d)); - points.push_back(Vector3(b.x, b.y, -d)); + // Draw a circle + const float ra = Math::deg2rad((float)(i * 3)); + const float rb = Math::deg2rad((float)((i + 1) * 3)); + const Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * w; + const Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * w; - if (i % 90 == 0) { + points_primary.push_back(Vector3(a.x, a.y, -d)); + points_primary.push_back(Vector3(b.x, b.y, -d)); - points.push_back(Vector3(a.x, a.y, -d)); - points.push_back(Vector3()); + if (i % 15 == 0) { + // Draw 8 lines from the cone origin to the sides of the circle + points_secondary.push_back(Vector3(a.x, a.y, -d)); + points_secondary.push_back(Vector3()); } } - points.push_back(Vector3(0, 0, -r)); - points.push_back(Vector3()); + points_primary.push_back(Vector3(0, 0, -r)); + points_primary.push_back(Vector3()); - p_gizmo->add_lines(points, material); + p_gizmo->add_lines(points_primary, material_primary); + p_gizmo->add_lines(points_secondary, material_secondary); - float ra = 16 * Math_PI * 2.0 / 64.0; - Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * w; + const float ra = 16 * Math_PI * 2.0 / 64.0; + const Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * w; Vector<Vector3> handles; handles.push_back(Vector3(0, 0, -r)); diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index a001fe9123..6a95d355eb 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -529,7 +529,7 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim } // -// Mesh Generation from indicies ? why do we need so much mesh code +// Mesh Generation from indices ? why do we need so much mesh code // [debt needs looked into] Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( ImportState &state, diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index f1b3fa2ac6..5a76f32977 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -114,7 +114,7 @@ void CSGBrush::_regen_face_aabbs() { faces.write[i].aabb.position = faces[i].vertices[0]; faces.write[i].aabb.expand_to(faces[i].vertices[1]); faces.write[i].aabb.expand_to(faces[i].vertices[2]); - faces.write[i].aabb.grow_by(faces[i].aabb.get_longest_axis_size() * 0.001); //make it a tad bigger to avoid num precision erros + faces.write[i].aabb.grow_by(faces[i].aabb.get_longest_axis_size() * 0.001); //make it a tad bigger to avoid num precision errors } } diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 7f52f5736c..8a05b6cfa3 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -64,9 +64,9 @@ typedef enum { GODOT_PROPERTY_HINT_LAYERS_3D_RENDER, GODOT_PROPERTY_HINT_LAYERS_3D_PHYSICS, GODOT_PROPERTY_HINT_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc," - GODOT_PROPERTY_HINT_DIR, ///< a directort path must be passed + GODOT_PROPERTY_HINT_DIR, ///< a directory path must be passed GODOT_PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc," - GODOT_PROPERTY_HINT_GLOBAL_DIR, ///< a directort path must be passed + GODOT_PROPERTY_HINT_GLOBAL_DIR, ///< a directory path must be passed GODOT_PROPERTY_HINT_RESOURCE_TYPE, ///< a resource object type GODOT_PROPERTY_HINT_MULTILINE_TEXT, ///< used for string properties that can contain multiple lines GODOT_PROPERTY_HINT_PLACEHOLDER_TEXT, ///< used to set a placeholder text for string properties diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index 9de073fc8e..22898a73ce 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -200,7 +200,7 @@ void PluginScriptLanguage::get_recognized_extensions(List<String> *p_extensions) } void PluginScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) const { - // TODO: provid this statically in `godot_pluginscript_language_desc` ? + // TODO: provide this statically in `godot_pluginscript_language_desc` ? if (_desc.get_public_functions) { Array functions; _desc.get_public_functions(_data, (godot_array *)&functions); @@ -212,7 +212,7 @@ void PluginScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) c } void PluginScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_constants) const { - // TODO: provid this statically in `godot_pluginscript_language_desc` ? + // TODO: provide this statically in `godot_pluginscript_language_desc` ? if (_desc.get_public_constants) { Dictionary constants; _desc.get_public_constants(_data, (godot_dictionary *)&constants); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 5dab063061..c8ec80c101 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -99,7 +99,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco #endif instance->owner->set_script_instance(instance); - /* STEP 2, INITIALIZE AND CONSRTUCT */ + /* STEP 2, INITIALIZE AND CONSTRUCT */ #ifndef NO_THREADS GDScriptLanguage::singleton->lock->lock(); diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 9ea6b0e863..dea2225e91 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2072,7 +2072,7 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa } instance->owner->set_script_instance(instance); - /* STEP 2, INITIALIZE AND CONSRTUCT */ + /* STEP 2, INITIALIZE AND CONSTRUCT */ Variant::CallError ce; p_script->initializer->call(instance, NULL, 0, ce); diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 8998b51fa1..8bb053b2bc 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1207,7 +1207,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s if (_get_completable_identifier(COMPLETION_INDEX, identifier)) { if (identifier == StringName()) { - identifier = "@temp"; //so it parses allright + identifier = "@temp"; //so it parses alright } completion_node = op; diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp index 9bea4557ac..62c212a2bd 100644 --- a/modules/gdscript/language_server/gdscript_language_server.cpp +++ b/modules/gdscript/language_server/gdscript_language_server.cpp @@ -64,7 +64,7 @@ void GDScriptLanguageServer::thread_main(void *p_userdata) { void GDScriptLanguageServer::start() { int port = (int)_EDITOR_GET("network/language_server/remote_port"); if (protocol.start(port) == OK) { - EditorNode::get_log()->add_message("** GDScript Language Server Started **"); + EditorNode::get_log()->add_message("--- GDScript language server started ---", EditorLog::MSG_TYPE_EDITOR); ERR_FAIL_COND(thread != NULL || thread_exit); thread_exit = false; thread = Thread::create(GDScriptLanguageServer::thread_main, this); @@ -78,7 +78,7 @@ void GDScriptLanguageServer::stop() { memdelete(thread); thread = NULL; protocol.stop(); - EditorNode::get_log()->add_message("** GDScript Language Server Stopped **"); + EditorNode::get_log()->add_message("--- GDScript language server stopped ---", EditorLog::MSG_TYPE_EDITOR); } void register_lsp_types() { diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 97b2e4f138..7e2986ca85 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1075,6 +1075,7 @@ void GridMapEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { + get_tree()->connect("node_removed", this, "_node_removed"); mesh_library_palette->connect("item_selected", this, "_item_selected_cbk"); for (int i = 0; i < 3; i++) { @@ -1091,6 +1092,7 @@ void GridMapEditor::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { + get_tree()->disconnect("node_removed", this, "_node_removed"); _clear_clipboard_data(); for (int i = 0; i < 3; i++) { @@ -1204,6 +1206,7 @@ void GridMapEditor::_bind_methods() { ClassDB::bind_method("_floor_changed", &GridMapEditor::_floor_changed); ClassDB::bind_method("_floor_mouse_exited", &GridMapEditor::_floor_mouse_exited); ClassDB::bind_method("_set_selection", &GridMapEditor::_set_selection); + ClassDB::bind_method("_node_removed", &GridMapEditor::_node_removed); ClassDB::bind_method(D_METHOD("_set_display_mode", "mode"), &GridMapEditor::_set_display_mode); } diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 1888bb3cb9..74710db224 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -1785,6 +1785,9 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { output.append("uint32_t get_bindings_version() { return "); output.append(String::num_uint64(BINDINGS_GENERATOR_VERSION) + "; }\n"); + output.append("uint32_t get_cs_glue_version() { return "); + output.append(String::num_uint64(CS_GLUE_VERSION) + "; }\n"); + output.append("\nvoid register_generated_icalls() " OPEN_BLOCK); output.append("\tgodot_register_glue_header_icalls();\n"); diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index cd111abd4d..915a01af7e 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -44,7 +44,6 @@ #include "core/project_settings.h" #include "../csharp_script.h" -#include "../glue/cs_glue_version.gen.h" #include "../godotsharp_dirs.h" #include "../utils/path_utils.h" #include "gd_mono_class.h" @@ -395,23 +394,24 @@ uint64_t get_core_api_hash(); uint64_t get_editor_api_hash(); #endif uint32_t get_bindings_version(); +uint32_t get_cs_glue_version(); void register_generated_icalls(); #else uint64_t get_core_api_hash() { - CRASH_NOW(); GD_UNREACHABLE(); } #ifdef TOOLS_ENABLED uint64_t get_editor_api_hash() { - CRASH_NOW(); GD_UNREACHABLE(); } #endif uint32_t get_bindings_version() { - CRASH_NOW(); + GD_UNREACHABLE(); +} +uint32_t get_cs_glue_version() { GD_UNREACHABLE(); } @@ -687,7 +687,7 @@ bool GDMono::_load_core_api_assembly() { APIAssembly::Version api_assembly_ver = APIAssembly::Version::get_from_loaded_assembly(core_api_assembly, APIAssembly::API_CORE); core_api_assembly_out_of_sync = GodotSharpBindings::get_core_api_hash() != api_assembly_ver.godot_api_hash || GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version || - CS_GLUE_VERSION != api_assembly_ver.cs_glue_version; + GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version; if (!core_api_assembly_out_of_sync) { GDMonoUtils::update_godot_api_cache(); @@ -722,7 +722,7 @@ bool GDMono::_load_editor_api_assembly() { APIAssembly::Version api_assembly_ver = APIAssembly::Version::get_from_loaded_assembly(editor_api_assembly, APIAssembly::API_EDITOR); editor_api_assembly_out_of_sync = GodotSharpBindings::get_editor_api_hash() != api_assembly_ver.godot_api_hash || GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version || - CS_GLUE_VERSION != api_assembly_ver.cs_glue_version; + GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version; } else { editor_api_assembly_out_of_sync = false; } diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1c4450c0c3..567f7e7b09 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1474,8 +1474,8 @@ public: if (use_remote) { if (use_reverse) { - static const char *const msg = "** Device API >= 21; debugging over USB **"; - EditorNode::get_singleton()->get_log()->add_message(msg); + static const char *const msg = "--- Device API >= 21; debugging over USB ---"; + EditorNode::get_singleton()->get_log()->add_message(msg, EditorLog::MSG_TYPE_EDITOR); print_line(String(msg).to_upper()); args.clear(); @@ -1515,8 +1515,8 @@ public: } } else { - static const char *const msg = "** Device API < 21; debugging over Wi-Fi **"; - EditorNode::get_singleton()->get_log()->add_message(msg); + static const char *const msg = "--- Device API < 21; debugging over Wi-Fi ---"; + EditorNode::get_singleton()->get_log()->add_message(msg, EditorLog::MSG_TYPE_EDITOR); print_line(String(msg).to_upper()); } } diff --git a/platform/windows/camera_win.cpp b/platform/windows/camera_win.cpp index b97796fe89..10787d0d0a 100644 --- a/platform/windows/camera_win.cpp +++ b/platform/windows/camera_win.cpp @@ -30,9 +30,12 @@ #include "camera_win.h" -///@TODO sorry guys, I got about 80% through implementing this using DirectShow only to find out Microsoft deprecated half the API and its replacement is as confusing as they could make it -// Joey suggested looking into libuvc which offers a more direct route to webcams over USB and this is very promissing but it wouldn't compile on windows for me... -// I've gutted the classes I implemented DirectShow in just to have a skeleton for someone to work on, mail me for more details or if you want a copy.... +///@TODO sorry guys, I got about 80% through implementing this using DirectShow only +// to find out Microsoft deprecated half the API and its replacement is as confusing +// as they could make it. Joey suggested looking into libuvc which offers a more direct +// route to webcams over USB and this is very promising but it wouldn't compile on +// windows for me...I've gutted the classes I implemented DirectShow in just to have +// a skeleton for someone to work on, mail me for more details or if you want a copy.... ////////////////////////////////////////////////////////////////////////// // CameraFeedWindows - Subclass for our camera feed on windows @@ -69,7 +72,8 @@ bool CameraFeedWindows::activate_feed() { return true; }; -///@TODO we should probably have a callback method here that is being called by the camera API which provides frames and call back into the CameraServer to update our texture +///@TODO we should probably have a callback method here that is being called by the +// camera API which provides frames and call back into the CameraServer to update our texture void CameraFeedWindows::deactivate_feed(){ ///@TODO this should deactivate our camera and stop the process of capturing frames diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 9fe5fb98b6..6436b3878f 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -155,7 +155,7 @@ void LineBuilder::build() { texture_mode == Line2D::LINE_TEXTURE_STRETCH; if (distance_required) { total_distance = calculate_total_distance(points); - //Ajust totalDistance. + //Adjust totalDistance. // The line's outer length will be a little higher due to begin and end caps if (begin_cap_mode == Line2D::LINE_CAP_BOX || begin_cap_mode == Line2D::LINE_CAP_ROUND) { if (retrieve_curve) diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 9b6020e0fd..28f7243c44 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -1209,7 +1209,7 @@ bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, bool p_infinite_ return colliding; } -//so, if you pass 45 as limit, avoid numerical precision erros when angle is 45. +//so, if you pass 45 as limit, avoid numerical precision errors when angle is 45. #define FLOOR_ANGLE_THRESHOLD 0.01 Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) { diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 0756be5fc8..8db1e883e6 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -1137,7 +1137,7 @@ bool KinematicBody::move_and_collide(const Vector3 &p_motion, bool p_infinite_in return colliding; } -//so, if you pass 45 as limit, avoid numerical precision erros when angle is 45. +//so, if you pass 45 as limit, avoid numerical precision errors when angle is 45. #define FLOOR_ANGLE_THRESHOLD 0.01 Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) { diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 0f7d4466c8..1f9793190d 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -191,7 +191,7 @@ void Tween::_notification(int p_what) { case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { // Are we processing during 'regular' time? if (tween_process_mode == TWEEN_PROCESS_IDLE) - // Do nothing since we whould only process during idle time + // Do nothing since we would only process during idle time break; // Should we update? diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 174c2fce7d..d39f017cad 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -818,7 +818,7 @@ Size2 Control::get_minimum_size() const { Ref<Texture> Control::get_icon(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const Ref<Texture> *tex = data.icon_override.getptr(p_name); if (tex) @@ -860,7 +860,7 @@ Ref<Texture> Control::get_icon(const StringName &p_name, const StringName &p_typ } Ref<Shader> Control::get_shader(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const Ref<Shader> *sdr = data.shader_override.getptr(p_name); if (sdr) @@ -903,7 +903,7 @@ Ref<Shader> Control::get_shader(const StringName &p_name, const StringName &p_ty Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const Ref<StyleBox> *style = data.style_override.getptr(p_name); if (style) return *style; @@ -949,7 +949,7 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & } Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const Ref<Font> *font = data.font_override.getptr(p_name); if (font) return *font; @@ -986,7 +986,7 @@ Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) } Color Control::get_color(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const Color *color = data.color_override.getptr(p_name); if (color) return *color; @@ -1026,7 +1026,7 @@ Color Control::get_color(const StringName &p_name, const StringName &p_type) con int Control::get_constant(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { const int *constant = data.constant_override.getptr(p_name); if (constant) return *constant; @@ -1102,7 +1102,7 @@ bool Control::has_constant_override(const StringName &p_name) const { bool Control::has_icon(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_icon_override(p_name)) return true; } @@ -1141,7 +1141,7 @@ bool Control::has_icon(const StringName &p_name, const StringName &p_type) const bool Control::has_shader(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_shader_override(p_name)) return true; } @@ -1179,7 +1179,7 @@ bool Control::has_shader(const StringName &p_name, const StringName &p_type) con } bool Control::has_stylebox(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_stylebox_override(p_name)) return true; } @@ -1217,7 +1217,7 @@ bool Control::has_stylebox(const StringName &p_name, const StringName &p_type) c } bool Control::has_font(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_font_override(p_name)) return true; } @@ -1256,7 +1256,7 @@ bool Control::has_font(const StringName &p_name, const StringName &p_type) const bool Control::has_color(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_color_override(p_name)) return true; } @@ -1295,7 +1295,7 @@ bool Control::has_color(const StringName &p_name, const StringName &p_type) cons bool Control::has_constant(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == "") { + if (p_type == StringName() || p_type == get_class_name()) { if (has_constant_override(p_name)) return true; } diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 59bbdad97a..9ed1d2bf45 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -35,6 +35,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_node.h" +#include "scene/main/viewport.h" // Only used to check for more modals when dimming the editor. #endif // WindowDialog @@ -59,7 +60,7 @@ void WindowDialog::_fix_size() { float left = 0; float bottom = 0; float right = 0; - // Check validity, because the theme could contain a different type of StyleBox + // Check validity, because the theme could contain a different type of StyleBox. if (panel->get_class() == "StyleBoxTexture") { Ref<StyleBoxTexture> panel_texture = Object::cast_to<StyleBoxTexture>(*panel); top = panel_texture->get_expand_margin_size(MARGIN_TOP); @@ -242,7 +243,7 @@ void WindowDialog::_notification(int p_what) { } break; case NOTIFICATION_POPUP_HIDE: { - if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) + if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !get_viewport()->gui_has_modal_stack()) EditorNode::get_singleton()->dim_editor(false); } break; #endif diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5173b83407..9678ebe6ea 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -647,7 +647,7 @@ void TextEdit::_notification(int p_what) { if (scrolling && get_v_scroll() != target_v_scroll) { double target_y = target_v_scroll - get_v_scroll(); double dist = sqrt(target_y * target_y); - // To ensure minimap is responsive overide the speed setting. + // To ensure minimap is responsive override the speed setting. double vel = ((target_y / dist) * ((minimap_clicked) ? 3000 : v_scroll_speed)) * get_physics_process_delta_time(); if (Math::abs(vel) >= dist) { @@ -6282,7 +6282,7 @@ void TextEdit::_confirm_completion() { CharType last_completion_char = completion_current.insert_text[completion_current.insert_text.length() - 1]; if ((last_completion_char == '"' || last_completion_char == '\'') && last_completion_char == next_char) { - _base_remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); + _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); } if (last_completion_char == '(') { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index e78018b4bc..57663bbe82 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -328,7 +328,7 @@ void TreeItem::set_collapsed(bool p_collapsed) { ci = ci->parent; } - if (ci) { // collapsing cursor/selectd, move it! + if (ci) { // collapsing cursor/selected, move it! if (tree->select_mode == Tree::SELECT_MULTI) { diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 0863d5c2e3..f515af4d91 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -461,7 +461,7 @@ void VisualServerViewport::viewport_set_render_direct_to_screen(RID p_viewport, VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN, p_enable); viewport->viewport_render_direct_to_screen = p_enable; - // if attached to screen already, setup screen size and position, this needs to happen after setting flag to avoid an unneccesary buffer allocation + // if attached to screen already, setup screen size and position, this needs to happen after setting flag to avoid an unnecessary buffer allocation if (VSG::rasterizer->is_low_end() && viewport->viewport_to_screen_rect != Rect2() && p_enable) { VSG::storage->render_target_set_size(viewport->render_target, viewport->viewport_to_screen_rect.size.x, viewport->viewport_to_screen_rect.size.y); |