diff options
-rw-r--r-- | COPYRIGHT.txt | 2 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 13 | ||||
-rw-r--r-- | doc/classes/Node2D.xml | 10 | ||||
-rw-r--r-- | editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 2 | ||||
-rw-r--r-- | editor/project_manager.cpp | 3 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 5 | ||||
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | 6 | ||||
-rw-r--r-- | platform/macos/export/export_plugin.cpp | 2 | ||||
-rw-r--r-- | scene/2d/node_2d.cpp | 46 | ||||
-rw-r--r-- | scene/2d/node_2d.h | 12 | ||||
-rw-r--r-- | scene/gui/control.cpp | 12 | ||||
-rw-r--r-- | scene/main/canvas_item.cpp | 48 | ||||
-rw-r--r-- | scene/main/canvas_item.h | 15 | ||||
-rw-r--r-- | thirdparty/README.md | 2 | ||||
-rw-r--r-- | thirdparty/miniupnpc/LICENSE | 39 | ||||
-rw-r--r-- | thirdparty/miniupnpc/include/miniupnpc.h | 8 | ||||
-rw-r--r-- | thirdparty/miniupnpc/src/miniupnpcstrings.h | 2 | ||||
-rw-r--r-- | thirdparty/miniupnpc/src/minixml.c | 2 |
20 files changed, 128 insertions, 112 deletions
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 2dc58158ef..02cd733c92 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -293,7 +293,7 @@ License: CC0-1.0 Files: ./thirdparty/miniupnpc/ Comment: MiniUPnP Project -Copyright: 2005-2021, Thomas Bernard +Copyright: 2005-2022, Thomas Bernard License: BSD-3-clause Files: ./thirdparty/minizip/ diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 50bbbc71a0..499d53e63c 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -510,7 +510,7 @@ <method name="move_to_front"> <return type="void" /> <description> - Moves this node to display on top of its siblings. This has more use in [Control], as [Node2D] can be ordered with [member Node2D.z_index]. + Moves this node to display on top of its siblings. Internally, the node is moved to the bottom of parent's children list. The method has no effect on nodes without a parent. </description> </method> @@ -587,6 +587,17 @@ If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). [b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. </member> + <member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false"> + If [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled. Y-sorting only affects children that inherit from [CanvasItem]. + You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree. + </member> + <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true"> + If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. + </member> + <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0"> + Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). + [b]Note:[/b] Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others. + </member> </members> <signals> <signal name="draw"> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 054ab532af..26efe37dce 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -125,15 +125,5 @@ <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform"> Local [Transform2D]. </member> - <member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false"> - If [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled. Y-sorting only affects children that inherit from [CanvasItem]. - You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree. - </member> - <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true"> - If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. - </member> - <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0"> - Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). - </member> </members> </class> diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d00a64f796..06e1e8b22e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2274,7 +2274,9 @@ void EditorNode::_edit_current(bool p_skip_foreign) { } else { Node *selected_node = nullptr; - if (current_obj->is_class("MultiNodeEdit")) { + if (current_obj->is_class("EditorDebuggerRemoteObject")) { + disable_folding = true; + } else if (current_obj->is_class("MultiNodeEdit")) { Node *scene = get_edited_scene(); if (scene) { MultiNodeEdit *multi_node_edit = Object::cast_to<MultiNodeEdit>(current_obj); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 8cb9a6712d..c08c9a83a7 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5596,7 +5596,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String & // make visible for certain node type if (Object::cast_to<Control>(child)) { Size2 texture_size = texture->get_size(); - undo_redo->add_do_property(child, "rect_size", texture_size); + undo_redo->add_do_property(child, "size", texture_size); } else if (Object::cast_to<Polygon2D>(child)) { Size2 texture_size = texture->get_size(); Vector<Vector2> list = { @@ -5612,6 +5612,11 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String & Transform2D xform = canvas_item_editor->get_canvas_transform(); Point2 target_position = xform.affine_inverse().xform(p_point); + // Adjust position for Control and TouchScreenButton + if (Object::cast_to<Control>(child) || Object::cast_to<TouchScreenButton>(child)) { + target_position -= texture->get_size() / 2; + } + // there's nothing to be used as source position so snapping will work as absolute if enabled target_position = canvas_item_editor->snap_point(target_position); undo_redo->add_do_method(child, "set_global_position", target_position); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index fc13393582..ae7570e161 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -152,7 +152,7 @@ bool TileSetAtlasSourceEditor::AtlasTileProxyObject::_set(const StringName &p_na // ID and size related properties. if (tiles.size() == 1) { - const Vector2i &coords = tiles.front()->get().tile; + const Vector2i coords = tiles.front()->get().tile; const int &alternative = tiles.front()->get().alternative; if (alternative == 0) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index b7cca72624..249504b6e8 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1253,7 +1253,6 @@ void ProjectList::migrate_config() { if (FileAccess::exists(_config_path)) { return; } - print_line("Migrating legacy project list"); List<PropertyInfo> properties; EditorSettings::get_singleton()->get_property_list(&properties); @@ -1266,6 +1265,8 @@ void ProjectList::migrate_config() { } String path = EDITOR_GET(property_key); + print_line("Migrating legacy project '" + path + "'."); + String favoriteKey = "favorite_projects/" + property_key.get_slice("/", 1); bool favorite = EditorSettings::get_singleton()->has_setting(favoriteKey); add_project(path, favorite); diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 24dd94873b..f8fe015c6b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3785,15 +3785,14 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node } break; case GDScriptParser::DataType::CLASS: - // Can assume type is a global GDScript class. if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) { variable->export_info.type = Variant::OBJECT; variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE; - variable->export_info.hint_string = export_type.class_type->identifier->name; + variable->export_info.hint_string = export_type.to_string(); } else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) { variable->export_info.type = Variant::OBJECT; variable->export_info.hint = PROPERTY_HINT_NODE_TYPE; - variable->export_info.hint_string = export_type.class_type->identifier->name; + variable->export_info.hint_string = export_type.to_string(); } else { push_error(R"(Export type can only be built-in, a resource, a node or an enum.)", variable); return false; diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs index 3f588a4c90..63339b3487 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs @@ -78,10 +78,6 @@ namespace Godot.SourceGenerators var source = new StringBuilder(); - source.Append("using Godot;\n"); - source.Append("using Godot.NativeInterop;\n"); - source.Append("\n"); - if (hasNamespace) { source.Append("namespace "); @@ -281,7 +277,7 @@ namespace Godot.SourceGenerators { source.Append("#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword\n"); - string dictionaryType = "System.Collections.Generic.Dictionary<StringName, object>"; + string dictionaryType = "System.Collections.Generic.Dictionary<Godot.StringName, object>"; source.Append("#if TOOLS\n"); source.Append(" internal new static "); diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 5860a4f0ae..5e71d10a3f 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -1834,8 +1834,8 @@ bool EditorExportPlatformMacOS::has_valid_project_configuration(const Ref<Editor if (p_preset->get("notarization/apple_id_name") != "") { if (p_preset->get("notarization/apple_id_password") == "") { err += TTR("Notarization: Apple ID password not specified.") + "\n"; + valid = false; } - valid = false; } if (p_preset->get("notarization/api_uuid") != "") { if (p_preset->get("notarization/api_key") == "") { diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 84bfc48a43..4788a1b813 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -328,29 +328,6 @@ void Node2D::set_global_transform(const Transform2D &p_transform) { } } -void Node2D::set_z_index(int p_z) { - ERR_FAIL_COND(p_z < RS::CANVAS_ITEM_Z_MIN); - ERR_FAIL_COND(p_z > RS::CANVAS_ITEM_Z_MAX); - z_index = p_z; - RS::get_singleton()->canvas_item_set_z_index(get_canvas_item(), z_index); -} - -void Node2D::set_z_as_relative(bool p_enabled) { - if (z_relative == p_enabled) { - return; - } - z_relative = p_enabled; - RS::get_singleton()->canvas_item_set_z_as_relative_to_parent(get_canvas_item(), p_enabled); -} - -bool Node2D::is_z_relative() const { - return z_relative; -} - -int Node2D::get_z_index() const { - return z_index; -} - Transform2D Node2D::get_relative_transform_to_parent(const Node *p_parent) const { if (p_parent == this) { return Transform2D(); @@ -382,15 +359,6 @@ Point2 Node2D::to_global(Point2 p_local) const { return get_global_transform().xform(p_local); } -void Node2D::set_y_sort_enabled(bool p_enabled) { - y_sort_enabled = p_enabled; - RS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), y_sort_enabled); -} - -bool Node2D::is_y_sort_enabled() const { - return y_sort_enabled; -} - void Node2D::_notification(int p_notification) { switch (p_notification) { case NOTIFICATION_MOVED_IN_PARENT: { @@ -437,15 +405,6 @@ void Node2D::_bind_methods() { ClassDB::bind_method(D_METHOD("to_local", "global_point"), &Node2D::to_local); ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Node2D::to_global); - ClassDB::bind_method(D_METHOD("set_z_index", "z_index"), &Node2D::set_z_index); - ClassDB::bind_method(D_METHOD("get_z_index"), &Node2D::get_z_index); - - ClassDB::bind_method(D_METHOD("set_z_as_relative", "enable"), &Node2D::set_z_as_relative); - ClassDB::bind_method(D_METHOD("is_z_relative"), &Node2D::is_z_relative); - - ClassDB::bind_method(D_METHOD("set_y_sort_enabled", "enabled"), &Node2D::set_y_sort_enabled); - ClassDB::bind_method(D_METHOD("is_y_sort_enabled"), &Node2D::is_y_sort_enabled); - ClassDB::bind_method(D_METHOD("get_relative_transform_to_parent", "parent"), &Node2D::get_relative_transform_to_parent); ADD_GROUP("Transform", ""); @@ -460,9 +419,4 @@ void Node2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_global_scale", "get_global_scale"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_skew", PROPERTY_HINT_NONE, "radians", PROPERTY_USAGE_NONE), "set_global_skew", "get_global_skew"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "suffix:px", PROPERTY_USAGE_NONE), "set_global_transform", "get_global_transform"); - - ADD_GROUP("Ordering", ""); - ADD_PROPERTY(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "z_as_relative"), "set_z_as_relative", "is_z_relative"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "y_sort_enabled"), "set_y_sort_enabled", "is_y_sort_enabled"); } diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 04bbdf639d..76707dc422 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -40,9 +40,6 @@ class Node2D : public CanvasItem { real_t rotation = 0.0; Size2 scale = Vector2(1, 1); real_t skew = 0.0; - int z_index = 0; - bool z_relative = true; - bool y_sort_enabled = false; Transform2D transform; @@ -103,21 +100,12 @@ public: void set_global_skew(const real_t p_radians); void set_global_scale(const Size2 &p_scale); - void set_z_index(int p_z); - int get_z_index() const; - void look_at(const Vector2 &p_pos); real_t get_angle_to(const Vector2 &p_pos) const; Point2 to_local(Point2 p_global) const; Point2 to_global(Point2 p_local) const; - void set_z_as_relative(bool p_enabled); - bool is_z_relative() const; - - virtual void set_y_sort_enabled(bool p_enabled); - virtual bool is_y_sort_enabled() const; - Transform2D get_relative_transform_to_parent(const Node *p_parent) const; Transform2D get_transform() const override; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 92ee21a916..e90a6a69ab 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -220,6 +220,10 @@ PackedStringArray Control::get_configuration_warnings() const { warnings.push_back(RTR("The Hint Tooltip won't be displayed as the control's Mouse Filter is set to \"Ignore\". To solve this, set the Mouse Filter to \"Stop\" or \"Pass\".")); } + if (get_z_index() != 0) { + warnings.push_back(RTR("Changing the Z index of a control only affects the drawing order, not the input event handling order.")); + } + return warnings; } @@ -481,10 +485,10 @@ void Control::_validate_property(PropertyInfo &p_property) const { } } else if (Object::cast_to<Container>(parent_node)) { // If the parent is a container, display only container-related properties. - if (p_property.name.begins_with("anchor_") || p_property.name.begins_with("offset_") || p_property.name.begins_with("grow_") || p_property.name == "anchors_preset" || - p_property.name == "position" || p_property.name == "rotation" || p_property.name == "scale" || p_property.name == "size" || p_property.name == "pivot_offset") { - p_property.usage ^= PROPERTY_USAGE_EDITOR; - + if (p_property.name.begins_with("anchor_") || p_property.name.begins_with("offset_") || p_property.name.begins_with("grow_") || p_property.name == "anchors_preset") { + p_property.usage ^= PROPERTY_USAGE_DEFAULT; + } else if (p_property.name == "position" || p_property.name == "rotation" || p_property.name == "scale" || p_property.name == "size" || p_property.name == "pivot_offset") { + p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY; } else if (p_property.name == "layout_mode") { // Set the layout mode to be disabled with the proper value. p_property.hint_string = "Position,Anchors,Container,Uncontrolled"; diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 7bcd4721fc..2563fa5914 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -450,6 +450,39 @@ void CanvasItem::item_rect_changed(bool p_size_changed) { emit_signal(SceneStringNames::get_singleton()->item_rect_changed); } +void CanvasItem::set_z_index(int p_z) { + ERR_FAIL_COND(p_z < RS::CANVAS_ITEM_Z_MIN); + ERR_FAIL_COND(p_z > RS::CANVAS_ITEM_Z_MAX); + z_index = p_z; + RS::get_singleton()->canvas_item_set_z_index(canvas_item, z_index); + update_configuration_warnings(); +} + +void CanvasItem::set_z_as_relative(bool p_enabled) { + if (z_relative == p_enabled) { + return; + } + z_relative = p_enabled; + RS::get_singleton()->canvas_item_set_z_as_relative_to_parent(canvas_item, p_enabled); +} + +bool CanvasItem::is_z_relative() const { + return z_relative; +} + +int CanvasItem::get_z_index() const { + return z_index; +} + +void CanvasItem::set_y_sort_enabled(bool p_enabled) { + y_sort_enabled = p_enabled; + RS::get_singleton()->canvas_item_set_sort_children_by_y(canvas_item, y_sort_enabled); +} + +bool CanvasItem::is_y_sort_enabled() const { + return y_sort_enabled; +} + void CanvasItem::draw_dashed_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width, real_t p_dash) { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -913,9 +946,19 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("set_modulate", "modulate"), &CanvasItem::set_modulate); ClassDB::bind_method(D_METHOD("get_modulate"), &CanvasItem::get_modulate); + ClassDB::bind_method(D_METHOD("set_self_modulate", "self_modulate"), &CanvasItem::set_self_modulate); ClassDB::bind_method(D_METHOD("get_self_modulate"), &CanvasItem::get_self_modulate); + ClassDB::bind_method(D_METHOD("set_z_index", "z_index"), &Node2D::set_z_index); + ClassDB::bind_method(D_METHOD("get_z_index"), &Node2D::get_z_index); + + ClassDB::bind_method(D_METHOD("set_z_as_relative", "enable"), &Node2D::set_z_as_relative); + ClassDB::bind_method(D_METHOD("is_z_relative"), &Node2D::is_z_relative); + + ClassDB::bind_method(D_METHOD("set_y_sort_enabled", "enabled"), &Node2D::set_y_sort_enabled); + ClassDB::bind_method(D_METHOD("is_y_sort_enabled"), &Node2D::is_y_sort_enabled); + ClassDB::bind_method(D_METHOD("set_draw_behind_parent", "enable"), &CanvasItem::set_draw_behind_parent); ClassDB::bind_method(D_METHOD("is_draw_behind_parent_enabled"), &CanvasItem::is_draw_behind_parent_enabled); @@ -1005,6 +1048,11 @@ void CanvasItem::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "light_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_light_mask", "get_light_mask"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visibility_layer", PROPERTY_HINT_LAYERS_2D_RENDER), "set_visibility_layer", "get_visibility_layer"); + ADD_GROUP("Ordering", ""); + ADD_PROPERTY(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "z_as_relative"), "set_z_as_relative", "is_z_relative"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "y_sort_enabled"), "set_y_sort_enabled", "is_y_sort_enabled"); + ADD_GROUP("Texture", "texture_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_filter", PROPERTY_HINT_ENUM, "Inherit,Nearest,Linear,Nearest Mipmap,Linear Mipmap,Nearest Mipmap Anisotropic,Linear Mipmap Anisotropic"), "set_texture_filter", "get_texture_filter"); ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_repeat", PROPERTY_HINT_ENUM, "Inherit,Disabled,Enabled,Mirror"), "set_texture_repeat", "get_texture_repeat"); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 4e78a175dc..4ace982825 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -91,6 +91,10 @@ private: int light_mask = 1; uint32_t visibility_layer = 1; + int z_index = 0; + bool z_relative = true; + bool y_sort_enabled = false; + Window *window = nullptr; bool visible = true; bool parent_visible_in_tree = false; @@ -230,6 +234,17 @@ public: void set_visibility_layer_bit(uint32_t p_visibility_layer, bool p_enable); bool get_visibility_layer_bit(uint32_t p_visibility_layer) const; + /* ORDERING */ + + void set_z_index(int p_z); + int get_z_index() const; + + void set_z_as_relative(bool p_enabled); + bool is_z_relative() const; + + virtual void set_y_sort_enabled(bool p_enabled); + virtual bool is_y_sort_enabled() const; + /* DRAWING API */ void draw_dashed_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width = 1.0, real_t p_dash = 2.0); diff --git a/thirdparty/README.md b/thirdparty/README.md index a75ceda7d3..37b83c4c05 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -398,7 +398,7 @@ to solve some MSVC warnings. See the patches in the `patches` directory. ## miniupnpc - Upstream: https://github.com/miniupnp/miniupnp -- Version: 2.2.3 (2df8120326ed4246e049a7a6de707539604cd514, 2021) +- Version: 2.2.4 (7d1d8bc3868b08ad003bad235eee57562b95b76d, 2022) - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/miniupnpc/LICENSE b/thirdparty/miniupnpc/LICENSE index fe9118c07e..67ff3bb627 100644 --- a/thirdparty/miniupnpc/LICENSE +++ b/thirdparty/miniupnpc/LICENSE @@ -1,26 +1,29 @@ -MiniUPnP Project -Copyright (c) 2005-2020, Thomas BERNARD +BSD 3-Clause License + +Copyright (c) 2005-2022, Thomas BERNARD All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/thirdparty/miniupnpc/include/miniupnpc.h b/thirdparty/miniupnpc/include/miniupnpc.h index a10bd950a8..75fb8b702d 100644 --- a/thirdparty/miniupnpc/include/miniupnpc.h +++ b/thirdparty/miniupnpc/include/miniupnpc.h @@ -1,9 +1,9 @@ -/* $Id: miniupnpc.h,v 1.59 2021/09/28 21:39:17 nanard Exp $ */ +/* $Id: miniupnpc.h,v 1.61 2022/10/21 21:15:02 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project: miniupnp - * http://miniupnp.free.fr/ + * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author: Thomas Bernard - * Copyright (c) 2005-2021 Thomas Bernard + * Copyright (c) 2005-2022 Thomas Bernard * This software is subjects to the conditions detailed * in the LICENCE file provided within this distribution */ #ifndef MINIUPNPC_H_INCLUDED @@ -20,7 +20,7 @@ #define UPNPDISCOVER_MEMORY_ERROR (-102) /* versions : */ -#define MINIUPNPC_VERSION "2.2.3" +#define MINIUPNPC_VERSION "2.2.4" #define MINIUPNPC_API_VERSION 17 /* Source port: diff --git a/thirdparty/miniupnpc/src/miniupnpcstrings.h b/thirdparty/miniupnpc/src/miniupnpcstrings.h index eefbc8dbdd..25abc1016e 100644 --- a/thirdparty/miniupnpc/src/miniupnpcstrings.h +++ b/thirdparty/miniupnpc/src/miniupnpcstrings.h @@ -4,7 +4,7 @@ #include "core/version.h" #define OS_STRING VERSION_NAME "/1.0" -#define MINIUPNPC_VERSION_STRING "2.2.3" +#define MINIUPNPC_VERSION_STRING "2.2.4" #if 0 /* according to "UPnP Device Architecture 1.0" */ diff --git a/thirdparty/miniupnpc/src/minixml.c b/thirdparty/miniupnpc/src/minixml.c index ed2d3c759c..935ec443e7 100644 --- a/thirdparty/miniupnpc/src/minixml.c +++ b/thirdparty/miniupnpc/src/minixml.c @@ -1,4 +1,4 @@ -/* $Id: minixml.c,v 1.10 2012/03/05 19:42:47 nanard Exp $ */ +/* $Id: minixml.c,v 1.12 2017/12/12 11:17:40 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * minixml.c : the minimum size a xml parser can be ! */ /* Project : miniupnp |