diff options
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 7 | ||||
-rw-r--r-- | scene/2d/camera_2d.cpp | 6 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 713ad3ed17..ed2dce471f 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3602,6 +3602,7 @@ bool GDScriptParser::tool_annotation(const AnnotationNode *p_annotation, Node *p bool GDScriptParser::icon_annotation(const AnnotationNode *p_annotation, Node *p_node) { ERR_FAIL_COND_V_MSG(p_node->type != Node::CLASS, false, R"("@icon" annotation can only be applied to classes.)"); + ERR_FAIL_COND_V(p_annotation->resolved_arguments.is_empty(), false); ClassNode *p_class = static_cast<ClassNode *>(p_node); p_class->icon_path = p_annotation->resolved_arguments[0]; return true; @@ -3830,6 +3831,10 @@ template <PropertyUsageFlags t_usage> bool GDScriptParser::export_group_annotations(const AnnotationNode *p_annotation, Node *p_node) { AnnotationNode *annotation = const_cast<AnnotationNode *>(p_annotation); + if (annotation->resolved_arguments.is_empty()) { + return false; + } + annotation->export_info.name = annotation->resolved_arguments[0]; switch (t_usage) { @@ -3887,7 +3892,7 @@ bool GDScriptParser::rpc_annotation(const AnnotationNode *p_annotation, Node *p_ Dictionary rpc_config; rpc_config["rpc_mode"] = MultiplayerAPI::RPC_MODE_AUTHORITY; - if (p_annotation->resolved_arguments.size()) { + if (!p_annotation->resolved_arguments.is_empty()) { int last = p_annotation->resolved_arguments.size() - 1; if (p_annotation->resolved_arguments[last].get_type() == Variant::INT) { rpc_config["channel"] = p_annotation->resolved_arguments[last].operator int(); diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 49c5501e77..fe6bee0f1b 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -250,7 +250,7 @@ void Camera2D::_notification(int p_what) { add_to_group(group_name); add_to_group(canvas_group_name); - if (enabled && !viewport->get_camera_2d()) { + if (!Engine::get_singleton()->is_editor_hint() && enabled && !viewport->get_camera_2d()) { make_current(); } @@ -260,11 +260,11 @@ void Camera2D::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { + remove_from_group(group_name); + remove_from_group(canvas_group_name); if (is_current()) { clear_current(); } - remove_from_group(group_name); - remove_from_group(canvas_group_name); viewport = nullptr; } break; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index dba08e16cb..16a718722c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -84,6 +84,7 @@ void LineEdit::_move_caret_left(bool p_select, bool p_move_by_word) { } shift_selection_check_post(p_select); + _reset_caret_blink_timer(); } void LineEdit::_move_caret_right(bool p_select, bool p_move_by_word) { @@ -116,6 +117,7 @@ void LineEdit::_move_caret_right(bool p_select, bool p_move_by_word) { } shift_selection_check_post(p_select); + _reset_caret_blink_timer(); } void LineEdit::_move_caret_start(bool p_select) { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index c31155bd5c..b0898e2239 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1061,10 +1061,10 @@ void Viewport::assign_next_enabled_camera_2d(const StringName &p_camera_group) { get_tree()->get_nodes_in_group(p_camera_group, &camera_list); Camera2D *new_camera = nullptr; - for (const Node *E : camera_list) { - const Camera2D *cam = Object::cast_to<Camera2D>(E); + for (Node *E : camera_list) { + Camera2D *cam = Object::cast_to<Camera2D>(E); if (cam->is_enabled()) { - new_camera = const_cast<Camera2D *>(cam); + new_camera = cam; break; } } |