diff options
| -rw-r--r-- | SConstruct | 11 | ||||
| -rw-r--r-- | doc/classes/Animation.xml | 2 | ||||
| -rw-r--r-- | doc/classes/EditorImportPlugin.xml | 8 | ||||
| -rw-r--r-- | doc/classes/Object.xml | 2 | ||||
| -rw-r--r-- | doc/classes/VisibleOnScreenNotifier2D.xml | 2 | ||||
| -rw-r--r-- | doc/classes/VisibleOnScreenNotifier3D.xml | 2 | ||||
| -rw-r--r-- | editor/gui/scene_tree_editor.cpp | 14 | ||||
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 10 | ||||
| -rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 38 | ||||
| -rw-r--r-- | scene/resources/animation.cpp | 7 | ||||
| -rw-r--r-- | scene/resources/animation.h | 1 |
12 files changed, 45 insertions, 54 deletions
diff --git a/SConstruct b/SConstruct index a1f28b1fc6..0ae8f1a387 100644 --- a/SConstruct +++ b/SConstruct @@ -1011,11 +1011,12 @@ if env["vsproj"]: env.vs_incs = [] env.vs_srcs = [] -if env["compiledb"] and env.scons_version < (4, 0, 0): - # Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later. - print_error("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version) - Exit(255) -if env.scons_version >= (4, 0, 0): +if env["compiledb"]: + if env.scons_version < (4, 0, 0): + # Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later. + print_error("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version) + Exit(255) + env.Tool("compilation_db") env.Alias("compiledb", env.CompilationDatabase()) diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 80fd52c684..942299cc7e 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -599,7 +599,7 @@ </method> </methods> <members> - <member name="capture_included" type="bool" setter="_set_capture_included" getter="is_capture_included" default="false"> + <member name="capture_included" type="bool" setter="" getter="is_capture_included" default="false"> Returns [code]true[/code] if the capture track is included. This is a cached readonly value for performance. </member> <member name="length" type="float" setter="set_length" getter="get_length" default="1.0"> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index 88a6eeec26..28614b6631 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -98,18 +98,18 @@ }; } - public override int _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array<string> platformVariants, Godot.Collections.Array<string> genFiles) + public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array<string> platformVariants, Godot.Collections.Array<string> genFiles) { using var file = FileAccess.Open(sourceFile, FileAccess.ModeFlags.Read); if (file.GetError() != Error.Ok) { - return (int)Error.Failed; + return Error.Failed; } var mesh = new ArrayMesh(); // Fill the Mesh with data read in "file", left as an exercise to the reader. string filename = $"{savePath}.{_GetSaveExtension()}"; - return (int)ResourceSaver.Save(mesh, filename); + return ResourceSaver.Save(mesh, filename); } } [/csharp] @@ -241,7 +241,7 @@ <param index="2" name="custom_importer" type="String" default="""" /> <param index="3" name="generator_parameters" type="Variant" default="null" /> <description> - This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] ca be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters[/code] in the [code]remap[/code] section of the [code].import[/code] file, for example to store a md5 hash of the source data. + This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters[/code] in the [code]remap[/code] section of the [code].import[/code] file, for example to store a md5 hash of the source data. </description> </method> </methods> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index eecb3ca525..ed420f4587 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -341,7 +341,7 @@ public override void _ValidateProperty(Godot.Collections.Dictionary property) { - if (property["name"].AsStringName() == PropertyName.Number && IsNumberEditable) + if (property["name"].AsStringName() == PropertyName.Number && !IsNumberEditable) { var usage = property["usage"].As<PropertyUsageFlags>() | PropertyUsageFlags.ReadOnly; property["usage"] = (int)usage; diff --git a/doc/classes/VisibleOnScreenNotifier2D.xml b/doc/classes/VisibleOnScreenNotifier2D.xml index cf4a0c0018..418abb6d17 100644 --- a/doc/classes/VisibleOnScreenNotifier2D.xml +++ b/doc/classes/VisibleOnScreenNotifier2D.xml @@ -4,7 +4,7 @@ A rectangular region of 2D space that detects whether it is visible on screen. </brief_description> <description> - [VisibleOnScreenEnabler2D] represents a rectangular region of 2D space. When any part of this region becomes visible on screen or in a viewport, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible. + [VisibleOnScreenNotifier2D] represents a rectangular region of 2D space. When any part of this region becomes visible on screen or in a viewport, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible. If you want a node to be enabled automatically when this region is visible on screen, use [VisibleOnScreenEnabler2D]. [b]Note:[/b] [VisibleOnScreenNotifier2D] uses the render culling code to determine whether it's visible on screen, so it won't function unless [member CanvasItem.visible] is set to [code]true[/code]. </description> diff --git a/doc/classes/VisibleOnScreenNotifier3D.xml b/doc/classes/VisibleOnScreenNotifier3D.xml index 38d55cd331..ce8a4b398d 100644 --- a/doc/classes/VisibleOnScreenNotifier3D.xml +++ b/doc/classes/VisibleOnScreenNotifier3D.xml @@ -4,7 +4,7 @@ A box-shaped region of 3D space that detects whether it is visible on screen. </brief_description> <description> - [VisibleOnScreenEnabler3D] represents a box-shaped region of 3D space. When any part of this region becomes visible on screen or in a [Camera3D]'s view, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible. + [VisibleOnScreenNotifier3D] represents a box-shaped region of 3D space. When any part of this region becomes visible on screen or in a [Camera3D]'s view, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible. If you want a node to be enabled automatically when this region is visible on screen, use [VisibleOnScreenEnabler3D]. [b]Note:[/b] [VisibleOnScreenNotifier3D] uses an approximate heuristic that doesn't take walls and other occlusion into account, unless occlusion culling is used. It also won't function unless [member Node3D.visible] is set to [code]true[/code]. </description> diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index a3e62c298f..c6cc0e97dd 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -398,6 +398,13 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->set_button_color(0, item->get_button_count(0) - 1, button_color); } + if (p_node->has_meta("_edit_lock_")) { + item->add_button(0, get_editor_theme_icon(SNAME("Lock")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); + } + if (p_node->has_meta("_edit_group_")) { + item->add_button(0, get_editor_theme_icon(SNAME("Group")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable.")); + } + if (p_node->has_method("is_visible") && p_node->has_method("set_visible") && p_node->has_signal(SceneStringName(visibility_changed))) { bool is_visible = p_node->call("is_visible"); if (is_visible) { @@ -412,13 +419,6 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { _update_visibility_color(p_node, item); } - if (p_node->has_meta("_edit_lock_")) { - item->add_button(0, get_editor_theme_icon(SNAME("Lock")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); - } - if (p_node->has_meta("_edit_group_")) { - item->add_button(0, get_editor_theme_icon(SNAME("Group")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable.")); - } - if (p_node->is_class("AnimationMixer")) { bool is_pinned = AnimationPlayerEditor::get_singleton()->get_editing_node() == p_node && AnimationPlayerEditor::get_singleton()->is_pinned(); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index f64c4532a1..660e4647a1 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1295,7 +1295,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_timeline_o } pos = CLAMP(pos, 0, (double)anim->get_length() - CMP_EPSILON2); // Hack: Avoid fposmod with LOOP_LINEAR. - if (!p_timeline_only && anim.is_valid()) { + if (!p_timeline_only && anim.is_valid() && (!player->is_valid() || !Math::is_equal_approx(pos, player->get_current_animation_position()))) { player->seek_internal(pos, true, true, false); } diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 6eb35c9ac1..3b6526ffd9 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -155,15 +155,7 @@ void GDScriptCache::move_script(const String &p_from, const String &p_to) { return; } - if (singleton->parser_map.has(p_from) && !p_from.is_empty()) { - singleton->parser_map[p_to] = singleton->parser_map[p_from]; - } - singleton->parser_map.erase(p_from); - - if (singleton->parser_inverse_dependencies.has(p_from) && !p_from.is_empty()) { - singleton->parser_inverse_dependencies[p_to] = singleton->parser_inverse_dependencies[p_from]; - } - singleton->parser_inverse_dependencies.erase(p_from); + remove_parser(p_from); if (singleton->shallow_gdscript_cache.has(p_from) && !p_from.is_empty()) { singleton->shallow_gdscript_cache[p_to] = singleton->shallow_gdscript_cache[p_from]; diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index dea8bae438..975d384bad 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -1263,23 +1263,25 @@ void WaylandThread::_wl_seat_on_capabilities(void *data, struct wl_seat *wl_seat // Pointer handling. if (capabilities & WL_SEAT_CAPABILITY_POINTER) { - ss->cursor_surface = wl_compositor_create_surface(ss->registry->wl_compositor); - wl_surface_commit(ss->cursor_surface); + if (!ss->wl_pointer) { + ss->cursor_surface = wl_compositor_create_surface(ss->registry->wl_compositor); + wl_surface_commit(ss->cursor_surface); - ss->wl_pointer = wl_seat_get_pointer(wl_seat); - wl_pointer_add_listener(ss->wl_pointer, &wl_pointer_listener, ss); + ss->wl_pointer = wl_seat_get_pointer(wl_seat); + wl_pointer_add_listener(ss->wl_pointer, &wl_pointer_listener, ss); - if (ss->registry->wp_relative_pointer_manager) { - ss->wp_relative_pointer = zwp_relative_pointer_manager_v1_get_relative_pointer(ss->registry->wp_relative_pointer_manager, ss->wl_pointer); - zwp_relative_pointer_v1_add_listener(ss->wp_relative_pointer, &wp_relative_pointer_listener, ss); - } + if (ss->registry->wp_relative_pointer_manager) { + ss->wp_relative_pointer = zwp_relative_pointer_manager_v1_get_relative_pointer(ss->registry->wp_relative_pointer_manager, ss->wl_pointer); + zwp_relative_pointer_v1_add_listener(ss->wp_relative_pointer, &wp_relative_pointer_listener, ss); + } - if (ss->registry->wp_pointer_gestures) { - ss->wp_pointer_gesture_pinch = zwp_pointer_gestures_v1_get_pinch_gesture(ss->registry->wp_pointer_gestures, ss->wl_pointer); - zwp_pointer_gesture_pinch_v1_add_listener(ss->wp_pointer_gesture_pinch, &wp_pointer_gesture_pinch_listener, ss); - } + if (ss->registry->wp_pointer_gestures) { + ss->wp_pointer_gesture_pinch = zwp_pointer_gestures_v1_get_pinch_gesture(ss->registry->wp_pointer_gestures, ss->wl_pointer); + zwp_pointer_gesture_pinch_v1_add_listener(ss->wp_pointer_gesture_pinch, &wp_pointer_gesture_pinch_listener, ss); + } - // TODO: Constrain new pointers if the global mouse mode is constrained. + // TODO: Constrain new pointers if the global mouse mode is constrained. + } } else { if (ss->cursor_frame_callback) { // Just in case. I got bitten by weird race-like conditions already. @@ -1317,11 +1319,13 @@ void WaylandThread::_wl_seat_on_capabilities(void *data, struct wl_seat *wl_seat // Keyboard handling. if (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) { - ss->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); - ERR_FAIL_NULL(ss->xkb_context); + if (!ss->wl_keyboard) { + ss->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + ERR_FAIL_NULL(ss->xkb_context); - ss->wl_keyboard = wl_seat_get_keyboard(wl_seat); - wl_keyboard_add_listener(ss->wl_keyboard, &wl_keyboard_listener, ss); + ss->wl_keyboard = wl_seat_get_keyboard(wl_seat); + wl_keyboard_add_listener(ss->wl_keyboard, &wl_keyboard_listener, ss); + } } else { if (ss->xkb_context) { xkb_context_unref(ss->xkb_context); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index c0ab636adc..e00bf56939 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -969,10 +969,6 @@ void Animation::remove_track(int p_track) { _check_capture_included(); } -void Animation::set_capture_included(bool p_capture_included) { - capture_included = p_capture_included; -} - bool Animation::is_capture_included() const { return capture_included; } @@ -3908,13 +3904,12 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("compress", "page_size", "fps", "split_tolerance"), &Animation::compress, DEFVAL(8192), DEFVAL(120), DEFVAL(4.0)); - ClassDB::bind_method(D_METHOD("_set_capture_included", "capture_included"), &Animation::set_capture_included); ClassDB::bind_method(D_METHOD("is_capture_included"), &Animation::is_capture_included); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001,suffix:s"), "set_length", "get_length"); ADD_PROPERTY(PropertyInfo(Variant::INT, "loop_mode", PROPERTY_HINT_ENUM, "None,Linear,Ping-Pong"), "set_loop_mode", "get_loop_mode"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step", PROPERTY_HINT_RANGE, "0,4096,0.001,suffix:s"), "set_step", "get_step"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "capture_included", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_READ_ONLY | PROPERTY_USAGE_NO_EDITOR), "_set_capture_included", "is_capture_included"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "capture_included", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "", "is_capture_included"); BIND_ENUM_CONSTANT(TYPE_VALUE); BIND_ENUM_CONSTANT(TYPE_POSITION_3D); diff --git a/scene/resources/animation.h b/scene/resources/animation.h index d5daaac58a..9e6d34959a 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -396,7 +396,6 @@ public: int add_track(TrackType p_type, int p_at_pos = -1); void remove_track(int p_track); - void set_capture_included(bool p_capture_included); bool is_capture_included() const; int get_track_count() const; |
