diff options
28 files changed, 134 insertions, 53 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 60b7326c29..ae2b56e7b7 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -257,14 +257,14 @@ void AStar::reserve_space(int p_num_nodes) { points.reserve(p_num_nodes); } -int AStar::get_closest_point(const Vector3 &p_point) const { +int AStar::get_closest_point(const Vector3 &p_point, bool p_include_disabled) const { int closest_id = -1; real_t closest_dist = 1e20; for (OAHashMap<int, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) { - if (!(*it.value)->enabled) continue; // Disabled points should not be considered. + if (!p_include_disabled && !(*it.value)->enabled) continue; // Disabled points should not be considered. real_t d = p_point.distance_squared_to((*it.value)->pos); if (closest_id < 0 || d < closest_dist) { @@ -540,7 +540,7 @@ void AStar::_bind_methods() { ClassDB::bind_method(D_METHOD("reserve_space", "num_nodes"), &AStar::reserve_space); ClassDB::bind_method(D_METHOD("clear"), &AStar::clear); - ClassDB::bind_method(D_METHOD("get_closest_point", "to_position"), &AStar::get_closest_point); + ClassDB::bind_method(D_METHOD("get_closest_point", "to_position", "include_disabled"), &AStar::get_closest_point, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_closest_position_in_segment", "to_position"), &AStar::get_closest_position_in_segment); ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar::get_point_path); @@ -638,8 +638,8 @@ void AStar2D::reserve_space(int p_num_nodes) { astar.reserve_space(p_num_nodes); } -int AStar2D::get_closest_point(const Vector2 &p_point) const { - return astar.get_closest_point(Vector3(p_point.x, p_point.y, 0)); +int AStar2D::get_closest_point(const Vector2 &p_point, bool p_include_disabled) const { + return astar.get_closest_point(Vector3(p_point.x, p_point.y, 0), p_include_disabled); } Vector2 AStar2D::get_closest_position_in_segment(const Vector2 &p_point) const { @@ -693,7 +693,7 @@ void AStar2D::_bind_methods() { ClassDB::bind_method(D_METHOD("reserve_space", "num_nodes"), &AStar2D::reserve_space); ClassDB::bind_method(D_METHOD("clear"), &AStar2D::clear); - ClassDB::bind_method(D_METHOD("get_closest_point", "to_position"), &AStar2D::get_closest_point); + ClassDB::bind_method(D_METHOD("get_closest_point", "to_position", "include_disabled"), &AStar2D::get_closest_point, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_closest_position_in_segment", "to_position"), &AStar2D::get_closest_position_in_segment); ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar2D::get_point_path); diff --git a/core/math/a_star.h b/core/math/a_star.h index ec2a06f07f..0a5d3e992c 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -141,7 +141,7 @@ public: void reserve_space(int p_num_nodes); void clear(); - int get_closest_point(const Vector3 &p_point) const; + int get_closest_point(const Vector3 &p_point, bool p_include_disabled = false) const; Vector3 get_closest_position_in_segment(const Vector3 &p_point) const; PoolVector<Vector3> get_point_path(int p_from_id, int p_to_id); @@ -183,7 +183,7 @@ public: void reserve_space(int p_num_nodes); void clear(); - int get_closest_point(const Vector2 &p_point) const; + int get_closest_point(const Vector2 &p_point, bool p_include_disabled = false) const; Vector2 get_closest_position_in_segment(const Vector2 &p_point) const; PoolVector<Vector2> get_point_path(int p_from_id, int p_to_id); diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index 4ec405f96c..bce7895973 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -41,7 +41,7 @@ <argument index="0" name="size" type="int"> </argument> <description> - Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed to [method StreamPeerSSL.acccept_stream]. + Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed to [method StreamPeerSSL.accept_stream]. </description> </method> <method name="generate_self_signed_certificate"> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index 6db6fea779..8c825c9e1c 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -5,7 +5,7 @@ </brief_description> <description> The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource]. - They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate. + They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed_certificate] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate. </description> <tutorials> </tutorials> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 6ec1545bc7..f7de79913c 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -82,7 +82,7 @@ </return> <argument index="0" name="string" type="String"> </argument> - <argument index="1" name="p_width" type="float"> + <argument index="1" name="width" type="float"> </argument> <description> </description> diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 27a78cd7d1..7cd95390e6 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -54,6 +54,15 @@ Returns the amount of bones in the skeleton. </description> </method> + <method name="get_bone_custom_pose" qualifiers="const"> + <return type="Transform"> + </return> + <argument index="0" name="bone_idx" type="int"> + </argument> + <description> + Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose. + </description> + </method> <method name="get_bone_global_pose" qualifiers="const"> <return type="Transform"> </return> @@ -161,6 +170,16 @@ <description> </description> </method> + <method name="set_bone_custom_pose"> + <return type="void"> + </return> + <argument index="0" name="bone_idx" type="int"> + </argument> + <argument index="1" name="custom_pose" type="Transform"> + </argument> + <description> + </description> + </method> <method name="set_bone_disable_rest"> <return type="void"> </return> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index fe70c2fdac..1ab5c58a30 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -89,8 +89,10 @@ </return> <argument index="0" name="column" type="int"> </argument> + <argument index="1" name="button_idx" type="int"> + </argument> <description> - Returns the tooltip for the button in column [code]column[/code]. + Returns the tooltip string for the button at index [code]button_idx[/code] in column [code]column[/code]. </description> </method> <method name="get_cell_mode" qualifiers="const"> diff --git a/doc/classes/X509Certificate.xml b/doc/classes/X509Certificate.xml index 8066f65391..50e9e4e0d4 100644 --- a/doc/classes/X509Certificate.xml +++ b/doc/classes/X509Certificate.xml @@ -5,7 +5,7 @@ </brief_description> <description> The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource]. - They can be used as the server certificate in [StreamPeerSSL.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an SSL server via [StreamPeerSSL.connect_to_stream]. + They can be used as the server certificate in [method StreamPeerSSL.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an SSL server via [method StreamPeerSSL.connect_to_stream]. </description> <tutorials> </tutorials> diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 14e274b84b..93d3ff1e18 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -203,6 +203,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = exceptions.push_back("StatusSuccess"); exceptions.push_back("StatusWarning"); exceptions.push_back("NodeWarning"); + exceptions.push_back("OverbrightIndicator"); ImageLoaderSVG::set_convert_colors(&dark_icon_color_dictionary); @@ -1104,6 +1105,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("screen_picker", "ColorPicker", theme->get_icon("ColorPick", "EditorIcons")); theme->set_icon("add_preset", "ColorPicker", theme->get_icon("Add", "EditorIcons")); theme->set_icon("preset_bg", "ColorPicker", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); + theme->set_icon("overbright_indicator", "ColorPicker", theme->get_icon("OverbrightIndicator", "EditorIcons")); theme->set_icon("bg", "ColorPickerButton", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); diff --git a/editor/icons/icon_overbright_indicator.svg b/editor/icons/icon_overbright_indicator.svg new file mode 100644 index 0000000000..9e6f53b727 --- /dev/null +++ b/editor/icons/icon_overbright_indicator.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v10l10-10z" fill="#fff"/><path d="m0 12 12-12h-2l-10 10z" fill="#000003"/></svg>
\ No newline at end of file diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index df6b23c167..9afe99c16d 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -910,16 +910,22 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (e) { Node *node = e->get(); if (node) { + bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(node); bool placeholder = node->get_scene_instance_load_placeholder(); + + // Fire confirmation dialog when children are editable. + if (editable && !placeholder) { + placeholder_editable_instance_remove_dialog->set_text(TTR("Enabling \"Load As Placeholder\" will disable \"Editable Children\" and cause all properties of the node to be reverted to their default.")); + placeholder_editable_instance_remove_dialog->popup_centered_minsize(); + break; + } + placeholder = !placeholder; - int editable_item_idx = menu->get_item_idx_from_text(TTR("Editable Children")); - int placeholder_item_idx = menu->get_item_idx_from_text(TTR("Load As Placeholder")); + if (placeholder) EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, false); node->set_scene_instance_load_placeholder(placeholder); - menu->set_item_checked(editable_item_idx, false); - menu->set_item_checked(placeholder_item_idx, placeholder); scene_tree->update_tree(); } } @@ -1791,6 +1797,25 @@ void SceneTreeDock::_toggle_editable_children_from_selection() { } } +void SceneTreeDock::_toggle_placeholder_from_selection() { + + List<Node *> selection = editor_selection->get_selected_node_list(); + List<Node *>::Element *e = selection.front(); + + if (e) { + Node *node = e->get(); + if (node) { + _toggle_editable_children(node); + + bool placeholder = node->get_scene_instance_load_placeholder(); + placeholder = !placeholder; + + node->set_scene_instance_load_placeholder(placeholder); + scene_tree->update_tree(); + } + } +} + void SceneTreeDock::_toggle_editable_children(Node *p_node) { if (p_node) { @@ -2728,6 +2753,7 @@ void SceneTreeDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_nodes_drag_begin"), &SceneTreeDock::_nodes_drag_begin); ClassDB::bind_method(D_METHOD("_delete_confirm"), &SceneTreeDock::_delete_confirm); ClassDB::bind_method(D_METHOD("_toggle_editable_children_from_selection"), &SceneTreeDock::_toggle_editable_children_from_selection); + ClassDB::bind_method(D_METHOD("_toggle_placeholder_from_selection"), &SceneTreeDock::_toggle_placeholder_from_selection); ClassDB::bind_method(D_METHOD("_node_prerenamed"), &SceneTreeDock::_node_prerenamed); ClassDB::bind_method(D_METHOD("_import_subscene"), &SceneTreeDock::_import_subscene); ClassDB::bind_method(D_METHOD("_selection_changed"), &SceneTreeDock::_selection_changed); @@ -2901,6 +2927,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel add_child(editable_instance_remove_dialog); editable_instance_remove_dialog->connect("confirmed", this, "_toggle_editable_children_from_selection"); + placeholder_editable_instance_remove_dialog = memnew(ConfirmationDialog); + add_child(placeholder_editable_instance_remove_dialog); + placeholder_editable_instance_remove_dialog->connect("confirmed", this, "_toggle_placeholder_from_selection"); + import_subscene_dialog = memnew(EditorSubScene); add_child(import_subscene_dialog); import_subscene_dialog->connect("subscene_selected", this, "_import_subscene"); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index cd582fdf57..014ce58e88 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -127,6 +127,7 @@ class SceneTreeDock : public VBoxContainer { AcceptDialog *accept; ConfirmationDialog *delete_dialog; ConfirmationDialog *editable_instance_remove_dialog; + ConfirmationDialog *placeholder_editable_instance_remove_dialog; ReparentDialog *reparent_dialog; EditorQuickOpen *quick_open; @@ -184,6 +185,8 @@ class SceneTreeDock : public VBoxContainer { void _toggle_editable_children_from_selection(); void _toggle_editable_children(Node *p_node); + void _toggle_placeholder_from_selection(); + void _node_prerenamed(Node *p_node, const String &p_new_name); void _nodes_drag_begin(); diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 28f098d323..28cab2ab61 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -30,7 +30,7 @@ #include "bindings_generator.h" -#ifdef DEBUG_METHODS_ENABLED +#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) #include "core/engine.h" #include "core/global_constants.h" diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 26718f1d11..8f3676940b 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -36,7 +36,7 @@ #include "editor/doc/doc_data.h" #include "editor/editor_help.h" -#ifdef DEBUG_METHODS_ENABLED +#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) #include "core/ustring.h" diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index b2e1deca01..544bfc4615 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -430,8 +430,8 @@ void GDMono::_register_internal_calls() { } void GDMono::_initialize_and_check_api_hashes() { - #ifdef MONO_GLUE_ENABLED +#ifdef DEBUG_METHODS_ENABLED if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) { ERR_PRINT("Mono: Core API hash mismatch."); } @@ -441,6 +441,7 @@ void GDMono::_initialize_and_check_api_hashes() { ERR_PRINT("Mono: Editor API hash mismatch."); } #endif // TOOLS_ENABLED +#endif // DEBUG_METHODS_ENABLED #endif // MONO_GLUE_ENABLED } diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index 4f7d3791f7..343d68bc2d 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -151,6 +151,7 @@ protected: static GDMono *singleton; public: +#ifdef DEBUG_METHODS_ENABLED uint64_t get_api_core_hash() { if (api_core_hash == 0) api_core_hash = ClassDB::get_api_hash(ClassDB::API_CORE); @@ -162,7 +163,8 @@ public: api_editor_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); return api_editor_hash; } -#endif +#endif // TOOLS_ENABLED +#endif // DEBUG_METHODS_ENABLED #ifdef TOOLS_ENABLED bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config); diff --git a/modules/visual_script/config.py b/modules/visual_script/config.py index 04e1a40b81..087a13a200 100644 --- a/modules/visual_script/config.py +++ b/modules/visual_script/config.py @@ -11,6 +11,7 @@ def get_doc_classes(): "VisualScriptBuiltinFunc", "VisualScriptClassConstant", "VisualScriptComment", + "VisualScriptComposeArray", "VisualScriptCondition", "VisualScriptConstant", "VisualScriptConstructor", @@ -28,6 +29,7 @@ def get_doc_classes(): "VisualScriptIndexSet", "VisualScriptInputAction", "VisualScriptIterator", + "VisualScriptLists", "VisualScriptLocalVarSet", "VisualScriptLocalVar", "VisualScriptMathConstant", diff --git a/modules/visual_script/doc_classes/VisualScriptLists.xml b/modules/visual_script/doc_classes/VisualScriptLists.xml index eac0b218af..8cf3eb1d38 100644 --- a/modules/visual_script/doc_classes/VisualScriptLists.xml +++ b/modules/visual_script/doc_classes/VisualScriptLists.xml @@ -12,11 +12,11 @@ <method name="add_input_data_port"> <return type="void"> </return> - <argument index="0" name="p_type" type="int" enum="Variant.Type"> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> - <argument index="1" name="p_name" type="String"> + <argument index="1" name="name" type="String"> </argument> - <argument index="2" name="p_index" type="int"> + <argument index="2" name="index" type="int"> </argument> <description> </description> @@ -24,11 +24,11 @@ <method name="add_output_data_port"> <return type="void"> </return> - <argument index="0" name="p_type" type="int" enum="Variant.Type"> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> - <argument index="1" name="p_name" type="String"> + <argument index="1" name="name" type="String"> </argument> - <argument index="2" name="p_index" type="int"> + <argument index="2" name="index" type="int"> </argument> <description> </description> @@ -36,7 +36,7 @@ <method name="remove_input_data_port"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> </description> @@ -44,7 +44,7 @@ <method name="remove_output_data_port"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> </description> @@ -52,9 +52,9 @@ <method name="set_input_data_port_name"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="p_name" type="String"> + <argument index="1" name="name" type="String"> </argument> <description> </description> @@ -62,9 +62,9 @@ <method name="set_input_data_port_type"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="p_type" type="int" enum="Variant.Type"> + <argument index="1" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> @@ -72,9 +72,9 @@ <method name="set_output_data_port_name"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="p_name" type="String"> + <argument index="1" name="name" type="String"> </argument> <description> </description> @@ -82,9 +82,9 @@ <method name="set_output_data_port_type"> <return type="void"> </return> - <argument index="0" name="p_index" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="p_type" type="int" enum="Variant.Type"> + <argument index="1" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index a9169a411a..0399dbc87c 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1350,7 +1350,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt return; //or crash because it will become invalid } } else if (ti->get_parent() == root->get_children()) { - selected = ti->get_metadata(0); + selected = ti->get_text(0); function_name_edit->set_position(Input::get_singleton()->get_mouse_position() - Vector2(60, -10)); function_name_edit->popup(); } diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 8c849b28c8..dbcd3c19f8 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -700,15 +700,15 @@ VisualScriptLists::VisualScriptLists() { } void VisualScriptLists::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_input_data_port"), &VisualScriptLists::add_input_data_port); - ClassDB::bind_method(D_METHOD("set_input_data_port_name"), &VisualScriptLists::set_input_data_port_name); - ClassDB::bind_method(D_METHOD("set_input_data_port_type"), &VisualScriptLists::set_input_data_port_type); - ClassDB::bind_method(D_METHOD("remove_input_data_port"), &VisualScriptLists::remove_input_data_port); - - ClassDB::bind_method(D_METHOD("add_output_data_port"), &VisualScriptLists::add_output_data_port); - ClassDB::bind_method(D_METHOD("set_output_data_port_name"), &VisualScriptLists::set_output_data_port_name); - ClassDB::bind_method(D_METHOD("set_output_data_port_type"), &VisualScriptLists::set_output_data_port_type); - ClassDB::bind_method(D_METHOD("remove_output_data_port"), &VisualScriptLists::remove_output_data_port); + ClassDB::bind_method(D_METHOD("add_input_data_port", "type", "name", "index"), &VisualScriptLists::add_input_data_port); + ClassDB::bind_method(D_METHOD("set_input_data_port_name", "index", "name"), &VisualScriptLists::set_input_data_port_name); + ClassDB::bind_method(D_METHOD("set_input_data_port_type", "index", "type"), &VisualScriptLists::set_input_data_port_type); + ClassDB::bind_method(D_METHOD("remove_input_data_port", "index"), &VisualScriptLists::remove_input_data_port); + + ClassDB::bind_method(D_METHOD("add_output_data_port", "type", "name", "index"), &VisualScriptLists::add_output_data_port); + ClassDB::bind_method(D_METHOD("set_output_data_port_name", "index", "name"), &VisualScriptLists::set_output_data_port_name); + ClassDB::bind_method(D_METHOD("set_output_data_port_type", "index", "type"), &VisualScriptLists::set_output_data_port_type); + ClassDB::bind_method(D_METHOD("remove_output_data_port", "index"), &VisualScriptLists::remove_output_data_port); } ////////////////////////////////////////// diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index b0f567f183..ae79b4eebf 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -792,6 +792,7 @@ Ref<SkinReference> Skeleton::register_skin(const Ref<Skin> &p_skin) { skin_bindings.insert(skin_ref.operator->()); skin->connect("changed", skin_ref.operator->(), "_skin_changed"); + _make_dirty(); return skin_ref; } diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 6dd9e401f6..ffe011e5f7 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -396,11 +396,18 @@ void ColorPicker::_update_text_value() { } void ColorPicker::_sample_draw() { - Rect2 r = Rect2(Point2(), Size2(uv_edit->get_size().width, sample->get_size().height * 0.95)); + const Rect2 r = Rect2(Point2(), Size2(uv_edit->get_size().width, sample->get_size().height * 0.95)); + if (color.a < 1.0) { sample->draw_texture_rect(get_icon("preset_bg", "ColorPicker"), r, true); } + sample->draw_rect(r, color); + + if (color.r > 1 || color.g > 1 || color.b > 1) { + // Draw an indicator to denote that the color is "overbright" and can't be displayed accurately in the preview + sample->draw_texture(get_icon("overbright_indicator", "ColorPicker"), Point2()); + } } void ColorPicker::_hsv_draw(int p_which, Control *c) { @@ -894,10 +901,15 @@ void ColorPickerButton::_notification(int p_what) { switch (p_what) { case NOTIFICATION_DRAW: { - Ref<StyleBox> normal = get_stylebox("normal"); - Rect2 r = Rect2(normal->get_offset(), get_size() - normal->get_minimum_size()); + const Ref<StyleBox> normal = get_stylebox("normal"); + const Rect2 r = Rect2(normal->get_offset(), get_size() - normal->get_minimum_size()); draw_texture_rect(Control::get_icon("bg", "ColorPickerButton"), r, true); draw_rect(r, color); + + if (color.r > 1 || color.g > 1 || color.b > 1) { + // Draw an indicator to denote that the color is "overbright" and can't be displayed accurately in the preview + draw_texture(Control::get_icon("overbright_indicator", "ColorPicker"), normal->get_offset()); + } } break; case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: { diff --git a/scene/gui/rich_text_effect.cpp b/scene/gui/rich_text_effect.cpp index e0bb3ae219..f9e0be5b31 100644 --- a/scene/gui/rich_text_effect.cpp +++ b/scene/gui/rich_text_effect.cpp @@ -119,6 +119,7 @@ CharFXTransform::CharFXTransform() { offset = Point2(); color = Color(); character = 0; + elapsed_time = 0.0f; } CharFXTransform::~CharFXTransform() { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index b01d782f00..2fc4be6900 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -800,7 +800,7 @@ void TreeItem::_bind_methods() { ClassDB::bind_method(D_METHOD("add_button", "column", "button", "button_idx", "disabled", "tooltip"), &TreeItem::add_button, DEFVAL(-1), DEFVAL(false), DEFVAL("")); ClassDB::bind_method(D_METHOD("get_button_count", "column"), &TreeItem::get_button_count); - ClassDB::bind_method(D_METHOD("get_button_tooltip", "column"), &TreeItem::get_button_tooltip); + ClassDB::bind_method(D_METHOD("get_button_tooltip", "column", "button_idx"), &TreeItem::get_button_tooltip); ClassDB::bind_method(D_METHOD("get_button", "column", "button_idx"), &TreeItem::get_button); ClassDB::bind_method(D_METHOD("set_button", "column", "button_idx", "button"), &TreeItem::set_button); ClassDB::bind_method(D_METHOD("erase_button", "column", "button_idx"), &TreeItem::erase_button); diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index f68dc9af38..0dcc184a1d 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -763,7 +763,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("folder_icon_modulate", "FileDialog", Color(1, 1, 1)); theme->set_color("files_disabled", "FileDialog", Color(0, 0, 0, 0.7)); - // colorPicker + // ColorPicker theme->set_constant("margin", "ColorPicker", 4 * scale); theme->set_constant("sv_width", "ColorPicker", 256 * scale); @@ -776,6 +776,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("color_hue", "ColorPicker", make_icon(color_picker_hue_png)); theme->set_icon("color_sample", "ColorPicker", make_icon(color_picker_sample_png)); theme->set_icon("preset_bg", "ColorPicker", make_icon(mini_checkerboard_png)); + theme->set_icon("overbright_indicator", "ColorPicker", make_icon(overbright_indicator_png)); theme->set_icon("bg", "ColorPickerButton", make_icon(mini_checkerboard_png)); diff --git a/scene/resources/default_theme/overbright_indicator.png b/scene/resources/default_theme/overbright_indicator.png Binary files differnew file mode 100644 index 0000000000..89f800c230 --- /dev/null +++ b/scene/resources/default_theme/overbright_indicator.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index 11904b7aff..0d57fc6b14 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -218,6 +218,10 @@ static const unsigned char option_button_pressed_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x40, 0xde, 0x8d, 0x6b, 0x0, 0x0, 0x1, 0x4a, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, 0x2f, 0x37, 0x46, 0x43, 0x4f, 0x2b, 0x2b, 0x31, 0x2e, 0x2e, 0x34, 0x47, 0x44, 0x50, 0x2a, 0x2a, 0x30, 0x55, 0x52, 0x5f, 0x22, 0x22, 0x27, 0x3d, 0x3a, 0x45, 0x56, 0x52, 0x60, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x43, 0x40, 0x4c, 0x42, 0x40, 0x4b, 0x4c, 0x49, 0x56, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x2d, 0x2d, 0x34, 0x2f, 0x2f, 0x36, 0x2e, 0x2e, 0x35, 0x2c, 0x2c, 0x32, 0x3a, 0x38, 0x41, 0x36, 0x34, 0x3d, 0x44, 0x41, 0x4c, 0x26, 0x26, 0x2b, 0x24, 0x24, 0x28, 0x27, 0x27, 0x2d, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x25, 0x25, 0x2b, 0x23, 0x23, 0x28, 0x44, 0x42, 0x4e, 0x36, 0x34, 0x3e, 0x44, 0x41, 0x4e, 0x26, 0x26, 0x2c, 0x25, 0x25, 0x2a, 0x2a, 0x2a, 0x2f, 0x2b, 0x2b, 0x31, 0x22, 0x22, 0x26, 0x46, 0x42, 0x4f, 0x38, 0x35, 0x3f, 0x2d, 0x2d, 0x33, 0x22, 0x22, 0x27, 0x47, 0x45, 0x50, 0x39, 0x37, 0x40, 0x27, 0x27, 0x2b, 0x2e, 0x2e, 0x34, 0x2c, 0x2c, 0x31, 0x29, 0x29, 0x2e, 0x49, 0x46, 0x53, 0x3a, 0x38, 0x42, 0x4a, 0x47, 0x54, 0x3b, 0x39, 0x43, 0x24, 0x24, 0x2a, 0x24, 0x24, 0x29, 0x20, 0x20, 0x25, 0x4b, 0x49, 0x55, 0x3c, 0x3a, 0x44, 0x28, 0x28, 0x2d, 0x2b, 0x2b, 0x30, 0x29, 0x29, 0x2d, 0x20, 0x20, 0x23, 0x4e, 0x4a, 0x58, 0x3e, 0x3b, 0x46, 0x22, 0x22, 0x28, 0x27, 0x27, 0x2c, 0x1e, 0x1e, 0x22, 0x50, 0x4d, 0x5a, 0x3f, 0x3d, 0x48, 0x3f, 0x3d, 0x47, 0x4f, 0x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6f, 0x8e, 0x5f, 0x56, 0xc0, 0x53, 0x20, 0x8f, 0xbf, 0xdb, 0x86, 0x58, 0x5b, 0x9, 0xbf, 0x47, 0x80, 0xa, 0x58, 0x1a, 0x38, 0xad, 0x9, 0x5f, 0xac, 0xe3, 0x20, 0xbc, 0x4b, 0x46, 0x4b, 0x0, 0x3a, 0x1a, 0x24, 0xd0, 0x69, 0x85, 0xc0, 0x63, 0x5, 0x60, 0x68, 0xf0, 0x36, 0x7f, 0xf3, 0xaa, 0xbe, 0xe1, 0x61, 0x81, 0x69, 0x5, 0x72, 0x5b, 0x83, 0xe4, 0x6a, 0x59, 0x16, 0xf7, 0x53, 0x47, 0x77, 0x8b, 0xad, 0x12, 0xe4, 0xb9, 0xa3, 0xc1, 0xe6, 0x83, 0x7b, 0x20, 0xd6, 0xb4, 0xe7, 0xbf, 0xed, 0xe1, 0x1a, 0xd8, 0xfa, 0xdf, 0xb9, 0x70, 0xb8, 0x21, 0xd6, 0xbb, 0x17, 0x1b, 0xe3, 0x4c, 0x6a, 0xb0, 0xbd, 0x25, 0x5, 0x3b, 0x5e, 0x7c, 0x21, 0xc0, 0xc2, 0x68, 0xee, 0xf1, 0xbc, 0x6, 0x46, 0xb1, 0xbd, 0x5e, 0x30, 0x5, 0x27, 0x19, 0x24, 0xb8, 0x61, 0x6e, 0xf8, 0xf5, 0xf7, 0xcd, 0x47, 0x16, 0xa0, 0x18, 0x13, 0x6a, 0x64, 0x7d, 0xff, 0x8f, 0x1e, 0x59, 0x84, 0xa2, 0x1b, 0x0, 0xe5, 0xe0, 0x4e, 0x46, 0x1d, 0x98, 0x92, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; +static const unsigned char overbright_indicator_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0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0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + static const unsigned char panel_bg_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x1, 0x3, 0x0, 0x0, 0x0, 0xfe, 0xc1, 0x2c, 0xc8, 0x0, 0x0, 0x0, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x25, 0x25, 0x2a, 0x35, 0x32, 0x3b, 0x4a, 0x73, 0x58, 0x4a, 0x0, 0x0, 0x0, 0xa, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0x63, 0x40, 0x3, 0x0, 0x0, 0x10, 0x0, 0x1, 0xb3, 0xac, 0xe2, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index c94e143580..124e4d37e6 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -96,7 +96,7 @@ void Font::_bind_methods() { ClassDB::bind_method(D_METHOD("get_height"), &Font::get_height); ClassDB::bind_method(D_METHOD("is_distance_field_hint"), &Font::is_distance_field_hint); ClassDB::bind_method(D_METHOD("get_string_size", "string"), &Font::get_string_size); - ClassDB::bind_method(D_METHOD("get_wordwrap_string_size", "string", "p_width"), &Font::get_wordwrap_string_size); + ClassDB::bind_method(D_METHOD("get_wordwrap_string_size", "string", "width"), &Font::get_wordwrap_string_size); ClassDB::bind_method(D_METHOD("has_outline"), &Font::has_outline); ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "position", "char", "next", "modulate", "outline"), &Font::draw_char, DEFVAL(-1), DEFVAL(Color(1, 1, 1)), DEFVAL(false)); ClassDB::bind_method(D_METHOD("update_changes"), &Font::update_changes); |